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
99Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com>99Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com>
100Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com>100Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com>
101Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com>101Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com>
102Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com>
102James Bottomley <jejb@mulgrave.(none)>103James Bottomley <jejb@mulgrave.(none)>
103James Bottomley <jejb@titanic.il.steeleye.com>104James Bottomley <jejb@titanic.il.steeleye.com>
104James E Wilson <wilson@specifix.com>105James 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
29 29
30 The files are read only.30 The files are read only.
31 31
32What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_enable32What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld3_version
33 33
34Date: November 201834Date: November 2018
35KernelVersion: 5.035KernelVersion: 5.0
36Contact: Vadim Pasternak <vadimpmellanox.com>36Contact: Vadim Pasternak <vadimpmellanox.com>
37Description: These files show with which CPLD versions have been burned37Description: These files show with which CPLD versions have been burned
38 on LED board.38 on LED or Gearbox board.
39 39
40 The files are read only.40 The files are read only.
41 41
@@ -121,6 +121,15 @@ Description: These files show the system reset cause, as following: ComEx · 79 unmodified lines
121 121
122 The files are read only.122 The files are read only.
123 123
124What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld4_version
125Date: November 2018
126KernelVersion: 5.0
127Contact: Vadim Pasternak <vadimpmellanox.com>
128Description: These files show with which CPLD versions have been burned
129 on LED board.
130
131 The files are read only.
132
124Date: June 2019133Date: June 2019
125KernelVersion: 5.3134KernelVersion: 5.3
126Contact: Vadim Pasternak <vadimpmellanox.com>135Contact: Vadim Pasternak <vadimpmellanox.com>
Documentation/admin-guide/devices.txt+1−1
@@ -319,7 +319,7 @@ · 318 unmodified lines
319 182 = /dev/perfctr Performance-monitoring counters319 182 = /dev/perfctr Performance-monitoring counters
320 183 = /dev/hwrng Generic random number generator320 183 = /dev/hwrng Generic random number generator
321 184 = /dev/cpu/microcode CPU microcode update interface321 184 = /dev/cpu/microcode CPU microcode update interface
322 186 = /dev/atomicps Atomic shapshot of process state data322 186 = /dev/atomicps Atomic snapshot of process state data
323 187 = /dev/irnet IrNET device323 187 = /dev/irnet IrNET device
324 188 = /dev/smbusbios SMBus BIOS324 188 = /dev/smbusbios SMBus BIOS
325 189 = /dev/ussp_ctl User space serial port control325 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
95 95
96Besides the video4linux interface, the driver has a private interface96Besides the video4linux interface, the driver has a private interface
97for accessing the Motion Eye extended parameters (camera sharpness,97for accessing the Motion Eye extended parameters (camera sharpness,
98agc, video framerate), the shapshot and the MJPEG capture facilities.98agc, video framerate), the snapshot and the MJPEG capture facilities.
99 99
100This interface consists of several ioctls (prototypes and structures100This interface consists of several ioctls (prototypes and structures
101can be found in include/linux/meye.h):101can 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
255 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>255 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>
256 SUSE Jiri Kosina <jkosina@suse.cz>256 SUSE Jiri Kosina <jkosina@suse.cz>
257 257
258 Amazon258 Amazon Peter Bowen <pzb@amzn.com>
259 Google Kees Cook <keescook@chromium.org>259 Google Kees Cook <keescook@chromium.org>
260 ============= ========================================================260 ============= ========================================================
261 261
MAINTAINERS+10−10
@@ -720,7 +720,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-altera.txt · 719 unmodified lines
720F: drivers/i2c/busses/i2c-altera.c720F: drivers/i2c/busses/i2c-altera.c
721 721
722ALTERA MAILBOX DRIVER722ALTERA MAILBOX DRIVER
723M: Ley Foon Tan <lftan@altera.com>723M: Ley Foon Tan <ley.foon.tan@intel.com>
724L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)724L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
725S: Maintained725S: Maintained
726F: drivers/mailbox/mailbox-altera.c726F: 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
1407 1407
1408ARM/ACTIONS SEMI ARCHITECTURE1408ARM/ACTIONS SEMI ARCHITECTURE
1409M: Andreas Färber <afaerber@suse.de>1409M: Andreas Färber <afaerber@suse.de>
1410R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>1410M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1411L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1411L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1412S: Maintained1412S: Maintained
1413N: owl1413N: owl
@@ -3150,7 +3150,7 @@ S: Maintained · 1736 unmodified lines
3150F: arch/mips/net/3150F: arch/mips/net/
3151 3151
3152BPF JIT for NFP NICs3152BPF JIT for NFP NICs
3153M: Jakub Kicinski <jakub.kicinski@netronome.com>3153M: Jakub Kicinski <kuba@kernel.org>
3154L: netdev@vger.kernel.org3154L: netdev@vger.kernel.org
3155L: bpf@vger.kernel.org3155L: bpf@vger.kernel.org
3156S: Supported3156S: Supported
@@ -11431,7 +11431,7 @@ F: include/uapi/linux/netrom.h · 8274 unmodified lines
11431F: net/netrom/11431F: net/netrom/
11432 11432
11433NETRONOME ETHERNET DRIVERS11433NETRONOME ETHERNET DRIVERS
11434M: Jakub Kicinski <jakub.kicinski@netronome.com>11434M: Jakub Kicinski <kuba@kernel.org>
11435L: oss-drivers@netronome.com11435L: oss-drivers@netronome.com
11436S: Maintained11436S: Maintained
11437F: drivers/net/ethernet/netronome/11437F: drivers/net/ethernet/netronome/
@@ -11591,7 +11591,7 @@ M: Boris Pismenny <borisp@mellanox.com> · 153 unmodified lines
11591M: Aviad Yehezkel <aviadye@mellanox.com>11591M: Aviad Yehezkel <aviadye@mellanox.com>
11592M: John Fastabend <john.fastabend@gmail.com>11592M: John Fastabend <john.fastabend@gmail.com>
11593M: Daniel Borkmann <daniel@iogearbox.net>11593M: Daniel Borkmann <daniel@iogearbox.net>
11594M: Jakub Kicinski <jakub.kicinski@netronome.com>11594M: Jakub Kicinski <kuba@kernel.org>
11595L: netdev@vger.kernel.org11595L: netdev@vger.kernel.org
11596S: Maintained11596S: Maintained
11597F: net/tls/*11597F: net/tls/*
@@ -11603,7 +11603,7 @@ L: linux-wireless@vger.kernel.org · 5 unmodified lines
11603Q: http://patchwork.kernel.org/project/linux-wireless/list/11603Q: http://patchwork.kernel.org/project/linux-wireless/list/
11604 11604
11605NETDEVSIM11605NETDEVSIM
11606M: Jakub Kicinski <jakub.kicinski@netronome.com>11606M: Jakub Kicinski <kuba@kernel.org>
11607S: Maintained11607S: Maintained
11608F: drivers/net/netdevsim/*11608F: drivers/net/netdevsim/*
11609 11609
@@ -11680,7 +11680,7 @@ F: Documentation/scsi/NinjaSCSI.txt · 70 unmodified lines
11680F: drivers/scsi/nsp32*11680F: drivers/scsi/nsp32*
11681 11681
11682NIOS2 ARCHITECTURE11682NIOS2 ARCHITECTURE
11683M: Ley Foon Tan <lftan@altera.com>11683M: Ley Foon Tan <ley.foon.tan@intel.com>
11684L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)11684L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
11685T: git git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git11685T: git git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git
11686S: Maintained11686S: Maintained
@@ -12564,7 +12564,7 @@ F: Documentation/devicetree/bindings/pci/aardvark-pci.txt · 877 unmodified lines
12564F: drivers/pci/controller/pci-aardvark.c12564F: drivers/pci/controller/pci-aardvark.c
12565 12565
12566PCI DRIVER FOR ALTERA PCIE IP12566PCI DRIVER FOR ALTERA PCIE IP
12567M: Ley Foon Tan <lftan@altera.com>12567M: Ley Foon Tan <ley.foon.tan@intel.com>
12568L: rfi@lists.rocketboards.org (moderated for non-subscribers)12568L: rfi@lists.rocketboards.org (moderated for non-subscribers)
12569L: linux-pci@vger.kernel.org12569L: linux-pci@vger.kernel.org
12570S: Supported12570S: Supported
@@ -12743,7 +12743,7 @@ S: Supported · 172 unmodified lines
12743F: Documentation/PCI/pci-error-recovery.rst12743F: Documentation/PCI/pci-error-recovery.rst
12744 12744
12745PCI MSI DRIVER FOR ALTERA MSI IP12745PCI MSI DRIVER FOR ALTERA MSI IP
12746M: Ley Foon Tan <lftan@altera.com>12746M: Ley Foon Tan <ley.foon.tan@intel.com>
12747L: rfi@lists.rocketboards.org (moderated for non-subscribers)12747L: rfi@lists.rocketboards.org (moderated for non-subscribers)
12748L: linux-pci@vger.kernel.org12748L: linux-pci@vger.kernel.org
12749S: Supported12749S: Supported
@@ -18043,7 +18043,7 @@ XDP (eXpress Data Path) · 5293 unmodified lines
18043M: Alexei Starovoitov <ast@kernel.org>18043M: Alexei Starovoitov <ast@kernel.org>
18044M: Daniel Borkmann <daniel@iogearbox.net>18044M: Daniel Borkmann <daniel@iogearbox.net>
18045M: David S. Miller <davem@davemloft.net>18045M: David S. Miller <davem@davemloft.net>
18046M: Jakub Kicinski <jakub.kicinski@netronome.com>18046M: Jakub Kicinski <kuba@kernel.org>
18047M: Jesper Dangaard Brouer <hawk@kernel.org>18047M: Jesper Dangaard Brouer <hawk@kernel.org>
18048M: John Fastabend <john.fastabend@gmail.com>18048M: John Fastabend <john.fastabend@gmail.com>
18049L: netdev@vger.kernel.org18049L: netdev@vger.kernel.org
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2VERSION = 52VERSION = 5
3PATCHLEVEL = 53PATCHLEVEL = 5
4SUBLEVEL = 04SUBLEVEL = 0
5EXTRAVERSION = -rc65EXTRAVERSION = -rc7
6NAME = Kleptomaniac Octopus6NAME = Kleptomaniac Octopus
7 7
8# *DOCUMENTATION*8# *DOCUMENTATION*
arch/arm/boot/dts/am571x-idk.dts+1−5
@@ -167,11 +167,7 @@ · 166 unmodified lines
167 167
168&pcie1_rc {168&pcie1_rc {
169 status = "okay";169 status = "okay";
170 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;170 gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
171};
172
173&pcie1_ep {
174 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
175};171};
176 172
177&mmc1 {173&mmc1 {
arch/arm/boot/dts/am572x-idk-common.dtsi+0−4
@@ -147,10 +147,6 @@ · 146 unmodified lines
147 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;147 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
148};148};
149 149
150&pcie1_ep {
151 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
152};
153
154&mailbox5 {150&mailbox5 {
155 status = "okay";151 status = "okay";
156 mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {152 mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi+21−4
@@ -29,6 +29,27 @@ · 28 unmodified lines
29 reg = <0x0 0x80000000 0x0 0x80000000>;29 reg = <0x0 0x80000000 0x0 0x80000000>;
30 };30 };
31 31
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
32 vdd_3v3: fixedregulator-vdd_3v3 {53 vdd_3v3: fixedregulator-vdd_3v3 {
33 compatible = "regulator-fixed";54 compatible = "regulator-fixed";
34 regulator-name = "vdd_3v3";55 regulator-name = "vdd_3v3";
@@ -547,10 +568,6 @@ · 512 unmodified lines
547 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;568 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
548};569};
549 570
550&pcie1_ep {
551 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
552};
553
554&mcasp3 {571&mcasp3 {
555 #sound-dai-cells = <0>;572 #sound-dai-cells = <0>;
556 assigned-clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>;573 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
258 };258 };
259 };259 };
260 260
261 pca0: pca9552@60 {261 pca0: pca9552@61 {
262 compatible = "nxp,pca9552";262 compatible = "nxp,pca9552";
263 reg = <0x60>;263 reg = <0x61>;
264 #address-cells = <1>;264 #address-cells = <1>;
265 #size-cells = <0>;265 #size-cells = <0>;
266 266
@@ -519,371 +519,6 @@ · 252 unmodified lines
519 status = "okay";519 status = "okay";
520};520};
521 521
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
887&i2c13 {522&i2c13 {
888 status = "okay";523 status = "okay";
889 524
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts+5−398
@@ -122,37 +122,6 @@ · 121 unmodified lines
122 };122 };
123};123};
124 124
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
156&mac2 {125&mac2 {
157 status = "okay";126 status = "okay";
158 pinctrl-names = "default";127 pinctrl-names = "default";
@@ -165,6 +134,11 @@ · 6 unmodified lines
165 134
166&emmc {135&emmc {
167 status = "okay";136 status = "okay";
137};
138
139&fsim0 {
140 status = "okay";
141
168 #address-cells = <2>;142 #address-cells = <2>;
169 #size-cells = <0>;143 #size-cells = <0>;
170 144
@@ -820,373 +794,6 @@ · 649 unmodified lines
820 status = "okay";794 status = "okay";
821};795};
822 796
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
1190&pinctrl {797&pinctrl {
1191 /* Hog these as no driver is probed for the entire LPC block */798 /* Hog these as no driver is probed for the entire LPC block */
1192 pinctrl-names = "default";799 pinctrl-names = "default";
arch/arm/boot/dts/aspeed-g6.dtsi+19−20
@@ -163,26 +163,6 @@ · 162 unmodified lines
163 spi-max-frequency = <50000000>;163 spi-max-frequency = <50000000>;
164 status = "disabled";164 status = "disabled";
165 };165 };
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 };
186 };166 };
187 167
188 mdio0: mdio@1e650000 {168 mdio0: mdio@1e650000 {
@@ -595,6 +575,25 @@ · 406 unmodified lines
595 ranges = <0 0x1e78a000 0x1000>;575 ranges = <0 0x1e78a000 0x1000>;
596 };576 };
597 577
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 };
598 };597 };
599 };598 };
600};599};
arch/arm/boot/dts/imx6dl-icore-mipi.dts+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
8/dts-v1/;8/dts-v1/;
9 9
10#include "imx6dl.dtsi"10#include "imx6dl.dtsi"
11#include "imx6qdl-icore.dtsi"11#include "imx6qdl-icore-1.5.dtsi"
12 12
13/ {13/ {
14 model = "Engicam i.CoreM6 DualLite/Solo MIPI Starter Kit";14 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
63 #sound-dai-cells = <0>;63 #sound-dai-cells = <0>;
64 clocks = <&clk_ext_audio_codec>;64 clocks = <&clk_ext_audio_codec>;
65 VDDA-supply = <&reg_3p3v>;65 VDDA-supply = <&reg_3p3v>;
66 VDDIO-supply = <&reg_3p3v>;66 VDDIO-supply = <&sw2_reg>;
67 };67 };
68};68};
69 69
arch/arm/boot/dts/imx6q-dhcom-som.dtsi+1−1
@@ -204,7 +204,7 @@ · 203 unmodified lines
204 };204 };
205 205
206 rtc@56 {206 rtc@56 {
207 compatible = "rv3029c2";207 compatible = "microcrystal,rv3029";
208 pinctrl-names = "default";208 pinctrl-names = "default";
209 pinctrl-0 = <&pinctrl_rtc_hw300>;209 pinctrl-0 = <&pinctrl_rtc_hw300>;
210 reg = <0x56>;210 reg = <0x56>;
arch/arm/boot/dts/imx6qdl-sabresd.dtsi+0−4
@@ -749,10 +749,6 @@ · 748 unmodified lines
749 vin-supply = <&vgen5_reg>;749 vin-supply = <&vgen5_reg>;
750};750};
751 751
752&reg_vdd3p0 {
753 vin-supply = <&sw2_reg>;
754};
755
756&reg_vdd2p5 {752&reg_vdd2p5 {
757 vin-supply = <&vgen5_reg>;753 vin-supply = <&vgen5_reg>;
758};754};
arch/arm/boot/dts/imx6sl-evk.dts+0−4
@@ -584,10 +584,6 @@ · 583 unmodified lines
584 vin-supply = <&sw2_reg>;584 vin-supply = <&sw2_reg>;
585};585};
586 586
587&reg_vdd3p0 {
588 vin-supply = <&sw2_reg>;
589};
590
591&reg_vdd2p5 {587&reg_vdd2p5 {
592 vin-supply = <&sw2_reg>;588 vin-supply = <&sw2_reg>;
593};589};
arch/arm/boot/dts/imx6sll-evk.dts+0−4
@@ -265,10 +265,6 @@ · 264 unmodified lines
265 status = "okay";265 status = "okay";
266};266};
267 267
268&reg_3p0 {
269 vin-supply = <&sw2_reg>;
270};
271
272&snvs_poweroff {268&snvs_poweroff {
273 status = "okay";269 status = "okay";
274};270};
arch/arm/boot/dts/imx6sx-sdb-reva.dts+0−4
@@ -159,10 +159,6 @@ · 158 unmodified lines
159 vin-supply = <&vgen6_reg>;159 vin-supply = <&vgen6_reg>;
160};160};
161 161
162&reg_vdd3p0 {
163 vin-supply = <&sw2_reg>;
164};
165
166&reg_vdd2p5 {162&reg_vdd2p5 {
167 vin-supply = <&vgen6_reg>;163 vin-supply = <&vgen6_reg>;
168};164};
arch/arm/boot/dts/imx6sx-sdb.dts+0−4
@@ -141,10 +141,6 @@ · 140 unmodified lines
141 vin-supply = <&vgen6_reg>;141 vin-supply = <&vgen6_reg>;
142};142};
143 143
144&reg_vdd3p0 {
145 vin-supply = <&sw2_reg>;
146};
147
148&reg_vdd2p5 {144&reg_vdd2p5 {
149 vin-supply = <&vgen6_reg>;145 vin-supply = <&vgen6_reg>;
150};146};
arch/arm/boot/dts/imx7s-colibri.dtsi+4−0
@@ -49,3 +49,7 @@ · 48 unmodified lines
49 reg = <0x80000000 0x10000000>;49 reg = <0x80000000 0x10000000>;
50 };50 };
51};51};
52
53&gpmi {
54 status = "okay";
55};
arch/arm/boot/dts/imx7ulp.dtsi+2−2
@@ -37,10 +37,10 @@ · 36 unmodified lines
37 #address-cells = <1>;37 #address-cells = <1>;
38 #size-cells = <0>;38 #size-cells = <0>;
39 39
40 cpu0: cpu@0 {40 cpu0: cpu@f00 {
41 compatible = "arm,cortex-a7";41 compatible = "arm,cortex-a7";
42 device_type = "cpu";42 device_type = "cpu";
43 reg = <0>;43 reg = <0xf00>;
44 };44 };
45 };45 };
46 46
arch/arm/boot/dts/meson8.dtsi+1−1
@@ -253,7 +253,7 @@ · 252 unmodified lines
253&aobus {253&aobus {
254 pmu: pmu@e0 {254 pmu: pmu@e0 {
255 compatible = "amlogic,meson8-pmu", "syscon";255 compatible = "amlogic,meson8-pmu", "syscon";
256 reg = <0xe0 0x8>;256 reg = <0xe0 0x18>;
257 };257 };
258 258
259 pinctrl_aobus: pinctrl@84 {259 pinctrl_aobus: pinctrl@84 {
arch/arm/boot/dts/mmp3.dtsi+6−6
@@ -356,7 +356,7 @@ · 355 unmodified lines
356 356
357 twsi1: i2c@d4011000 {357 twsi1: i2c@d4011000 {
358 compatible = "mrvl,mmp-twsi";358 compatible = "mrvl,mmp-twsi";
359 reg = <0xd4011000 0x1000>;359 reg = <0xd4011000 0x70>;
360 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;360 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
361 clocks = <&soc_clocks MMP2_CLK_TWSI0>;361 clocks = <&soc_clocks MMP2_CLK_TWSI0>;
362 resets = <&soc_clocks MMP2_CLK_TWSI0>;362 resets = <&soc_clocks MMP2_CLK_TWSI0>;
@@ -368,7 +368,7 @@ · 5 unmodified lines
368 368
369 twsi2: i2c@d4031000 {369 twsi2: i2c@d4031000 {
370 compatible = "mrvl,mmp-twsi";370 compatible = "mrvl,mmp-twsi";
371 reg = <0xd4031000 0x1000>;371 reg = <0xd4031000 0x70>;
372 interrupt-parent = <&twsi_mux>;372 interrupt-parent = <&twsi_mux>;
373 interrupts = <0>;373 interrupts = <0>;
374 clocks = <&soc_clocks MMP2_CLK_TWSI1>;374 clocks = <&soc_clocks MMP2_CLK_TWSI1>;
@@ -380,7 +380,7 @@ · 5 unmodified lines
380 380
381 twsi3: i2c@d4032000 {381 twsi3: i2c@d4032000 {
382 compatible = "mrvl,mmp-twsi";382 compatible = "mrvl,mmp-twsi";
383 reg = <0xd4032000 0x1000>;383 reg = <0xd4032000 0x70>;
384 interrupt-parent = <&twsi_mux>;384 interrupt-parent = <&twsi_mux>;
385 interrupts = <1>;385 interrupts = <1>;
386 clocks = <&soc_clocks MMP2_CLK_TWSI2>;386 clocks = <&soc_clocks MMP2_CLK_TWSI2>;
@@ -392,7 +392,7 @@ · 5 unmodified lines
392 392
393 twsi4: i2c@d4033000 {393 twsi4: i2c@d4033000 {
394 compatible = "mrvl,mmp-twsi";394 compatible = "mrvl,mmp-twsi";
395 reg = <0xd4033000 0x1000>;395 reg = <0xd4033000 0x70>;
396 interrupt-parent = <&twsi_mux>;396 interrupt-parent = <&twsi_mux>;
397 interrupts = <2>;397 interrupts = <2>;
398 clocks = <&soc_clocks MMP2_CLK_TWSI3>;398 clocks = <&soc_clocks MMP2_CLK_TWSI3>;
@@ -405,7 +405,7 @@ · 6 unmodified lines
405 405
406 twsi5: i2c@d4033800 {406 twsi5: i2c@d4033800 {
407 compatible = "mrvl,mmp-twsi";407 compatible = "mrvl,mmp-twsi";
408 reg = <0xd4033800 0x1000>;408 reg = <0xd4033800 0x70>;
409 interrupt-parent = <&twsi_mux>;409 interrupt-parent = <&twsi_mux>;
410 interrupts = <3>;410 interrupts = <3>;
411 clocks = <&soc_clocks MMP2_CLK_TWSI4>;411 clocks = <&soc_clocks MMP2_CLK_TWSI4>;
@@ -417,7 +417,7 @@ · 5 unmodified lines
417 417
418 twsi6: i2c@d4034000 {418 twsi6: i2c@d4034000 {
419 compatible = "mrvl,mmp-twsi";419 compatible = "mrvl,mmp-twsi";
420 reg = <0xd4034000 0x1000>;420 reg = <0xd4034000 0x70>;
421 interrupt-parent = <&twsi_mux>;421 interrupt-parent = <&twsi_mux>;
422 interrupts = <4>;422 interrupts = <4>;
423 clocks = <&soc_clocks MMP2_CLK_TWSI5>;423 clocks = <&soc_clocks MMP2_CLK_TWSI5>;
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101 initial-mode = <1>; /* initialize in HUB mode */101 initial-mode = <1>; /* initialize in HUB mode */
102 disabled-ports = <1>;102 disabled-ports = <1>;
103 intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */103 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 */
105 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */105 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
106 refclk-frequency = <19200000>;106 refclk-frequency = <19200000>;
107 };107 };
arch/arm/mach-davinci/Kconfig+1−0
@@ -9,6 +9,7 @@ menuconfig ARCH_DAVINCI · 8 unmodified lines
9 select PM_GENERIC_DOMAINS if PM9 select PM_GENERIC_DOMAINS if PM
10 select PM_GENERIC_DOMAINS_OF if PM && OF10 select PM_GENERIC_DOMAINS_OF if PM && OF
11 select REGMAP_MMIO11 select REGMAP_MMIO
12 select RESET_CONTROLLER
12 select HAVE_IDE13 select HAVE_IDE
13 select PINCTRL_SINGLE14 select PINCTRL_SINGLE
14 15
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
207 ret = clk_prepare_enable(clk);207 ret = clk_prepare_enable(clk);
208 if (ret)208 if (ret)
209 return ret;209 return ret;
210 rate = clk_get_rate(clk) / 2;210 rate = clk_get_rate(clk);
211 } else if (cpu_is_pj4()) {211 } else if (cpu_is_pj4()) {
212 rate = 6500000;212 rate = 6500000;
213 } else {213 } else {
arch/arm/mach-omap2/Kconfig+2−1
@@ -95,6 +95,7 @@ config ARCH_OMAP2PLUS · 94 unmodified lines
95 bool95 bool
96 select ARCH_HAS_BANDGAP96 select ARCH_HAS_BANDGAP
97 select ARCH_HAS_HOLES_MEMORYMODEL97 select ARCH_HAS_HOLES_MEMORYMODEL
98 select ARCH_HAS_RESET_CONTROLLER
98 select ARCH_OMAP99 select ARCH_OMAP
99 select CLKSRC_MMIO100 select CLKSRC_MMIO
100 select GENERIC_IRQ_CHIP101 select GENERIC_IRQ_CHIP
@@ -105,11 +106,11 @@ config ARCH_OMAP2PLUS · 4 unmodified lines
105 select OMAP_DM_TIMER106 select OMAP_DM_TIMER
106 select OMAP_GPMC107 select OMAP_GPMC
107 select PINCTRL108 select PINCTRL
109 select RESET_CONTROLLER
108 select SOC_BUS110 select SOC_BUS
109 select TI_SYSC111 select TI_SYSC
110 select OMAP_IRQCHIP112 select OMAP_IRQCHIP
111 select CLKSRC_TI_32K113 select CLKSRC_TI_32K
112 select ARCH_HAS_RESET_CONTROLLER
113 help114 help
114 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5115 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
115 116
arch/arm/mach-omap2/pdata-quirks.c+5−1
@@ -306,10 +306,14 @@ static void __init dra7x_evm_mmc_quirk(void) · 305 unmodified lines
306 306
307static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)307static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)
308{308{
309 struct clk_hw *hw = __clk_get_hw(clk);
309 struct clockdomain *clkdm = NULL;310 struct clockdomain *clkdm = NULL;
310 struct clk_hw_omap *hwclk;311 struct clk_hw_omap *hwclk;
311 312
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
313 if (hwclk && hwclk->clkdm_name)317 if (hwclk && hwclk->clkdm_name)
314 clkdm = clkdm_lookup(hwclk->clkdm_name);318 clkdm = clkdm_lookup(hwclk->clkdm_name);
315 319
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
15 pinctrl-names = "default";15 pinctrl-names = "default";
16 pinctrl-0 = <&mmc2_pins>;16 pinctrl-0 = <&mmc2_pins>;
17 vmmc-supply = <&reg_dcdc1>;17 vmmc-supply = <&reg_dcdc1>;
18 vqmmc-supply = <&reg_dcdc1>;18 vqmmc-supply = <&reg_eldo1>;
19 bus-width = <8>;19 bus-width = <8>;
20 non-removable;20 non-removable;
21 cap-mmc-hw-reset;21 cap-mmc-hw-reset;
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts+1−1
@@ -140,7 +140,7 @@ · 139 unmodified lines
140&mmc1 {140&mmc1 {
141 pinctrl-names = "default";141 pinctrl-names = "default";
142 pinctrl-0 = <&mmc1_pins>;142 pinctrl-0 = <&mmc1_pins>;
143 vmmc-supply = <&reg_aldo2>;143 vmmc-supply = <&reg_dcdc1>;
144 vqmmc-supply = <&reg_dldo4>;144 vqmmc-supply = <&reg_dldo4>;
145 mmc-pwrseq = <&wifi_pwrseq>;145 mmc-pwrseq = <&wifi_pwrseq>;
146 bus-width = <4>;146 bus-width = <4>;
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+4−4
@@ -61,10 +61,10 @@ · 60 unmodified lines
61 61
62 pmu {62 pmu {
63 compatible = "arm,armv8-pmuv3";63 compatible = "arm,armv8-pmuv3";
64 interrupts = <0 120 8>,64 interrupts = <0 170 4>,
65 <0 121 8>,65 <0 171 4>,
66 <0 122 8>,66 <0 172 4>,
67 <0 123 8>;67 <0 173 4>;
68 interrupt-affinity = <&cpu0>,68 interrupt-affinity = <&cpu0>,
69 <&cpu1>,69 <&cpu1>,
70 <&cpu2>,70 <&cpu2>,
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts+26−2
@@ -46,25 +46,47 @@ · 45 unmodified lines
46 };46 };
47 47
48 gpio-keys {48 gpio-keys {
49 compatible = "gpio-keys-polled";49 compatible = "gpio-keys";
50 poll-interval = <100>;
51 50
52 key1 {51 key1 {
53 label = "A";52 label = "A";
54 linux,code = <BTN_0>;53 linux,code = <BTN_0>;
55 gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;54 gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
55 interrupt-parent = <&gpio_intc>;
56 interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
56 };57 };
57 58
58 key2 {59 key2 {
59 label = "B";60 label = "B";
60 linux,code = <BTN_1>;61 linux,code = <BTN_1>;
61 gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;62 gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
63 interrupt-parent = <&gpio_intc>;
64 interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
62 };65 };
63 66
64 key3 {67 key3 {
65 label = "C";68 label = "C";
66 linux,code = <BTN_2>;69 linux,code = <BTN_2>;
67 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;70 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>;
68 };90 };
69 };91 };
70 92
@@ -569,6 +591,8 @@ · 498 unmodified lines
569 591
570 bluetooth {592 bluetooth {
571 compatible = "brcm,bcm43438-bt";593 compatible = "brcm,bcm43438-bt";
594 interrupt-parent = <&gpio_intc>;
595 interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
572 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;596 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
573 max-speed = <2000000>;597 max-speed = <2000000>;
574 clocks = <&wifi32k>;598 clocks = <&wifi32k>;
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi+1−1
@@ -175,7 +175,7 @@ · 174 unmodified lines
175 dcfg: syscon@1e00000 {175 dcfg: syscon@1e00000 {
176 compatible = "fsl,ls1028a-dcfg", "syscon";176 compatible = "fsl,ls1028a-dcfg", "syscon";
177 reg = <0x0 0x1e00000 0x0 0x10000>;177 reg = <0x0 0x1e00000 0x0 0x10000>;
178 big-endian;178 little-endian;
179 };179 };
180 180
181 rst: syscon@1e60000 {181 rst: syscon@1e60000 {
arch/arm64/boot/dts/freescale/imx8mm.dtsi+1−1
@@ -740,7 +740,7 @@ · 739 unmodified lines
740 reg = <0x30bd0000 0x10000>;740 reg = <0x30bd0000 0x10000>;
741 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;741 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
742 clocks = <&clk IMX8MM_CLK_SDMA1_ROOT>,742 clocks = <&clk IMX8MM_CLK_SDMA1_ROOT>,
743 <&clk IMX8MM_CLK_SDMA1_ROOT>;743 <&clk IMX8MM_CLK_AHB>;
744 clock-names = "ipg", "ahb";744 clock-names = "ipg", "ahb";
745 #dma-cells = <3>;745 #dma-cells = <3>;
746 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";746 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
421 pinctrl-names = "default";421 pinctrl-names = "default";
422 pinctrl-0 = <&pinctrl_imu>;422 pinctrl-0 = <&pinctrl_imu>;
423 interrupt-parent = <&gpio3>;423 interrupt-parent = <&gpio3>;
424 interrupts = <19 IRQ_TYPE_LEVEL_LOW>;424 interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
425 vdd-supply = <&reg_3v3_p>;425 vdd-supply = <&reg_3v3_p>;
426 vddio-supply = <&reg_3v3_p>;426 vddio-supply = <&reg_3v3_p>;
427 };427 };
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi+4−4
@@ -60,10 +60,10 @@ · 59 unmodified lines
60 60
61 pmu {61 pmu {
62 compatible = "arm,armv8-pmuv3";62 compatible = "arm,armv8-pmuv3";
63 interrupts = <0 120 8>,63 interrupts = <0 170 4>,
64 <0 121 8>,64 <0 171 4>,
65 <0 122 8>,65 <0 172 4>,
66 <0 123 8>;66 <0 173 4>;
67 interrupt-affinity = <&cpu0>,67 interrupt-affinity = <&cpu0>,
68 <&cpu1>,68 <&cpu1>,
69 <&cpu2>,69 <&cpu2>,
arch/arm64/boot/dts/rockchip/rk3328-a1.dts+2−1
@@ -49,7 +49,8 @@ · 48 unmodified lines
49 49
50 ir-receiver {50 ir-receiver {
51 compatible = "gpio-ir-receiver";51 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";
53 };54 };
54};55};
55 56
arch/nds32/include/asm/cacheflush.h+7−4
@@ -9,7 +9,11 @@ · 8 unmodified lines
9#define PG_dcache_dirty PG_arch_19#define PG_dcache_dirty PG_arch_1
10 10
11void flush_icache_range(unsigned long start, unsigned long end);11void flush_icache_range(unsigned long start, unsigned long end);
12#define flush_icache_range flush_icache_range
13
12void flush_icache_page(struct vm_area_struct *vma, struct page *page);14void flush_icache_page(struct vm_area_struct *vma, struct page *page);
15#define flush_icache_page flush_icache_page
16
13#ifdef CONFIG_CPU_CACHE_ALIASING17#ifdef CONFIG_CPU_CACHE_ALIASING
14void flush_cache_mm(struct mm_struct *mm);18void flush_cache_mm(struct mm_struct *mm);
15void flush_cache_dup_mm(struct mm_struct *mm);19void flush_cache_dup_mm(struct mm_struct *mm);
@@ -40,12 +44,11 @@ void invalidate_kernel_vmap_range(void *addr, int size); · 24 unmodified lines
40#define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)44#define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
41 45
42#else46#else
43#include <asm-generic/cacheflush.h>
44#undef flush_icache_range
45#undef flush_icache_page
46#undef flush_icache_user_range
47void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,47void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
48 unsigned long addr, int len);48 unsigned long addr, int len);
49#define flush_icache_user_range flush_icache_user_range
50
51#include <asm-generic/cacheflush.h>
49#endif52#endif
50 53
51#endif /* __NDS32_CACHEFLUSH_H__ */54#endif /* __NDS32_CACHEFLUSH_H__ */
arch/nds32/include/asm/pgtable.h+1−1
@@ -195,7 +195,7 @@ extern void paging_init(void); · 194 unmodified lines
195#define pte_unmap(pte) do { } while (0)195#define pte_unmap(pte) do { } while (0)
196#define pte_unmap_nested(pte) do { } while (0)196#define pte_unmap_nested(pte) do { } while (0)
197 197
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))
199 199
200#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)200#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
201/*201/*
arch/parisc/kernel/drivers.c+2−2
@@ -889,8 +889,8 @@ static void print_parisc_device(struct parisc_device *dev) · 888 unmodified lines
889 static int count;889 static int count;
890 890
891 print_pa_hwpath(dev, hw_path);891 print_pa_hwpath(dev, hw_path);
892 pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",892 pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
893 ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type,893 ++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
894 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);894 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
895 895
896 if (dev->num_addrs) {896 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
401 pmd = (pmd_t *) __pa(pmd);401 pmd = (pmd_t *) __pa(pmd);
402 }402 }
403 403
404 pgd_populate(NULL, pg_dir, __va(pmd));404 pud_populate(NULL, (pud_t *)pg_dir, __va(pmd));
405#endif405#endif
406 pg_dir++;406 pg_dir++;
407 407
arch/riscv/include/asm/asm-prototypes.h+4−0
@@ -5,4 +5,8 @@ · 4 unmodified lines
5#include <linux/ftrace.h>5#include <linux/ftrace.h>
6#include <asm-generic/asm-prototypes.h>6#include <asm-generic/asm-prototypes.h>
7 7
8long long __lshrti3(long long a, int b);
9long long __ashrti3(long long a, int b);
10long long __ashlti3(long long a, int b);
11
8#endif /* _ASM_RISCV_PROTOTYPES_H */12#endif /* _ASM_RISCV_PROTOTYPES_H */
arch/riscv/kernel/head.S+10−6
@@ -80,7 +80,9 @@ _start_kernel: · 79 unmodified lines
80 80
81#ifdef CONFIG_SMP81#ifdef CONFIG_SMP
82 li t0, CONFIG_NR_CPUS82 li t0, CONFIG_NR_CPUS
83 bgeu a0, t0, .Lsecondary_park83 blt a0, t0, .Lgood_cores
84 tail .Lsecondary_park
85.Lgood_cores:
84#endif86#endif
85 87
86 /* Pick one hart to run the main boot sequence */88 /* Pick one hart to run the main boot sequence */
@@ -209,11 +211,6 @@ relocate: · 122 unmodified lines
209 tail smp_callin211 tail smp_callin
210#endif212#endif
211 213
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
217END(_start)214END(_start)
218 215
219#ifdef CONFIG_RISCV_M_MODE216#ifdef CONFIG_RISCV_M_MODE
@@ -295,6 +292,13 @@ ENTRY(reset_regs) · 75 unmodified lines
295END(reset_regs)292END(reset_regs)
296#endif /* CONFIG_RISCV_M_MODE */293#endif /* CONFIG_RISCV_M_MODE */
297 294
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
298__PAGE_ALIGNED_BSS302__PAGE_ALIGNED_BSS
299 /* Empty zero page */303 /* Empty zero page */
300 .balign PAGE_SIZE304 .balign PAGE_SIZE
arch/riscv/kernel/vdso/Makefile+2−1
@@ -58,7 +58,8 @@ quiet_cmd_vdsold = VDSOLD $@ · 57 unmodified lines
58 cmd_vdsold = $(CC) $(KBUILD_CFLAGS) $(call cc-option, -no-pie) -nostdlib -nostartfiles $(SYSCFLAGS_$(@F)) \58 cmd_vdsold = $(CC) $(KBUILD_CFLAGS) $(call cc-option, -no-pie) -nostdlib -nostartfiles $(SYSCFLAGS_$(@F)) \
59 -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp && \59 -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp && \
60 $(CROSS_COMPILE)objcopy \60 $(CROSS_COMPILE)objcopy \
61 $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@61 $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \
62 rm $@.tmp
62 63
63# install commands for the unstripped file64# install commands for the unstripped file
64quiet_cmd_vdso_install = INSTALL $@65quiet_cmd_vdso_install = INSTALL $@
arch/riscv/lib/tishift.S+57−18
@@ -4,34 +4,73 @@ · 3 unmodified lines
4 */4 */
5 5
6#include <linux/linkage.h>6#include <linux/linkage.h>
7#include <asm-generic/export.h>
7 8
8ENTRY(__lshrti3)9SYM_FUNC_START(__lshrti3)
9 beqz a2, .L110 beqz a2, .L1
10 li a5,6411 li a5,64
11 sub a5,a5,a212 sub a5,a5,a2
12 addi sp,sp,-16
13 sext.w a4,a513 sext.w a4,a5
14 blez a5, .L214 blez a5, .L2
15 sext.w a2,a215 sext.w a2,a2
16 sll a4,a1,a4
17 srl a0,a0,a216 srl a0,a0,a2
18 srl a1,a1,a217 sll a4,a1,a4
18 srl a2,a1,a2
19 or a0,a0,a419 or a0,a0,a4
20 sd a1,8(sp)20 mv a1,a2
21 sd a0,0(sp)
22 ld a0,0(sp)
23 ld a1,8(sp)
24 addi sp,sp,16
25 ret
26.L1:21.L1:
27 ret22 ret
28.L2:23.L2:
29 negw a4,a424 negw a0,a4
30 srl a1,a1,a425 li a2,0
31 sd a1,0(sp)26 srl a0,a1,a0
32 sd zero,8(sp)27 mv a1,a2
33 ld a0,0(sp)28 ret
34 ld a1,8(sp)29SYM_FUNC_END(__lshrti3)
35 addi sp,sp,1630EXPORT_SYMBOL(__lshrti3)
31
32SYM_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
52SYM_FUNC_END(__ashrti3)
53EXPORT_SYMBOL(__ashrti3)
54
55SYM_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
36 ret74 ret
37ENDPROC(__lshrti3)75SYM_FUNC_END(__ashlti3)
76EXPORT_SYMBOL(__ashlti3)
arch/s390/kernel/setup.c+1−1
@@ -1052,7 +1052,7 @@ static void __init log_component_list(void) · 1051 unmodified lines
1052 1052
1053 if (!early_ipl_comp_list_addr)1053 if (!early_ipl_comp_list_addr)
1054 return;1054 return;
1055 if (ipl_block.hdr.flags & IPL_PL_FLAG_IPLSR)1055 if (ipl_block.hdr.flags & IPL_PL_FLAG_SIPL)
1056 pr_info("Linux is running with Secure-IPL enabled\n");1056 pr_info("Linux is running with Secure-IPL enabled\n");
1057 else1057 else
1058 pr_info("Linux is running with Secure-IPL disabled\n");1058 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
244 leal efi32_config(%ebp), %eax244 leal efi32_config(%ebp), %eax
245 movl %eax, efi_config(%ebp)245 movl %eax, efi_config(%ebp)
246 246
247 /* Disable paging */
248 movl %cr0, %eax
249 btrl $X86_CR0_PG_BIT, %eax
250 movl %eax, %cr0
251
247 jmp startup_32252 jmp startup_32
248SYM_FUNC_END(efi32_stub_entry)253SYM_FUNC_END(efi32_stub_entry)
249#endif254#endif
arch/x86/events/intel/uncore_snb.c+6−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
15#define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x191015#define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910
16#define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f16#define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f
17#define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f17#define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f
18#define PCI_DEVICE_ID_INTEL_SKL_E3_IMC 0x1918
18#define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c19#define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c
19#define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x590420#define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904
20#define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC 0x591421#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
657 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),658 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),
658 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),659 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
659 },660 },
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 },
660 { /* IMC */665 { /* IMC */
661 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC),666 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC),
662 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),667 .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
826 IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */831 IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */
827 IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */832 IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */
828 IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */833 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 */
829 IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */835 IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */
830 IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */836 IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */
831 IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */837 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
369#define SNR_M2M_PCI_PMON_BOX_CTL 0x438369#define SNR_M2M_PCI_PMON_BOX_CTL 0x438
370#define SNR_M2M_PCI_PMON_UMASK_EXT 0xff370#define SNR_M2M_PCI_PMON_UMASK_EXT 0xff
371 371
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
377/* SNR IMC */372/* SNR IMC */
378#define SNR_IMC_MMIO_PMON_FIXED_CTL 0x54373#define SNR_IMC_MMIO_PMON_FIXED_CTL 0x54
379#define SNR_IMC_MMIO_PMON_FIXED_CTR 0x38374#define SNR_IMC_MMIO_PMON_FIXED_CTR 0x38
@@ -4328,27 +4323,12 @@ static struct intel_uncore_type snr_uncore_m2m = { · 3948 unmodified lines
4328 .format_group = &snr_m2m_uncore_format_group,4323 .format_group = &snr_m2m_uncore_format_group,
4329};4324};
4330 4325
4331static 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
4344enum {4326enum {
4345 SNR_PCI_UNCORE_M2M,4327 SNR_PCI_UNCORE_M2M,
4346 SNR_PCI_UNCORE_PCIE3,
4347};4328};
4348 4329
4349static struct intel_uncore_type *snr_pci_uncores[] = {4330static struct intel_uncore_type *snr_pci_uncores[] = {
4350 [SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m,4331 [SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m,
4351 [SNR_PCI_UNCORE_PCIE3] = &snr_uncore_pcie3,
4352 NULL,4332 NULL,
4353};4333};
4354 4334
@@ -4357,10 +4337,6 @@ static const struct pci_device_id snr_uncore_pci_ids[] = { · 2 unmodified lines
4357 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a),4337 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a),
4358 .driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0),4338 .driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0),
4359 },4339 },
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 },
4364 { /* end: all zeroes */ }4340 { /* end: all zeroes */ }
4365};4341};
4366 4342
@@ -4536,6 +4512,7 @@ static struct uncore_event_desc snr_uncore_imc_freerunning_events[] = { · 169 unmodified lines
4536 INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"),4512 INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"),
4537 INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"),4513 INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"),
4538 INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"),4514 INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"),
4515 { /* end: all zeroes */ },
4539};4516};
4540 4517
4541static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = {4518static 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
615 return;615 return;
616 616
617clear_all:617clear_all:
618 clear_cpu_cap(c, X86_FEATURE_SME);618 setup_clear_cpu_cap(X86_FEATURE_SME);
619clear_sev:619clear_sev:
620 clear_cpu_cap(c, X86_FEATURE_SEV);620 setup_clear_cpu_cap(X86_FEATURE_SEV);
621 }621 }
622}622}
623 623
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
467{467{
468 struct thermal_state *state = &per_cpu(thermal_state, cpu);468 struct thermal_state *state = &per_cpu(thermal_state, cpu);
469 struct device *dev = get_cpu_device(cpu);469 struct device *dev = get_cpu_device(cpu);
470 u32 l;
470 471
471 state->package_throttle.level = PACKAGE_LEVEL;472 state->package_throttle.level = PACKAGE_LEVEL;
472 state->core_throttle.level = CORE_LEVEL;473 state->core_throttle.level = CORE_LEVEL;
@@ -474,6 +475,10 @@ static int thermal_throttle_online(unsigned int cpu) · 1 unmodified line
474 INIT_DELAYED_WORK(&state->package_throttle.therm_work, throttle_active_work);475 INIT_DELAYED_WORK(&state->package_throttle.therm_work, throttle_active_work);
475 INIT_DELAYED_WORK(&state->core_throttle.therm_work, throttle_active_work);476 INIT_DELAYED_WORK(&state->core_throttle.therm_work, throttle_active_work);
476 477
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
477 return thermal_throttle_add_dev(dev, cpu);482 return thermal_throttle_add_dev(dev, cpu);
478}483}
479 484
@@ -722,10 +727,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c) · 242 unmodified lines
722 rdmsr(MSR_IA32_MISC_ENABLE, l, h);727 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
723 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);728 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
724 729
725 /* Unmask the thermal vector: */
726 l = apic_read(APIC_LVTTHMR);
727 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
728
729 pr_info_once("CPU0: Thermal monitoring enabled (%s)\n",730 pr_info_once("CPU0: Thermal monitoring enabled (%s)\n",
730 tm2 ? "TM2" : "TM1");731 tm2 ? "TM2" : "TM1");
731 732
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
618 if (static_branch_unlikely(&rdt_mon_enable_key))618 if (static_branch_unlikely(&rdt_mon_enable_key))
619 rmdir_mondata_subdir_allrdtgrp(r, d->id);619 rmdir_mondata_subdir_allrdtgrp(r, d->id);
620 list_del(&d->list);620 list_del(&d->list);
621 if (is_mbm_enabled())621 if (r->mon_capable && is_mbm_enabled())
622 cancel_delayed_work(&d->mbm_over);622 cancel_delayed_work(&d->mbm_over);
623 if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {623 if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
624 /*624 /*
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
1741 struct rdt_domain *d;1741 struct rdt_domain *d;
1742 int cpu;1742 int cpu;
1743 1743
1744 if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1745 return -ENOMEM;
1746
1747 if (level == RDT_RESOURCE_L3)1744 if (level == RDT_RESOURCE_L3)
1748 update = l3_qos_cfg_update;1745 update = l3_qos_cfg_update;
1749 else if (level == RDT_RESOURCE_L2)1746 else if (level == RDT_RESOURCE_L2)
@@ -1751,6 +1748,9 @@ static int set_cache_qos_cfg(int level, bool enable) · 1 unmodified line
1751 else1748 else
1752 return -EINVAL;1749 return -EINVAL;
1753 1750
1751 if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1752 return -ENOMEM;
1753
1754 r_l = &rdt_resources_all[level];1754 r_l = &rdt_resources_all[level];
1755 list_for_each_entry(d, &r_l->domains, list) {1755 list_for_each_entry(d, &r_l->domains, list) {
1756 /* Pick one CPU from each domain instance to update MSR */1756 /* 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
164 unsigned long mask = queue_segment_boundary(q);164 unsigned long mask = queue_segment_boundary(q);
165 165
166 offset = mask & (page_to_phys(start_page) + offset);166 offset = mask & (page_to_phys(start_page) + offset);
167 return min_t(unsigned long, mask - offset + 1,167
168 queue_max_segment_size(q));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));
169}174}
170 175
171/**176/**
block/blk-settings.c+1−1
@@ -328,7 +328,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); · 327 unmodified lines
328 * storage device can address. The default of 512 covers most328 * storage device can address. The default of 512 covers most
329 * hardware.329 * hardware.
330 **/330 **/
331void blk_queue_logical_block_size(struct request_queue *q, unsigned short size)331void blk_queue_logical_block_size(struct request_queue *q, unsigned int size)
332{332{
333 q->limits.logical_block_size = size;333 q->limits.logical_block_size = size;
334 334
drivers/base/firmware_loader/builtin/Makefile+1−1
@@ -17,7 +17,7 @@ PROGBITS = $(if $(CONFIG_ARM),%,@)progbits · 16 unmodified lines
17filechk_fwbin = \17filechk_fwbin = \
18 echo "/* Generated by $(src)/Makefile */" ;\18 echo "/* Generated by $(src)/Makefile */" ;\
19 echo " .section .rodata" ;\19 echo " .section .rodata" ;\
20 echo " .p2align $(ASM_ALIGN)" ;\20 echo " .p2align 4" ;\
21 echo "_fw_$(FWSTR)_bin:" ;\21 echo "_fw_$(FWSTR)_bin:" ;\
22 echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\22 echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\
23 echo "_fw_end:" ;\23 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
129 return BLK_STS_IOERR;129 return BLK_STS_IOERR;
130 case BLK_ZONE_COND_EMPTY:130 case BLK_ZONE_COND_EMPTY:
131 case BLK_ZONE_COND_IMP_OPEN:131 case BLK_ZONE_COND_IMP_OPEN:
132 case BLK_ZONE_COND_EXP_OPEN:
133 case BLK_ZONE_COND_CLOSED:
132 /* Writes must be at the write pointer position */134 /* Writes must be at the write pointer position */
133 if (sector != zone->wp)135 if (sector != zone->wp)
134 return BLK_STS_IOERR;136 return BLK_STS_IOERR;
135 137
136 if (zone->cond == BLK_ZONE_COND_EMPTY)138 if (zone->cond != BLK_ZONE_COND_EXP_OPEN)
137 zone->cond = BLK_ZONE_COND_IMP_OPEN;139 zone->cond = BLK_ZONE_COND_IMP_OPEN;
138 140
139 zone->wp += nr_sectors;141 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
343 return -EINVAL;343 return -EINVAL;
344 }344 }
345 345
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
346 ddata->clocks = devm_kcalloc(ddata->dev,352 ddata->clocks = devm_kcalloc(ddata->dev,
347 ddata->nr_clocks, sizeof(*ddata->clocks),353 ddata->nr_clocks, sizeof(*ddata->clocks),
348 GFP_KERNEL);354 GFP_KERNEL);
@@ -421,7 +427,7 @@ static int sysc_enable_opt_clocks(struct sysc *ddata) · 72 unmodified lines
421 struct clk *clock;427 struct clk *clock;
422 int i, error;428 int i, error;
423 429
424 if (!ddata->clocks)430 if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
425 return 0;431 return 0;
426 432
427 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {433 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
455 struct clk *clock;461 struct clk *clock;
456 int i;462 int i;
457 463
458 if (!ddata->clocks)464 if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
459 return;465 return;
460 466
461 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {467 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
3426 if (core->flags & CLK_IS_CRITICAL) {3426 if (core->flags & CLK_IS_CRITICAL) {
3427 unsigned long flags;3427 unsigned long flags;
3428 3428
3429 clk_core_prepare(core);3429 ret = clk_core_prepare(core);
3430 if (ret)
3431 goto out;
3430 3432
3431 flags = clk_enable_lock();3433 flags = clk_enable_lock();
3432 clk_core_enable(core);3434 ret = clk_core_enable(core);
3433 clk_enable_unlock(flags);3435 clk_enable_unlock(flags);
3436 if (ret) {
3437 clk_core_unprepare(core);
3438 goto out;
3439 }
3434 }3440 }
3435 3441
3436 clk_core_reparent_orphans_nolock();3442 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
134static const char *ssp_parent_names[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"};134static const char *ssp_parent_names[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"};
135 135
136static DEFINE_SPINLOCK(timer_lock);136static DEFINE_SPINLOCK(timer_lock);
137static const char *timer_parent_names[] = {"clk32", "vctcxo_2", "vctcxo_4", "vctcxo"};137static const char *timer_parent_names[] = {"clk32", "vctcxo_4", "vctcxo_2", "vctcxo"};
138 138
139static DEFINE_SPINLOCK(reset_lock);139static DEFINE_SPINLOCK(reset_lock);
140 140
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
3255 .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc",3255 .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc",
3256 },3256 },
3257 .pwrsts = PWRSTS_OFF_ON,3257 .pwrsts = PWRSTS_OFF_ON,
3258 .flags = VOTABLE,
3258};3259};
3259 3260
3260static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = {3261static 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
3263 .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc",3264 .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc",
3264 },3265 },
3265 .pwrsts = PWRSTS_OFF_ON,3266 .pwrsts = PWRSTS_OFF_ON,
3267 .flags = VOTABLE,
3266};3268};
3267 3269
3268static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = {3270static 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
3271 .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc",3273 .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc",
3272 },3274 },
3273 .pwrsts = PWRSTS_OFF_ON,3275 .pwrsts = PWRSTS_OFF_ON,
3276 .flags = VOTABLE,
3274};3277};
3275 3278
3276static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = {3279static 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
3279 .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc",3282 .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc",
3280 },3283 },
3281 .pwrsts = PWRSTS_OFF_ON,3284 .pwrsts = PWRSTS_OFF_ON,
3285 .flags = VOTABLE,
3282};3286};
3283 3287
3284static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = {3288static 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
3287 .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc",3291 .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc",
3288 },3292 },
3289 .pwrsts = PWRSTS_OFF_ON,3293 .pwrsts = PWRSTS_OFF_ON,
3294 .flags = VOTABLE,
3290};3295};
3291 3296
3292static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = {3297static 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
3295 .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc",3300 .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc",
3296 },3301 },
3297 .pwrsts = PWRSTS_OFF_ON,3302 .pwrsts = PWRSTS_OFF_ON,
3303 .flags = VOTABLE,
3298};3304};
3299 3305
3300static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = {3306static 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
3303 .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc",3309 .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc",
3304 },3310 },
3305 .pwrsts = PWRSTS_OFF_ON,3311 .pwrsts = PWRSTS_OFF_ON,
3312 .flags = VOTABLE,
3306};3313};
3307 3314
3308static struct clk_regmap *gcc_sdm845_clocks[] = {3315static struct clk_regmap *gcc_sdm845_clocks[] = {
drivers/clk/samsung/clk-exynos5420.c+8−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
12#include <linux/clk-provider.h>12#include <linux/clk-provider.h>
13#include <linux/of.h>13#include <linux/of.h>
14#include <linux/of_address.h>14#include <linux/of_address.h>
15#include <linux/clk.h>
15 16
16#include "clk.h"17#include "clk.h"
17#include "clk-cpu.h"18#include "clk-cpu.h"
@@ -1646,6 +1647,13 @@ static void __init exynos5x_clk_init(struct device_node *np, · 1628 unmodified lines
1646 exynos5x_subcmus);1647 exynos5x_subcmus);
1647 }1648 }
1648 1649
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
1649 samsung_clk_of_add_provider(np, ctx);1657 samsung_clk_of_add_provider(np, ctx);
1650}1658}
1651 1659
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c+3−13
@@ -23,9 +23,9 @@ · 22 unmodified lines
23 */23 */
24 24
25static const char * const ar100_r_apb2_parents[] = { "osc24M", "osc32k",25static const char * const ar100_r_apb2_parents[] = { "osc24M", "osc32k",
26 "pll-periph0", "iosc" };26 "iosc", "pll-periph0" };
27static const struct ccu_mux_var_prediv ar100_r_apb2_predivs[] = {27static const struct ccu_mux_var_prediv ar100_r_apb2_predivs[] = {
28 { .index = 2, .shift = 0, .width = 5 },28 { .index = 3, .shift = 0, .width = 5 },
29};29};
30 30
31static struct ccu_div ar100_clk = {31static struct ccu_div ar100_clk = {
@@ -51,17 +51,7 @@ static struct ccu_div ar100_clk = { · 19 unmodified lines
51 51
52static CLK_FIXED_FACTOR_HW(r_ahb_clk, "r-ahb", &ar100_clk.common.hw, 1, 1, 0);52static CLK_FIXED_FACTOR_HW(r_ahb_clk, "r-ahb", &ar100_clk.common.hw, 1, 1, 0);
53 53
54static struct ccu_div r_apb1_clk = {54static SUNXI_CCU_M(r_apb1_clk, "r-apb1", "r-ahb", 0x00c, 0, 2, 0);
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};
65 55
66static struct ccu_div r_apb2_clk = {56static struct ccu_div r_apb2_clk = {
67 .div = _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),57 .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
51 51
52static CLK_FIXED_FACTOR_HW(ahb0_clk, "ahb0", &ar100_clk.common.hw, 1, 1, 0);52static CLK_FIXED_FACTOR_HW(ahb0_clk, "ahb0", &ar100_clk.common.hw, 1, 1, 0);
53 53
54static struct ccu_div apb0_clk = {54static SUNXI_CCU_M(apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0);
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
66static SUNXI_CCU_M(a83t_apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0);
67 55
68/*56/*
69 * Define the parent as an array that can be reused to save space57 * 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
127 115
128static struct ccu_common *sun8i_a83t_r_ccu_clks[] = {116static struct ccu_common *sun8i_a83t_r_ccu_clks[] = {
129 &ar100_clk.common,117 &ar100_clk.common,
130 &a83t_apb0_clk.common,118 &apb0_clk.common,
131 &apb0_pio_clk.common,119 &apb0_pio_clk.common,
132 &apb0_ir_clk.common,120 &apb0_ir_clk.common,
133 &apb0_timer_clk.common,121 &apb0_timer_clk.common,
@@ -167,7 +155,7 @@ static struct clk_hw_onecell_data sun8i_a83t_r_hw_clks = { · 33 unmodified lines
167 .hws = {155 .hws = {
168 [CLK_AR100] = &ar100_clk.common.hw,156 [CLK_AR100] = &ar100_clk.common.hw,
169 [CLK_AHB0] = &ahb0_clk.hw,157 [CLK_AHB0] = &ahb0_clk.hw,
170 [CLK_APB0] = &a83t_apb0_clk.common.hw,158 [CLK_APB0] = &apb0_clk.common.hw,
171 [CLK_APB0_PIO] = &apb0_pio_clk.common.hw,159 [CLK_APB0_PIO] = &apb0_pio_clk.common.hw,
172 [CLK_APB0_IR] = &apb0_ir_clk.common.hw,160 [CLK_APB0_IR] = &apb0_ir_clk.common.hw,
173 [CLK_APB0_TIMER] = &apb0_timer_clk.common.hw,161 [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
282 270
283static void __init sun8i_a83t_r_ccu_setup(struct device_node *node)271static void __init sun8i_a83t_r_ccu_setup(struct device_node *node)
284{272{
285 /* Fix apb0 bus gate parents here */
286 apb0_gate_parent[0] = &a83t_apb0_clk.common.hw;
287
288 sunxi_r_ccu_init(node, &sun8i_a83t_r_ccu_desc);273 sunxi_r_ccu_init(node, &sun8i_a83t_r_ccu_desc);
289}274}
290CLK_OF_DECLARE(sun8i_a83t_r_ccu, "allwinner,sun8i-a83t-r-ccu",275CLK_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
761 .reg = 0x1f0,761 .reg = 0x1f0,
762 .features = CCU_FEATURE_FIXED_PREDIV,762 .features = CCU_FEATURE_FIXED_PREDIV,
763 .hw.init = CLK_HW_INIT_PARENTS("outa", out_parents,763 .hw.init = CLK_HW_INIT_PARENTS("outa", out_parents,
764 &ccu_mp_ops, 0),764 &ccu_mp_ops,
765 CLK_SET_RATE_PARENT),
765 }766 }
766};767};
767 768
@@ -779,7 +780,8 @@ static struct ccu_mp outb_clk = { · 11 unmodified lines
779 .reg = 0x1f4,780 .reg = 0x1f4,
780 .features = CCU_FEATURE_FIXED_PREDIV,781 .features = CCU_FEATURE_FIXED_PREDIV,
781 .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents,782 .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents,
782 &ccu_mp_ops, 0),783 &ccu_mp_ops,
784 CLK_SET_RATE_PARENT),
783 }785 }
784};786};
785 787
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
618 [CLK_MBUS] = &mbus_clk.common.hw,618 [CLK_MBUS] = &mbus_clk.common.hw,
619 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,619 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,
620 },620 },
621 .num = CLK_NUMBER,621 .num = CLK_PLL_DDR1 + 1,
622};622};
623 623
624static struct clk_hw_onecell_data sun8i_v3_hw_clks = {624static 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
700 [CLK_MBUS] = &mbus_clk.common.hw,700 [CLK_MBUS] = &mbus_clk.common.hw,
701 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,701 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,
702 },702 },
703 .num = CLK_NUMBER,703 .num = CLK_I2S0 + 1,
704};704};
705 705
706static struct ccu_reset_map sun8i_v3s_ccu_resets[] = {706static 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
51 51
52#define CLK_PLL_DDR1 7452#define CLK_PLL_DDR1 74
53 53
54#define CLK_NUMBER (CLK_I2S0 + 1)
55
56#endif /* _CCU_SUN8I_H3_H_ */54#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
231 periph_banks = banks;231 periph_banks = banks;
232 232
233 clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL);233 clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL);
234 if (!clks)234 if (!clks) {
235 kfree(periph_clk_enb_refcnt);235 kfree(periph_clk_enb_refcnt);
236 return NULL;
237 }
236 238
237 clk_num = num;239 clk_num = num;
238 240
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
233 cinfo->iobase = of_iomap(node, 0);233 cinfo->iobase = of_iomap(node, 0);
234 cinfo->dev = &pdev->dev;234 cinfo->dev = &pdev->dev;
235 pm_runtime_enable(cinfo->dev);235 pm_runtime_enable(cinfo->dev);
236 pm_runtime_irq_safe(cinfo->dev);
237 236
238 pm_runtime_get_sync(cinfo->dev);237 pm_runtime_get_sync(cinfo->dev);
239 atl_write(cinfo, DRA7_ATL_PCLKMUX_REG(0), DRA7_ATL_PCLKMUX);238 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
198 * pattern detection.198 * pattern detection.
199 */199 */
200 cpu_data->intervals[cpu_data->interval_idx++] = measured_ns;200 cpu_data->intervals[cpu_data->interval_idx++] = measured_ns;
201 if (cpu_data->interval_idx > INTERVALS)201 if (cpu_data->interval_idx >= INTERVALS)
202 cpu_data->interval_idx = 0;202 cpu_data->interval_idx = 0;
203}203}
204 204
drivers/crypto/hisilicon/sec2/sec.h+3−3
@@ -40,7 +40,7 @@ struct sec_req { · 39 unmodified lines
40 int req_id;40 int req_id;
41 41
42 /* Status of the SEC request */42 /* Status of the SEC request */
43 int fake_busy;43 atomic_t fake_busy;
44};44};
45 45
46/**46/**
@@ -132,8 +132,8 @@ struct sec_debug_file { · 85 unmodified lines
132};132};
133 133
134struct sec_dfx {134struct sec_dfx {
135 u64 send_cnt;135 atomic64_t send_cnt;
136 u64 recv_cnt;136 atomic64_t recv_cnt;
137};137};
138 138
139struct sec_debug {139struct 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
120 return;120 return;
121 }121 }
122 122
123 __sync_add_and_fetch(&req->ctx->sec->debug.dfx.recv_cnt, 1);123 atomic64_inc(&req->ctx->sec->debug.dfx.recv_cnt);
124 124
125 req->ctx->req_op->buf_unmap(req->ctx, req);125 req->ctx->req_op->buf_unmap(req->ctx, req);
126 126
@@ -135,13 +135,13 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req) · 8 unmodified lines
135 mutex_lock(&qp_ctx->req_lock);135 mutex_lock(&qp_ctx->req_lock);
136 ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe);136 ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe);
137 mutex_unlock(&qp_ctx->req_lock);137 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);
139 139
140 if (ret == -EBUSY)140 if (ret == -EBUSY)
141 return -ENOBUFS;141 return -ENOBUFS;
142 142
143 if (!ret) {143 if (!ret) {
144 if (req->fake_busy)144 if (atomic_read(&req->fake_busy))
145 ret = -EBUSY;145 ret = -EBUSY;
146 else146 else
147 ret = -EINPROGRESS;147 ret = -EINPROGRESS;
@@ -641,7 +641,7 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req) · 493 unmodified lines
641 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && req->c_req.encrypt)641 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && req->c_req.encrypt)
642 sec_update_iv(req);642 sec_update_iv(req);
643 643
644 if (__sync_bool_compare_and_swap(&req->fake_busy, 1, 0))644 if (atomic_cmpxchg(&req->fake_busy, 1, 0) != 1)
645 sk_req->base.complete(&sk_req->base, -EINPROGRESS);645 sk_req->base.complete(&sk_req->base, -EINPROGRESS);
646 646
647 sk_req->base.complete(&sk_req->base, req->err_type);647 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
672 }672 }
673 673
674 if (ctx->fake_req_limit <= atomic_inc_return(&qp_ctx->pending_reqs))674 if (ctx->fake_req_limit <= atomic_inc_return(&qp_ctx->pending_reqs))
675 req->fake_busy = 1;675 atomic_set(&req->fake_busy, 1);
676 else676 else
677 req->fake_busy = 0;677 atomic_set(&req->fake_busy, 0);
678 678
679 ret = ctx->req_op->get_res(ctx, req);679 ret = ctx->req_op->get_res(ctx, req);
680 if (ret) {680 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
608 .write = sec_debug_write,608 .write = sec_debug_write,
609};609};
610 610
611static int debugfs_atomic64_t_get(void *data, u64 *val)
612{
613 *val = atomic64_read((atomic64_t *)data);
614 return 0;
615}
616DEFINE_DEBUGFS_ATTRIBUTE(fops_atomic64_t_ro, debugfs_atomic64_t_get, NULL,
617 "%lld\n");
618
611static int sec_core_debug_init(struct sec_dev *sec)619static int sec_core_debug_init(struct sec_dev *sec)
612{620{
613 struct hisi_qm *qm = &sec->qm;621 struct hisi_qm *qm = &sec->qm;
@@ -628,9 +636,11 @@ static int sec_core_debug_init(struct sec_dev *sec) · 14 unmodified lines
628 636
629 debugfs_create_regset32("regs", 0444, tmp_d, regset);637 debugfs_create_regset32("regs", 0444, tmp_d, regset);
630 638
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);
632 641
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);
634 644
635 return 0;645 return 0;
636}646}
drivers/firmware/efi/earlycon.c+7−9
@@ -17,7 +17,7 @@ static const struct console *earlycon_console __initdata; · 16 unmodified lines
17static const struct font_desc *font;17static const struct font_desc *font;
18static u32 efi_x, efi_y;18static u32 efi_x, efi_y;
19static u64 fb_base;19static u64 fb_base;
20static pgprot_t fb_prot;20static bool fb_wb;
21static void *efi_fb;21static void *efi_fb;
22 22
23/*23/*
@@ -33,10 +33,8 @@ static int __init efi_earlycon_remap_fb(void) · 9 unmodified lines
33 if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))33 if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))
34 return 0;34 return 0;
35 35
36 if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))36 efi_fb = memremap(fb_base, screen_info.lfb_size,
37 efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WB);37 fb_wb ? MEMREMAP_WB : MEMREMAP_WC);
38 else
39 efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WC);
40 38
41 return efi_fb ? 0 : -ENOMEM;39 return efi_fb ? 0 : -ENOMEM;
42}40}
@@ -53,9 +51,12 @@ late_initcall(efi_earlycon_unmap_fb); · 10 unmodified lines
53 51
54static __ref void *efi_earlycon_map(unsigned long start, unsigned long len)52static __ref void *efi_earlycon_map(unsigned long start, unsigned long len)
55{53{
54 pgprot_t fb_prot;
55
56 if (efi_fb)56 if (efi_fb)
57 return efi_fb + start;57 return efi_fb + start;
58 58
59 fb_prot = fb_wb ? PAGE_KERNEL : pgprot_writecombine(PAGE_KERNEL);
59 return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot));60 return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot));
60}61}
61 62
@@ -215,10 +216,7 @@ static int __init efi_earlycon_setup(struct earlycon_device *device, · 153 unmodified lines
215 if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)216 if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
216 fb_base |= (u64)screen_info.ext_lfb_base << 32;217 fb_base |= (u64)screen_info.ext_lfb_base << 32;
217 218
218 if (opt && !strcmp(opt, "ram"))219 fb_wb = opt && !strcmp(opt, "ram");
219 fb_prot = PAGE_KERNEL;
220 else
221 fb_prot = pgprot_writecombine(PAGE_KERNEL);
222 220
223 si = &screen_info;221 si = &screen_info;
224 xres = si->lfb_width;222 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
33{33{
34 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;34 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
35 efi_status_t status;35 efi_status_t status;
36 struct efi_rng_protocol *rng;36 struct efi_rng_protocol *rng = NULL;
37 37
38 status = efi_call_early(locate_protocol, &rng_proto, NULL,38 status = efi_call_early(locate_protocol, &rng_proto, NULL,
39 (void **)&rng);39 (void **)&rng);
@@ -162,8 +162,8 @@ efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg) · 122 unmodified lines
162 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;162 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
163 efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW;163 efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW;
164 efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID;164 efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID;
165 struct efi_rng_protocol *rng;165 struct efi_rng_protocol *rng = NULL;
166 struct linux_efi_random_seed *seed;166 struct linux_efi_random_seed *seed = NULL;
167 efi_status_t status;167 efi_status_t status;
168 168
169 status = efi_call_early(locate_protocol, &rng_proto, NULL,169 status = efi_call_early(locate_protocol, &rng_proto, NULL,
drivers/gpio/Kconfig+0−1
@@ -573,7 +573,6 @@ config GPIO_THUNDERX · 572 unmodified lines
573 tristate "Cavium ThunderX/OCTEON-TX GPIO"573 tristate "Cavium ThunderX/OCTEON-TX GPIO"
574 depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)574 depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
575 depends on PCI_MSI575 depends on PCI_MSI
576 select GPIOLIB_IRQCHIP
577 select IRQ_DOMAIN_HIERARCHY576 select IRQ_DOMAIN_HIERARCHY
578 select IRQ_FASTEOI_HIERARCHY_HANDLERS577 select IRQ_FASTEOI_HIERARCHY_HANDLERS
579 help578 help
drivers/gpio/gpio-thunderx.c+107−56
@@ -53,6 +53,7 @@ struct thunderx_line { · 52 unmodified lines
53struct thunderx_gpio {53struct thunderx_gpio {
54 struct gpio_chip chip;54 struct gpio_chip chip;
55 u8 __iomem *register_base;55 u8 __iomem *register_base;
56 struct irq_domain *irqd;
56 struct msix_entry *msix_entries; /* per line MSI-X */57 struct msix_entry *msix_entries; /* per line MSI-X */
57 struct thunderx_line *line_entries; /* per line irq info */58 struct thunderx_line *line_entries; /* per line irq info */
58 raw_spinlock_t lock;59 raw_spinlock_t lock;
@@ -285,60 +286,54 @@ static void thunderx_gpio_set_multiple(struct gpio_chip *chip, · 226 unmodified lines
285 }286 }
286}287}
287 288
288static void thunderx_gpio_irq_ack(struct irq_data *d)289static void thunderx_gpio_irq_ack(struct irq_data *data)
289{290{
290 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);291 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
291 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
292 292
293 writeq(GPIO_INTR_INTR,293 writeq(GPIO_INTR_INTR,
294 txgpio->register_base + intr_reg(irqd_to_hwirq(d)));294 txline->txgpio->register_base + intr_reg(txline->line));
295}295}
296 296
297static void thunderx_gpio_irq_mask(struct irq_data *d)297static void thunderx_gpio_irq_mask(struct irq_data *data)
298{298{
299 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);299 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
300 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
301 300
302 writeq(GPIO_INTR_ENA_W1C,301 writeq(GPIO_INTR_ENA_W1C,
303 txgpio->register_base + intr_reg(irqd_to_hwirq(d)));302 txline->txgpio->register_base + intr_reg(txline->line));
304}303}
305 304
306static void thunderx_gpio_irq_mask_ack(struct irq_data *d)305static void thunderx_gpio_irq_mask_ack(struct irq_data *data)
307{306{
308 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);307 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
309 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
310 308
311 writeq(GPIO_INTR_ENA_W1C | GPIO_INTR_INTR,309 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));
313}311}
314 312
315static void thunderx_gpio_irq_unmask(struct irq_data *d)313static void thunderx_gpio_irq_unmask(struct irq_data *data)
316{314{
317 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);315 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
318 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
319 316
320 writeq(GPIO_INTR_ENA_W1S,317 writeq(GPIO_INTR_ENA_W1S,
321 txgpio->register_base + intr_reg(irqd_to_hwirq(d)));318 txline->txgpio->register_base + intr_reg(txline->line));
322}319}
323 320
324static int thunderx_gpio_irq_set_type(struct irq_data *d,321static int thunderx_gpio_irq_set_type(struct irq_data *data,
325 unsigned int flow_type)322 unsigned int flow_type)
326{323{
327 struct gpio_chip *gc = irq_data_get_irq_chip_data(d);324 struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
328 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);325 struct thunderx_gpio *txgpio = txline->txgpio;
329 struct thunderx_line *txline =
330 &txgpio->line_entries[irqd_to_hwirq(d)];
331 u64 bit_cfg;326 u64 bit_cfg;
332 327
333 irqd_set_trigger_type(d, flow_type);328 irqd_set_trigger_type(data, flow_type);
334 329
335 bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN;330 bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN;
336 331
337 if (flow_type & IRQ_TYPE_EDGE_BOTH) {332 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);
339 bit_cfg |= GPIO_BIT_CFG_INT_TYPE;334 bit_cfg |= GPIO_BIT_CFG_INT_TYPE;
340 } else {335 } else {
341 irq_set_handler_locked(d, handle_fasteoi_mask_irq);336 irq_set_handler_locked(data, handle_fasteoi_mask_irq);
342 }337 }
343 338
344 raw_spin_lock(&txgpio->lock);339 raw_spin_lock(&txgpio->lock);
@@ -367,6 +362,33 @@ static void thunderx_gpio_irq_disable(struct irq_data *data) · 22 unmodified lines
367 irq_chip_disable_parent(data);362 irq_chip_disable_parent(data);
368}363}
369 364
365static 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
382static 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
370/*392/*
371 * Interrupts are chained from underlying MSI-X vectors. We have393 * Interrupts are chained from underlying MSI-X vectors. We have
372 * these irq_chip functions to be able to handle level triggering394 * 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
383 .irq_unmask = thunderx_gpio_irq_unmask,405 .irq_unmask = thunderx_gpio_irq_unmask,
384 .irq_eoi = irq_chip_eoi_parent,406 .irq_eoi = irq_chip_eoi_parent,
385 .irq_set_affinity = irq_chip_set_affinity_parent,407 .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,
386 .irq_set_type = thunderx_gpio_irq_set_type,410 .irq_set_type = thunderx_gpio_irq_set_type,
387 411
388 .flags = IRQCHIP_SET_TYPE_MASKED412 .flags = IRQCHIP_SET_TYPE_MASKED
389};413};
390 414
391static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,415static int thunderx_gpio_irq_translate(struct irq_domain *d,
392 unsigned int child,416 struct irq_fwspec *fwspec,
393 unsigned int child_type,417 irq_hw_number_t *hwirq,
394 unsigned int *parent,418 unsigned int *type)
395 unsigned int *parent_type)
396{419{
397 struct thunderx_gpio *txgpio = gpiochip_get_data(gc);420 struct thunderx_gpio *txgpio = d->host_data;
398 421
399 *parent = txgpio->base_msi + (2 * child);422 if (WARN_ON(fwspec->param_count < 2))
400 *parent_type = IRQ_TYPE_LEVEL_HIGH;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;
401 return 0;428 return 0;
402}429}
403 430
431static 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
440static const struct irq_domain_ops thunderx_gpio_irqd_ops = {
441 .alloc = thunderx_gpio_irq_alloc,
442 .translate = thunderx_gpio_irq_translate
443};
444
445static 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
404static int thunderx_gpio_probe(struct pci_dev *pdev,452static int thunderx_gpio_probe(struct pci_dev *pdev,
405 const struct pci_device_id *id)453 const struct pci_device_id *id)
406{454{
@@ -408,7 +456,6 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 1 unmodified line
408 struct device *dev = &pdev->dev;456 struct device *dev = &pdev->dev;
409 struct thunderx_gpio *txgpio;457 struct thunderx_gpio *txgpio;
410 struct gpio_chip *chip;458 struct gpio_chip *chip;
411 struct gpio_irq_chip *girq;
412 int ngpio, i;459 int ngpio, i;
413 int err = 0;460 int err = 0;
414 461
@@ -453,8 +500,8 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 38 unmodified lines
453 }500 }
454 501
455 txgpio->msix_entries = devm_kcalloc(dev,502 txgpio->msix_entries = devm_kcalloc(dev,
456 ngpio, sizeof(struct msix_entry),503 ngpio, sizeof(struct msix_entry),
457 GFP_KERNEL);504 GFP_KERNEL);
458 if (!txgpio->msix_entries) {505 if (!txgpio->msix_entries) {
459 err = -ENOMEM;506 err = -ENOMEM;
460 goto out;507 goto out;
@@ -495,6 +542,27 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 34 unmodified lines
495 if (err < 0)542 if (err < 0)
496 goto out;543 goto out;
497 544
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
498 chip->label = KBUILD_MODNAME;566 chip->label = KBUILD_MODNAME;
499 chip->parent = dev;567 chip->parent = dev;
500 chip->owner = THIS_MODULE;568 chip->owner = THIS_MODULE;
@@ -509,28 +577,11 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 8 unmodified lines
509 chip->set = thunderx_gpio_set;577 chip->set = thunderx_gpio_set;
510 chip->set_multiple = thunderx_gpio_set_multiple;578 chip->set_multiple = thunderx_gpio_set_multiple;
511 chip->set_config = thunderx_gpio_set_config;579 chip->set_config = thunderx_gpio_set_config;
512 girq = &chip->irq;580 chip->to_irq = thunderx_gpio_to_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
521 err = devm_gpiochip_add_data(dev, chip, txgpio);581 err = devm_gpiochip_add_data(dev, chip, txgpio);
522 if (err)582 if (err)
523 goto out;583 goto out;
524 584
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
534 dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n",585 dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n",
535 ngpio, chip->base);586 ngpio, chip->base);
536 return 0;587 return 0;
@@ -545,10 +596,10 @@ static void thunderx_gpio_remove(struct pci_dev *pdev) · 8 unmodified lines
545 struct thunderx_gpio *txgpio = pci_get_drvdata(pdev);596 struct thunderx_gpio *txgpio = pci_get_drvdata(pdev);
546 597
547 for (i = 0; i < txgpio->chip.ngpio; i++)598 for (i = 0; i < txgpio->chip.ngpio; i++)
548 irq_domain_pop_irq(txgpio->chip.irq.domain,599 irq_domain_pop_irq(txgpio->irqd,
549 txgpio->msix_entries[i].vector);600 txgpio->msix_entries[i].vector);
550 601
551 irq_domain_remove(txgpio->chip.irq.domain);602 irq_domain_remove(txgpio->irqd);
552 603
553 pci_set_drvdata(pdev, NULL);604 pci_set_drvdata(pdev, NULL);
554}605}
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
254 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC0_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),254 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC0_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
255 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),255 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
256 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0),256 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)
258};258};
259 259
260static u32 sdma_v4_0_get_reg_offset(struct amdgpu_device *adev,260static 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
817 }817 }
818 818
819 case SIGNAL_TYPE_EDP: {819 case SIGNAL_TYPE_EDP: {
820 read_current_link_settings_on_detect(link);
821 detect_edp_sink_caps(link);820 detect_edp_sink_caps(link);
821 read_current_link_settings_on_detect(link);
822 sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX;822 sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
823 sink_caps.signal = SIGNAL_TYPE_EDP;823 sink_caps.signal = SIGNAL_TYPE_EDP;
824 break;824 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
1190 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {1190 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {
1191 mstb->tx_slots[txmsg->seqno] = NULL;1191 mstb->tx_slots[txmsg->seqno] = NULL;
1192 }1192 }
1193 mgr->is_waiting_for_dwn_reply = false;
1194
1193 }1195 }
1194out:1196out:
1195 if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {1197 if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
@@ -1199,6 +1201,7 @@ out: · 3 unmodified lines
1199 }1201 }
1200 mutex_unlock(&mgr->qlock);1202 mutex_unlock(&mgr->qlock);
1201 1203
1204 drm_dp_mst_kick_tx(mgr);
1202 return ret;1205 return ret;
1203}1206}
1204 1207
@@ -2318,7 +2321,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 1113 unmodified lines
2318{2321{
2319 struct drm_dp_mst_topology_mgr *mgr = mstb->mgr;2322 struct drm_dp_mst_topology_mgr *mgr = mstb->mgr;
2320 struct drm_dp_mst_port *port;2323 struct drm_dp_mst_port *port;
2321 int old_ddps, ret;2324 int old_ddps, old_input, ret, i;
2322 u8 new_pdt;2325 u8 new_pdt;
2323 bool dowork = false, create_connector = false;2326 bool dowork = false, create_connector = false;
2324 2327
@@ -2349,6 +2352,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 24 unmodified lines
2349 }2352 }
2350 2353
2351 old_ddps = port->ddps;2354 old_ddps = port->ddps;
2355 old_input = port->input;
2352 port->input = conn_stat->input_port;2356 port->input = conn_stat->input_port;
2353 port->mcs = conn_stat->message_capability_status;2357 port->mcs = conn_stat->message_capability_status;
2354 port->ldps = conn_stat->legacy_device_plug_status;2358 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
2373 dowork = false;2377 dowork = false;
2374 }2378 }
2375 2379
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
2376 if (port->connector)2402 if (port->connector)
2377 drm_modeset_unlock(&mgr->base.lock);2403 drm_modeset_unlock(&mgr->base.lock);
2378 else if (create_connector)2404 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
2718 ret = process_single_tx_qlock(mgr, txmsg, false);2744 ret = process_single_tx_qlock(mgr, txmsg, false);
2719 if (ret == 1) {2745 if (ret == 1) {
2720 /* txmsg is sent it should be in the slots now */2746 /* txmsg is sent it should be in the slots now */
2747 mgr->is_waiting_for_dwn_reply = true;
2721 list_del(&txmsg->next);2748 list_del(&txmsg->next);
2722 } else if (ret) {2749 } else if (ret) {
2723 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);2750 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);
2751 mgr->is_waiting_for_dwn_reply = false;
2724 list_del(&txmsg->next);2752 list_del(&txmsg->next);
2725 if (txmsg->seqno != -1)2753 if (txmsg->seqno != -1)
2726 txmsg->dst->tx_slots[txmsg->seqno] = NULL;2754 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
2760 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);2788 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
2761 }2789 }
2762 2790
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)
2764 process_single_down_tx_qlock(mgr);2793 process_single_down_tx_qlock(mgr);
2765 mutex_unlock(&mgr->qlock);2794 mutex_unlock(&mgr->qlock);
2766}2795}
@@ -3678,6 +3707,7 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) · 911 unmodified lines
3678 mutex_lock(&mgr->qlock);3707 mutex_lock(&mgr->qlock);
3679 txmsg->state = DRM_DP_SIDEBAND_TX_RX;3708 txmsg->state = DRM_DP_SIDEBAND_TX_RX;
3680 mstb->tx_slots[slot] = NULL;3709 mstb->tx_slots[slot] = NULL;
3710 mgr->is_waiting_for_dwn_reply = false;
3681 mutex_unlock(&mgr->qlock);3711 mutex_unlock(&mgr->qlock);
3682 3712
3683 wake_up_all(&mgr->tx_waitq);3713 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
3687no_msg:3717no_msg:
3688 drm_dp_mst_topology_put_mstb(mstb);3718 drm_dp_mst_topology_put_mstb(mstb);
3689clear_down_rep_recv:3719clear_down_rep_recv:
3720 mutex_lock(&mgr->qlock);
3721 mgr->is_waiting_for_dwn_reply = false;
3722 mutex_unlock(&mgr->qlock);
3690 memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));3723 memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
3691 3724
3692 return 0;3725 return 0;
@@ -4497,7 +4530,7 @@ static void drm_dp_tx_work(struct work_struct *work) · 804 unmodified lines
4497 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work);4530 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work);
4498 4531
4499 mutex_lock(&mgr->qlock);4532 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)
4501 process_single_down_tx_qlock(mgr);4534 process_single_down_tx_qlock(mgr);
4502 mutex_unlock(&mgr->qlock);4535 mutex_unlock(&mgr->qlock);
4503}4536}
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
123 if (err)123 if (err)
124 return err;124 return err;
125 125
126 err = i915_active_acquire(&vma->active);
127 if (err)
128 goto err_unpin;
129
126 /*130 /*
127 * And mark it as a globally pinned object to let the shrinker know131 * And mark it as a globally pinned object to let the shrinker know
128 * it cannot reclaim the object until we release it.132 * 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
131 vma->obj->mm.dirty = true;135 vma->obj->mm.dirty = true;
132 136
133 return 0;137 return 0;
138
139err_unpin:
140 i915_vma_unpin(vma);
141 return err;
134}142}
135 143
136static void __context_unpin_state(struct i915_vma *vma)144static void __context_unpin_state(struct i915_vma *vma)
137{145{
138 i915_vma_make_shrinkable(vma);146 i915_vma_make_shrinkable(vma);
147 i915_active_release(&vma->active);
139 __i915_vma_unpin(vma);148 __i915_vma_unpin(vma);
140}149}
141 150
151static 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
165err_active:
166 i915_active_release(&ring->vma->active);
167 return err;
168}
169
170static void __ring_retire(struct intel_ring *ring)
171{
172 intel_ring_unpin(ring);
173 i915_active_release(&ring->vma->active);
174}
175
142__i915_active_call176__i915_active_call
143static void __intel_context_retire(struct i915_active *active)177static void __intel_context_retire(struct i915_active *active)
144{178{
@@ -151,7 +185,7 @@ static void __intel_context_retire(struct i915_active *active) · 6 unmodified lines
151 __context_unpin_state(ce->state);185 __context_unpin_state(ce->state);
152 186
153 intel_timeline_unpin(ce->timeline);187 intel_timeline_unpin(ce->timeline);
154 intel_ring_unpin(ce->ring);188 __ring_retire(ce->ring);
155 189
156 intel_context_put(ce);190 intel_context_put(ce);
157}191}
@@ -163,7 +197,7 @@ static int __intel_context_active(struct i915_active *active) · 5 unmodified lines
163 197
164 intel_context_get(ce);198 intel_context_get(ce);
165 199
166 err = intel_ring_pin(ce->ring);200 err = __ring_active(ce->ring);
167 if (err)201 if (err)
168 goto err_put;202 goto err_put;
169 203
@@ -183,7 +217,7 @@ static int __intel_context_active(struct i915_active *active) · 13 unmodified lines
183err_timeline:217err_timeline:
184 intel_timeline_unpin(ce->timeline);218 intel_timeline_unpin(ce->timeline);
185err_ring:219err_ring:
186 intel_ring_unpin(ce->ring);220 __ring_retire(ce->ring);
187err_put:221err_put:
188 intel_context_put(ce);222 intel_context_put(ce);
189 return err;223 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
2664 /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */2664 /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
2665 batch = gen8_emit_flush_coherentl3_wa(engine, batch);2665 batch = gen8_emit_flush_coherentl3_wa(engine, batch);
2666 2666
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
2667 batch = emit_lri(batch, lri, ARRAY_SIZE(lri));2675 batch = emit_lri(batch, lri, ARRAY_SIZE(lri));
2668 2676
2669 /* WaMediaPoolStateCmdInWABB:bxt,glk */2677 /* 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
3304 3304
3305static void ggtt_restore_mappings(struct i915_ggtt *ggtt)3305static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
3306{3306{
3307 struct i915_vma *vma, *vn;3307 struct i915_vma *vma;
3308 bool flush = false;3308 bool flush = false;
3309 int open;3309 int open;
3310 3310
@@ -3319,15 +3319,12 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt) · 8 unmodified lines
3319 open = atomic_xchg(&ggtt->vm.open, 0);3319 open = atomic_xchg(&ggtt->vm.open, 0);
3320 3320
3321 /* clflush objects bound into the GGTT and rebind them. */3321 /* 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) {
3323 struct drm_i915_gem_object *obj = vma->obj;3323 struct drm_i915_gem_object *obj = vma->obj;
3324 3324
3325 if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))3325 if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
3326 continue;3326 continue;
3327 3327
3328 if (!__i915_vma_unbind(vma))
3329 continue;
3330
3331 clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma));3328 clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma));
3332 WARN_ON(i915_vma_bind(vma,3329 WARN_ON(i915_vma_bind(vma,
3333 obj ? obj->cache_level : 0,3330 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
1074 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);1074 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1075 pmu->timer.function = i915_sample;1075 pmu->timer.function = i915_sample;
1076 1076
1077 if (!is_igp(i915))1077 if (!is_igp(i915)) {
1078 pmu->name = kasprintf(GFP_KERNEL,1078 pmu->name = kasprintf(GFP_KERNEL,
1079 "i915-%s",1079 "i915_%s",
1080 dev_name(i915->drm.dev));1080 dev_name(i915->drm.dev));
1081 else1081 if (pmu->name) {
1082 /* tools/perf reserves colons as special. */
1083 strreplace((char *)pmu->name, ':', '_');
1084 }
1085 } else {
1082 pmu->name = "i915";1086 pmu->name = "i915";
1087 }
1083 if (!pmu->name)1088 if (!pmu->name)
1084 goto err;1089 goto err;
1085 1090
drivers/gpu/drm/i915/selftests/i915_random.h+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25#ifndef __I915_SELFTESTS_RANDOM_H__25#ifndef __I915_SELFTESTS_RANDOM_H__
26#define __I915_SELFTESTS_RANDOM_H__26#define __I915_SELFTESTS_RANDOM_H__
27 27
28#include <linux/math64.h>
28#include <linux/random.h>29#include <linux/random.h>
29 30
30#include "../i915_selftest.h"31#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
95 struct cdn_dp_port *port[MAX_PHY];95 struct cdn_dp_port *port[MAX_PHY];
96 u8 ports;96 u8 ports;
97 u8 max_lanes;97 u8 max_lanes;
98 u8 max_rate;98 unsigned int max_rate;
99 u8 lanes;99 u8 lanes;
100 int active_port;100 int active_port;
101 101
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
232 if (!objs)232 if (!objs)
233 return;233 return;
234 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);234 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
235 virtio_gpu_array_lock_resv(objs);
235 virtio_gpu_cmd_transfer_to_host_2d236 virtio_gpu_cmd_transfer_to_host_2d
236 (vgdev, 0,237 (vgdev, 0,
237 plane->state->crtc_w,238 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
1132 drvdata->trcid = coresight_get_trace_id(drvdata->cpu);1132 drvdata->trcid = coresight_get_trace_id(drvdata->cpu);
1133}1133}
1134 1134
1135#ifdef CONFIG_CPU_PM
1136static int etm4_cpu_save(struct etmv4_drvdata *drvdata)1135static int etm4_cpu_save(struct etmv4_drvdata *drvdata)
1137{1136{
1138 int i, ret = 0;1137 int i, ret = 0;
@@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = { · 263 unmodified lines
1402 1401
1403static int etm4_cpu_pm_register(void)1402static int etm4_cpu_pm_register(void)
1404{1403{
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;
1406}1408}
1407 1409
1408static void etm4_cpu_pm_unregister(void)1410static void etm4_cpu_pm_unregister(void)
1409{1411{
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);
1411}1414}
1412#else
1413static int etm4_cpu_pm_register(void) { return 0; }
1414static void etm4_cpu_pm_unregister(void) { }
1415#endif
1416 1415
1417static int etm4_probe(struct amba_device *adev, const struct amba_id *id)1416static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
1418{1417{
drivers/i2c/busses/i2c-iop3xx.c+8−4
@@ -433,13 +433,17 @@ iop3xx_i2c_probe(struct platform_device *pdev) · 432 unmodified lines
433 adapter_data->gpio_scl = devm_gpiod_get_optional(&pdev->dev,433 adapter_data->gpio_scl = devm_gpiod_get_optional(&pdev->dev,
434 "scl",434 "scl",
435 GPIOD_ASIS);435 GPIOD_ASIS);
436 if (IS_ERR(adapter_data->gpio_scl))436 if (IS_ERR(adapter_data->gpio_scl)) {
437 return PTR_ERR(adapter_data->gpio_scl);437 ret = PTR_ERR(adapter_data->gpio_scl);
438 goto free_both;
439 }
438 adapter_data->gpio_sda = devm_gpiod_get_optional(&pdev->dev,440 adapter_data->gpio_sda = devm_gpiod_get_optional(&pdev->dev,
439 "sda",441 "sda",
440 GPIOD_ASIS);442 GPIOD_ASIS);
441 if (IS_ERR(adapter_data->gpio_sda))443 if (IS_ERR(adapter_data->gpio_sda)) {
442 return PTR_ERR(adapter_data->gpio_sda);444 ret = PTR_ERR(adapter_data->gpio_sda);
445 goto free_both;
446 }
443 447
444 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);448 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
445 if (!res) {449 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
1608 }1608 }
1609 1609
1610 pm_runtime_enable(&pdev->dev);1610 pm_runtime_enable(&pdev->dev);
1611 if (!pm_runtime_enabled(&pdev->dev))1611 if (!pm_runtime_enabled(&pdev->dev)) {
1612 ret = tegra_i2c_runtime_resume(&pdev->dev);1612 ret = tegra_i2c_runtime_resume(&pdev->dev);
1613 else1613 if (ret < 0) {
1614 dev_err(&pdev->dev, "runtime resume failed\n");
1615 goto unprepare_div_clk;
1616 }
1617 } else {
1614 ret = pm_runtime_get_sync(i2c_dev->dev);1618 ret = pm_runtime_get_sync(i2c_dev->dev);
1615 1619 if (ret < 0) {
1616 if (ret < 0) {1620 dev_err(&pdev->dev, "runtime resume failed\n");
1617 dev_err(&pdev->dev, "runtime resume failed\n");1621 goto disable_rpm;
1618 goto unprepare_div_clk;1622 }
1619 }1623 }
1620 1624
1621 if (i2c_dev->is_multimaster_mode) {1625 if (i2c_dev->is_multimaster_mode) {
@@ -1623,7 +1627,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 1 unmodified line
1623 if (ret < 0) {1627 if (ret < 0) {
1624 dev_err(i2c_dev->dev, "div_clk enable failed %d\n",1628 dev_err(i2c_dev->dev, "div_clk enable failed %d\n",
1625 ret);1629 ret);
1626 goto disable_rpm;1630 goto put_rpm;
1627 }1631 }
1628 }1632 }
1629 1633
@@ -1671,11 +1675,16 @@ disable_div_clk: · 41 unmodified lines
1671 if (i2c_dev->is_multimaster_mode)1675 if (i2c_dev->is_multimaster_mode)
1672 clk_disable(i2c_dev->div_clk);1676 clk_disable(i2c_dev->div_clk);
1673 1677
1674disable_rpm:1678put_rpm:
1675 pm_runtime_disable(&pdev->dev);1679 if (pm_runtime_enabled(&pdev->dev))
1676 if (!pm_runtime_status_suspended(&pdev->dev))1680 pm_runtime_put_sync(&pdev->dev);
1681 else
1677 tegra_i2c_runtime_suspend(&pdev->dev);1682 tegra_i2c_runtime_suspend(&pdev->dev);
1678 1683
1684disable_rpm:
1685 if (pm_runtime_enabled(&pdev->dev))
1686 pm_runtime_disable(&pdev->dev);
1687
1679unprepare_div_clk:1688unprepare_div_clk:
1680 clk_unprepare(i2c_dev->div_clk);1689 clk_unprepare(i2c_dev->div_clk);
1681 1690
@@ -1710,9 +1719,14 @@ static int tegra_i2c_remove(struct platform_device *pdev) · 28 unmodified lines
1710static int __maybe_unused tegra_i2c_suspend(struct device *dev)1719static int __maybe_unused tegra_i2c_suspend(struct device *dev)
1711{1720{
1712 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);1721 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
1722 int err;
1713 1723
1714 i2c_mark_adapter_suspended(&i2c_dev->adapter);1724 i2c_mark_adapter_suspended(&i2c_dev->adapter);
1715 1725
1726 err = pm_runtime_force_suspend(dev);
1727 if (err < 0)
1728 return err;
1729
1716 return 0;1730 return 0;
1717}1731}
1718 1732
@@ -1733,6 +1747,10 @@ static int __maybe_unused tegra_i2c_resume(struct device *dev) · 14 unmodified lines
1733 if (err)1747 if (err)
1734 return err;1748 return err;
1735 1749
1750 err = pm_runtime_force_resume(dev);
1751 if (err < 0)
1752 return err;
1753
1736 i2c_mark_adapter_resumed(&i2c_dev->adapter);1754 i2c_mark_adapter_resumed(&i2c_dev->adapter);
1737 1755
1738 return 0;1756 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
494 st->channel_config[channel].buf_negative =494 st->channel_config[channel].buf_negative =
495 of_property_read_bool(child, "adi,buffered-negative");495 of_property_read_bool(child, "adi,buffered-negative");
496 496
497 *chan = ad7124_channel_template;497 chan[channel] = ad7124_channel_template;
498 chan->address = channel;498 chan[channel].address = channel;
499 chan->scan_index = channel;499 chan[channel].scan_index = channel;
500 chan->channel = ain[0];500 chan[channel].channel = ain[0];
501 chan->channel2 = ain[1];501 chan[channel].channel2 = ain[1];
502
503 chan++;
504 }502 }
505 503
506 return 0;504 return 0;
drivers/iio/chemical/Kconfig+1−0
@@ -65,6 +65,7 @@ config IAQCORE · 64 unmodified lines
65config PMS700365config PMS7003
66 tristate "Plantower PMS7003 particulate matter sensor"66 tristate "Plantower PMS7003 particulate matter sensor"
67 depends on SERIAL_DEV_BUS67 depends on SERIAL_DEV_BUS
68 select IIO_BUFFER
68 select IIO_TRIGGERED_BUFFER69 select IIO_TRIGGERED_BUFFER
69 help70 help
70 Say Y here to build support for the Plantower PMS7003 particulate71 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
1301 1301
1302 for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {1302 for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
1303 for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {1303 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)
1305 break;1306 break;
1306 }1307 }
1307 if (j < ST_LSM6DSX_MAX_ID)1308 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
566 const unsigned long *mask, bool timestamp)566 const unsigned long *mask, bool timestamp)
567{567{
568 unsigned bytes = 0;568 unsigned bytes = 0;
569 int length, i;569 int length, i, largest = 0;
570 570
571 /* How much space will the demuxed element take? */571 /* How much space will the demuxed element take? */
572 for_each_set_bit(i, mask,572 for_each_set_bit(i, mask,
@@ -574,13 +574,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, · 1 unmodified line
574 length = iio_storage_bytes_for_si(indio_dev, i);574 length = iio_storage_bytes_for_si(indio_dev, i);
575 bytes = ALIGN(bytes, length);575 bytes = ALIGN(bytes, length);
576 bytes += length;576 bytes += length;
577 largest = max(largest, length);
577 }578 }
578 579
579 if (timestamp) {580 if (timestamp) {
580 length = iio_storage_bytes_for_timestamp(indio_dev);581 length = iio_storage_bytes_for_timestamp(indio_dev);
581 bytes = ALIGN(bytes, length);582 bytes = ALIGN(bytes, length);
582 bytes += length;583 bytes += length;
584 largest = max(largest, length);
583 }585 }
586
587 bytes = ALIGN(bytes, largest);
584 return bytes;588 return bytes;
585}589}
586 590
drivers/iio/light/vcnl4000.c+2−1
@@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 162 unmodified lines
163 if (ret < 0)163 if (ret < 0)
164 return ret;164 return ret;
165 165
166 data->al_scale = 24000;
167 data->vcnl4200_al.reg = VCNL4200_AL_DATA;166 data->vcnl4200_al.reg = VCNL4200_AL_DATA;
168 data->vcnl4200_ps.reg = VCNL4200_PS_DATA;167 data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
169 switch (id) {168 switch (id) {
@@ -172,11 +171,13 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 2 unmodified lines
172 /* show 54ms in total. */171 /* show 54ms in total. */
173 data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);172 data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
174 data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);173 data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
174 data->al_scale = 24000;
175 break;175 break;
176 case VCNL4040_PROD_ID:176 case VCNL4040_PROD_ID:
177 /* Integration time is 80ms, add 10ms. */177 /* Integration time is 80ms, add 10ms. */
178 data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);178 data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);
179 data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);179 data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);
180 data->al_scale = 120000;
180 break;181 break;
181 }182 }
182 data->vcnl4200_al.last_measurement = ktime_set(0, 0);183 data->vcnl4200_al.last_measurement = ktime_set(0, 0);
drivers/irqchip/irq-ingenic.c+2−4
@@ -17,7 +17,6 @@ · 16 unmodified lines
17#include <linux/delay.h>17#include <linux/delay.h>
18 18
19#include <asm/io.h>19#include <asm/io.h>
20#include <asm/mach-jz4740/irq.h>
21 20
22struct ingenic_intc_data {21struct ingenic_intc_data {
23 void __iomem *base;22 void __iomem *base;
@@ -50,7 +49,7 @@ static irqreturn_t intc_cascade(int irq, void *data) · 26 unmodified lines
50 while (pending) {49 while (pending) {
51 int bit = __fls(pending);50 int bit = __fls(pending);
52 51
53 irq = irq_find_mapping(domain, bit + (i * 32));52 irq = irq_linear_revmap(domain, bit + (i * 32));
54 generic_handle_irq(irq);53 generic_handle_irq(irq);
55 pending &= ~BIT(bit);54 pending &= ~BIT(bit);
56 }55 }
@@ -97,8 +96,7 @@ static int __init ingenic_intc_of_init(struct device_node *node, · 40 unmodified lines
97 goto out_unmap_irq;96 goto out_unmap_irq;
98 }97 }
99 98
100 domain = irq_domain_add_legacy(node, num_chips * 32,99 domain = irq_domain_add_linear(node, num_chips * 32,
101 JZ4740_IRQ_BASE, 0,
102 &irq_generic_chip_ops, NULL);100 &irq_generic_chip_ops, NULL);
103 if (!domain) {101 if (!domain) {
104 err = -ENOMEM;102 err = -ENOMEM;
drivers/md/dm-snap-persistent.c+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
17#include <linux/dm-bufio.h>17#include <linux/dm-bufio.h>
18 18
19#define DM_MSG_PREFIX "persistent snapshot"19#define DM_MSG_PREFIX "persistent snapshot"
20#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */20#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */
21 21
22#define DM_PREFETCH_CHUNKS 1222#define DM_PREFETCH_CHUNKS 12
23 23
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
87 char b[BDEVNAME_SIZE];87 char b[BDEVNAME_SIZE];
88 char b2[BDEVNAME_SIZE];88 char b2[BDEVNAME_SIZE];
89 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);89 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
90 unsigned short blksize = 512;90 unsigned blksize = 512;
91 91
92 *private_conf = ERR_PTR(-ENOMEM);92 *private_conf = ERR_PTR(-ENOMEM);
93 if (!conf)93 if (!conf)
drivers/message/fusion/mptctl.c+50−163
@@ -100,19 +100,19 @@ struct buflist { · 99 unmodified lines
100 * Function prototypes. Called from OS entry point mptctl_ioctl.100 * Function prototypes. Called from OS entry point mptctl_ioctl.
101 * arg contents specific to function.101 * arg contents specific to function.
102 */102 */
103static int mptctl_fw_download(unsigned long arg);103static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg);
104static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd);104static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
105static int mptctl_gettargetinfo(unsigned long arg);105static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg);
106static int mptctl_readtest(unsigned long arg);106static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg);
107static int mptctl_mpt_command(unsigned long arg);107static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg);
108static int mptctl_eventquery(unsigned long arg);108static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg);
109static int mptctl_eventenable(unsigned long arg);109static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg);
110static int mptctl_eventreport(unsigned long arg);110static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg);
111static int mptctl_replace_fw(unsigned long arg);111static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg);
112 112
113static int mptctl_do_reset(unsigned long arg);113static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg);
114static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);114static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
115static int mptctl_hp_targetinfo(unsigned long arg);115static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg);
116 116
117static int mptctl_probe(struct pci_dev *, const struct pci_device_id *);117static int mptctl_probe(struct pci_dev *, const struct pci_device_id *);
118static void mptctl_remove(struct pci_dev *);118static 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
123/*123/*
124 * Private function calls.124 * Private function calls.
125 */125 */
126static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);126static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr);
127static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);127static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen);
128static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,128static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,
129 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);129 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
130static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma,130static 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
656 * by TM and FW reloads.656 * by TM and FW reloads.
657 */657 */
658 if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) {658 if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) {
659 return mptctl_getiocinfo(arg, _IOC_SIZE(cmd));659 return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd));
660 } else if (cmd == MPTTARGETINFO) {660 } else if (cmd == MPTTARGETINFO) {
661 return mptctl_gettargetinfo(arg);661 return mptctl_gettargetinfo(iocp, arg);
662 } else if (cmd == MPTTEST) {662 } else if (cmd == MPTTEST) {
663 return mptctl_readtest(arg);663 return mptctl_readtest(iocp, arg);
664 } else if (cmd == MPTEVENTQUERY) {664 } else if (cmd == MPTEVENTQUERY) {
665 return mptctl_eventquery(arg);665 return mptctl_eventquery(iocp, arg);
666 } else if (cmd == MPTEVENTENABLE) {666 } else if (cmd == MPTEVENTENABLE) {
667 return mptctl_eventenable(arg);667 return mptctl_eventenable(iocp, arg);
668 } else if (cmd == MPTEVENTREPORT) {668 } else if (cmd == MPTEVENTREPORT) {
669 return mptctl_eventreport(arg);669 return mptctl_eventreport(iocp, arg);
670 } else if (cmd == MPTFWREPLACE) {670 } else if (cmd == MPTFWREPLACE) {
671 return mptctl_replace_fw(arg);671 return mptctl_replace_fw(iocp, arg);
672 }672 }
673 673
674 /* All of these commands require an interrupt or674 /* 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
678 return ret;678 return ret;
679 679
680 if (cmd == MPTFWDOWNLOAD)680 if (cmd == MPTFWDOWNLOAD)
681 ret = mptctl_fw_download(arg);681 ret = mptctl_fw_download(iocp, arg);
682 else if (cmd == MPTCOMMAND)682 else if (cmd == MPTCOMMAND)
683 ret = mptctl_mpt_command(arg);683 ret = mptctl_mpt_command(iocp, arg);
684 else if (cmd == MPTHARDRESET)684 else if (cmd == MPTHARDRESET)
685 ret = mptctl_do_reset(arg);685 ret = mptctl_do_reset(iocp, arg);
686 else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK))686 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));
688 else if (cmd == HP_GETTARGETINFO)688 else if (cmd == HP_GETTARGETINFO)
689 ret = mptctl_hp_targetinfo(arg);689 ret = mptctl_hp_targetinfo(iocp, arg);
690 else690 else
691 ret = -EINVAL;691 ret = -EINVAL;
692 692
@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 12 unmodified lines
705 return ret;705 return ret;
706}706}
707 707
708static int mptctl_do_reset(unsigned long arg)708static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg)
709{709{
710 struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg;710 struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg;
711 struct mpt_ioctl_diag_reset krinfo;711 struct mpt_ioctl_diag_reset krinfo;
712 MPT_ADAPTER *iocp;
713 712
714 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {713 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {
715 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - "714 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - "
@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) · 2 unmodified lines
718 return -EFAULT;717 return -EFAULT;
719 }718 }
720 719
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
727 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n",720 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n",
728 iocp->name));721 iocp->name));
729 722
@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) · 24 unmodified lines
754 * -ENOMSG if FW upload returned bad status747 * -ENOMSG if FW upload returned bad status
755 */748 */
756static int749static int
757mptctl_fw_download(unsigned long arg)750mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg)
758{751{
759 struct mpt_fw_xfer __user *ufwdl = (void __user *) arg;752 struct mpt_fw_xfer __user *ufwdl = (void __user *) arg;
760 struct mpt_fw_xfer kfwdl;753 struct mpt_fw_xfer kfwdl;
@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) · 5 unmodified lines
766 return -EFAULT;759 return -EFAULT;
767 }760 }
768 761
769 return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen);762 return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen);
770}763}
771 764
772/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/765/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) · 11 unmodified lines
784 * -ENOMSG if FW upload returned bad status777 * -ENOMSG if FW upload returned bad status
785 */778 */
786static int779static int
787mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)780mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen)
788{781{
789 FWDownload_t *dlmsg;782 FWDownload_t *dlmsg;
790 MPT_FRAME_HDR *mf;783 MPT_FRAME_HDR *mf;
791 MPT_ADAPTER *iocp;
792 FWDownloadTCSGE_t *ptsge;784 FWDownloadTCSGE_t *ptsge;
793 MptSge_t *sgl, *sgIn;785 MptSge_t *sgl, *sgIn;
794 char *sgOut;786 char *sgOut;
@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) · 13 unmodified lines
808 pFWDownloadReply_t ReplyMsg = NULL;800 pFWDownloadReply_t ReplyMsg = NULL;
809 unsigned long timeleft;801 unsigned long timeleft;
810 802
811 if (mpt_verify_adapter(ioc, &iocp) < 0) {803 /* Valid device. Get a message frame and construct the FW download message.
812 printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n",804 */
813 ioc);805 if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
814 return -ENODEV; /* (-6) No such device or address */806 return -EAGAIN;
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 }
822 807
823 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT808 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT
824 "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id));809 "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
826 iocp->name, ufwbuf));811 iocp->name, ufwbuf));
827 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n",812 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n",
828 iocp->name, (int)fwlen));813 iocp->name, (int)fwlen));
829 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n",
830 iocp->name, ioc));
831 814
832 dlmsg = (FWDownload_t*) mf;815 dlmsg = (FWDownload_t*) mf;
833 ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;816 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
1238 * -ENODEV if no such device/adapter1221 * -ENODEV if no such device/adapter
1239 */1222 */
1240static int1223static int
1241mptctl_getiocinfo (unsigned long arg, unsigned int data_size)1224mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
1242{1225{
1243 struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg;1226 struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg;
1244 struct mpt_ioctl_iocinfo *karg;1227 struct mpt_ioctl_iocinfo *karg;
1245 MPT_ADAPTER *ioc;
1246 struct pci_dev *pdev;1228 struct pci_dev *pdev;
1247 int iocnum;
1248 unsigned int port;1229 unsigned int port;
1249 int cim_rev;1230 int cim_rev;
1250 struct scsi_device *sdev;1231 struct scsi_device *sdev;
@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) · 21 unmodified lines
1272 return PTR_ERR(karg);1253 return PTR_ERR(karg);
1273 }1254 }
1274 1255
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
1283 /* Verify the data transfer size is correct. */1256 /* Verify the data transfer size is correct. */
1284 if (karg->hdr.maxDataSize != data_size) {1257 if (karg->hdr.maxDataSize != data_size) {
1285 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - "1258 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
1385 * -ENODEV if no such device/adapter1358 * -ENODEV if no such device/adapter
1386 */1359 */
1387static int1360static int
1388mptctl_gettargetinfo (unsigned long arg)1361mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
1389{1362{
1390 struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;1363 struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;
1391 struct mpt_ioctl_targetinfo karg;1364 struct mpt_ioctl_targetinfo karg;
1392 MPT_ADAPTER *ioc;
1393 VirtDevice *vdevice;1365 VirtDevice *vdevice;
1394 char *pmem;1366 char *pmem;
1395 int *pdata;1367 int *pdata;
1396 int iocnum;
1397 int numDevices = 0;1368 int numDevices = 0;
1398 int lun;1369 int lun;
1399 int maxWordsLeft;1370 int maxWordsLeft;
@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) · 8 unmodified lines
1408 return -EFAULT;1379 return -EFAULT;
1409 }1380 }
1410 1381
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
1418 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",1382 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",
1419 ioc->name));1383 ioc->name));
1420 /* Get the port number and set the maximum number of bytes1384 /* Get the port number and set the maximum number of bytes
@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) · 89 unmodified lines
1510 * -ENODEV if no such device/adapter1474 * -ENODEV if no such device/adapter
1511 */1475 */
1512static int1476static int
1513mptctl_readtest (unsigned long arg)1477mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
1514{1478{
1515 struct mpt_ioctl_test __user *uarg = (void __user *) arg;1479 struct mpt_ioctl_test __user *uarg = (void __user *) arg;
1516 struct mpt_ioctl_test karg;1480 struct mpt_ioctl_test karg;
1517 MPT_ADAPTER *ioc;
1518 int iocnum;
1519 1481
1520 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {1482 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
1521 printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "1483 printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "
@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) · 2 unmodified lines
1524 return -EFAULT;1486 return -EFAULT;
1525 }1487 }
1526 1488
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
1534 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n",1489 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n",
1535 ioc->name));1490 ioc->name));
1536 /* Fill in the data and return the structure to the calling1491 /* Fill in the data and return the structure to the calling
@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) · 34 unmodified lines
1571 * -ENODEV if no such device/adapter1526 * -ENODEV if no such device/adapter
1572 */1527 */
1573static int1528static int
1574mptctl_eventquery (unsigned long arg)1529mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg)
1575{1530{
1576 struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg;1531 struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg;
1577 struct mpt_ioctl_eventquery karg;1532 struct mpt_ioctl_eventquery karg;
1578 MPT_ADAPTER *ioc;
1579 int iocnum;
1580 1533
1581 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {1534 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {
1582 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - "1535 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - "
@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) · 2 unmodified lines
1585 return -EFAULT;1538 return -EFAULT;
1586 }1539 }
1587 1540
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
1595 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n",1541 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n",
1596 ioc->name));1542 ioc->name));
1597 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;1543 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) · 12 unmodified lines
1610 1556
1611/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/1557/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1612static int1558static int
1613mptctl_eventenable (unsigned long arg)1559mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg)
1614{1560{
1615 struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg;1561 struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg;
1616 struct mpt_ioctl_eventenable karg;1562 struct mpt_ioctl_eventenable karg;
1617 MPT_ADAPTER *ioc;
1618 int iocnum;
1619 1563
1620 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {1564 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {
1621 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - "1565 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - "
@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) · 2 unmodified lines
1624 return -EFAULT;1568 return -EFAULT;
1625 }1569 }
1626 1570
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
1634 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n",1571 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n",
1635 ioc->name));1572 ioc->name));
1636 if (ioc->events == NULL) {1573 if (ioc->events == NULL) {
@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) · 21 unmodified lines
1658 1595
1659/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/1596/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1660static int1597static int
1661mptctl_eventreport (unsigned long arg)1598mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg)
1662{1599{
1663 struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;1600 struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
1664 struct mpt_ioctl_eventreport karg;1601 struct mpt_ioctl_eventreport karg;
1665 MPT_ADAPTER *ioc;
1666 int iocnum;
1667 int numBytes, maxEvents, max;1602 int numBytes, maxEvents, max;
1668 1603
1669 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {1604 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) · 3 unmodified lines
1673 return -EFAULT;1608 return -EFAULT;
1674 }1609 }
1675 1610
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 }
1682 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n",1611 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n",
1683 ioc->name));1612 ioc->name));
1684 1613
@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) · 27 unmodified lines
1712 1641
1713/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/1642/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1714static int1643static int
1715mptctl_replace_fw (unsigned long arg)1644mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg)
1716{1645{
1717 struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg;1646 struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg;
1718 struct mpt_ioctl_replace_fw karg;1647 struct mpt_ioctl_replace_fw karg;
1719 MPT_ADAPTER *ioc;
1720 int iocnum;
1721 int newFwSize;1648 int newFwSize;
1722 1649
1723 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {1650 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
1727 return -EFAULT;1654 return -EFAULT;
1728 }1655 }
1729 1656
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
1737 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n",1657 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n",
1738 ioc->name));1658 ioc->name));
1739 /* If caching FW, Free the old FW image1659 /* If caching FW, Free the old FW image
@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) · 40 unmodified lines
1780 * -ENOMEM if memory allocation error1700 * -ENOMEM if memory allocation error
1781 */1701 */
1782static int1702static int
1783mptctl_mpt_command (unsigned long arg)1703mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg)
1784{1704{
1785 struct mpt_ioctl_command __user *uarg = (void __user *) arg;1705 struct mpt_ioctl_command __user *uarg = (void __user *) arg;
1786 struct mpt_ioctl_command karg;1706 struct mpt_ioctl_command karg;
1787 MPT_ADAPTER *ioc;
1788 int iocnum;
1789 int rc;1707 int rc;
1790 1708
1791 1709
@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) · 4 unmodified lines
1796 return -EFAULT;1714 return -EFAULT;
1797 }1715 }
1798 1716
1799 if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||1717 rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF);
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);
1807 1718
1808 return rc;1719 return rc;
1809}1720}
@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) · 11 unmodified lines
1821 * -EPERM if SCSI I/O and target is untagged1732 * -EPERM if SCSI I/O and target is untagged
1822 */1733 */
1823static int1734static int
1824mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)1735mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr)
1825{1736{
1826 MPT_ADAPTER *ioc;
1827 MPT_FRAME_HDR *mf = NULL;1737 MPT_FRAME_HDR *mf = NULL;
1828 MPIHeader_t *hdr;1738 MPIHeader_t *hdr;
1829 char *psge;1739 char *psge;
@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 2 unmodified lines
1832 dma_addr_t dma_addr_in;1742 dma_addr_t dma_addr_in;
1833 dma_addr_t dma_addr_out;1743 dma_addr_t dma_addr_out;
1834 int sgSize = 0; /* Num SG elements */1744 int sgSize = 0; /* Num SG elements */
1835 int iocnum, flagsLength;1745 int flagsLength;
1836 int sz, rc = 0;1746 int sz, rc = 0;
1837 int msgContext;1747 int msgContext;
1838 u16 req_idx;1748 u16 req_idx;
@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 8 unmodified lines
1847 bufIn.kptr = bufOut.kptr = NULL;1757 bufIn.kptr = bufOut.kptr = NULL;
1848 bufIn.len = bufOut.len = 0;1758 bufIn.len = bufOut.len = 0;
1849 1759
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
1857 spin_lock_irqsave(&ioc->taskmgmt_lock, flags);1760 spin_lock_irqsave(&ioc->taskmgmt_lock, flags);
1858 if (ioc->ioc_reset_in_progress) {1761 if (ioc->ioc_reset_in_progress) {
1859 spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags);1762 spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags);
@@ -2418,17 +2321,15 @@ done_free_mem: · 558 unmodified lines
2418 * -ENOMEM if memory allocation error2321 * -ENOMEM if memory allocation error
2419 */2322 */
2420static int2323static int
2421mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)2324mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
2422{2325{
2423 hp_host_info_t __user *uarg = (void __user *) arg;2326 hp_host_info_t __user *uarg = (void __user *) arg;
2424 MPT_ADAPTER *ioc;
2425 struct pci_dev *pdev;2327 struct pci_dev *pdev;
2426 char *pbuf=NULL;2328 char *pbuf=NULL;
2427 dma_addr_t buf_dma;2329 dma_addr_t buf_dma;
2428 hp_host_info_t karg;2330 hp_host_info_t karg;
2429 CONFIGPARMS cfg;2331 CONFIGPARMS cfg;
2430 ConfigPageHeader_t hdr;2332 ConfigPageHeader_t hdr;
2431 int iocnum;
2432 int rc, cim_rev;2333 int rc, cim_rev;
2433 ToolboxIstwiReadWriteRequest_t *IstwiRWRequest;2334 ToolboxIstwiReadWriteRequest_t *IstwiRWRequest;
2434 MPT_FRAME_HDR *mf = NULL;2335 MPT_FRAME_HDR *mf = NULL;
@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) · 17 unmodified lines
2452 return -EFAULT;2353 return -EFAULT;
2453 }2354 }
2454 2355
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 }
2461 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n",2356 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n",
2462 ioc->name));2357 ioc->name));
2463 2358
@@ -2659,15 +2554,13 @@ retry_wait: · 195 unmodified lines
2659 * -ENOMEM if memory allocation error2554 * -ENOMEM if memory allocation error
2660 */2555 */
2661static int2556static int
2662mptctl_hp_targetinfo(unsigned long arg)2557mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg)
2663{2558{
2664 hp_target_info_t __user *uarg = (void __user *) arg;2559 hp_target_info_t __user *uarg = (void __user *) arg;
2665 SCSIDevicePage0_t *pg0_alloc;2560 SCSIDevicePage0_t *pg0_alloc;
2666 SCSIDevicePage3_t *pg3_alloc;2561 SCSIDevicePage3_t *pg3_alloc;
2667 MPT_ADAPTER *ioc;
2668 MPT_SCSI_HOST *hd = NULL;2562 MPT_SCSI_HOST *hd = NULL;
2669 hp_target_info_t karg;2563 hp_target_info_t karg;
2670 int iocnum;
2671 int data_sz;2564 int data_sz;
2672 dma_addr_t page_dma;2565 dma_addr_t page_dma;
2673 CONFIGPARMS cfg;2566 CONFIGPARMS cfg;
@@ -2681,12 +2574,6 @@ mptctl_hp_targetinfo(unsigned long arg) · 7 unmodified lines
2681 return -EFAULT;2574 return -EFAULT;
2682 }2575 }
2683 2576
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 }
2690 if (karg.hdr.id >= MPT_MAX_FC_DEVICES)2577 if (karg.hdr.id >= MPT_MAX_FC_DEVICES)
2691 return -EINVAL;2578 return -EINVAL;
2692 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n",2579 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
2854 kfw.fwlen = kfw32.fwlen;2741 kfw.fwlen = kfw32.fwlen;
2855 kfw.bufp = compat_ptr(kfw32.bufp);2742 kfw.bufp = compat_ptr(kfw32.bufp);
2856 2743
2857 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);2744 ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen);
2858 2745
2859 mutex_unlock(&iocp->ioctl_cmds.mutex);2746 mutex_unlock(&iocp->ioctl_cmds.mutex);
2860 2747
@@ -2908,7 +2795,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, · 47 unmodified lines
2908 2795
2909 /* Pass new structure to do_mpt_command2796 /* Pass new structure to do_mpt_command
2910 */2797 */
2911 ret = mptctl_do_mpt_command (karg, &uarg->MF);2798 ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF);
2912 2799
2913 mutex_unlock(&iocp->ioctl_cmds.mutex);2800 mutex_unlock(&iocp->ioctl_cmds.mutex);
2914 2801
drivers/misc/enclosure.c+1−2
@@ -406,10 +406,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) · 405 unmodified lines
406 cdev = &edev->component[i];406 cdev = &edev->component[i];
407 if (cdev->dev == dev) {407 if (cdev->dev == dev) {
408 enclosure_remove_links(cdev);408 enclosure_remove_links(cdev);
409 device_del(&cdev->cdev);
410 put_device(dev);409 put_device(dev);
411 cdev->dev = NULL;410 cdev->dev = NULL;
412 return device_add(&cdev->cdev);411 return 0;
413 }412 }
414 }413 }
415 return -ENODEV;414 return -ENODEV;
drivers/misc/lkdtm/bugs.c+7−5
@@ -278,7 +278,7 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void) · 277 unmodified lines
278 278
279void lkdtm_UNSET_SMEP(void)279void lkdtm_UNSET_SMEP(void)
280{280{
281#ifdef CONFIG_X86_64281#if IS_ENABLED(CONFIG_X86_64) && !IS_ENABLED(CONFIG_UML)
282#define MOV_CR4_DEPTH 64282#define MOV_CR4_DEPTH 64
283 void (*direct_write_cr4)(unsigned long val);283 void (*direct_write_cr4)(unsigned long val);
284 unsigned char *insn;284 unsigned char *insn;
@@ -338,13 +338,13 @@ void lkdtm_UNSET_SMEP(void) · 53 unmodified lines
338 native_write_cr4(cr4);338 native_write_cr4(cr4);
339 }339 }
340#else340#else
341 pr_err("FAIL: this test is x86_64-only\n");341 pr_err("XFAIL: this test is x86_64-only\n");
342#endif342#endif
343}343}
344 344
345#ifdef CONFIG_X86_32
346void lkdtm_DOUBLE_FAULT(void)345void lkdtm_DOUBLE_FAULT(void)
347{346{
347#ifdef CONFIG_X86_32
348 /*348 /*
349 * Trigger #DF by setting the stack limit to zero. This clobbers349 * Trigger #DF by setting the stack limit to zero. This clobbers
350 * a GDT TLS slot, which is okay because the current task will die350 * 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
373 asm volatile ("movw %0, %%ss; addl $0, (%%esp)" ::373 asm volatile ("movw %0, %%ss; addl $0, (%%esp)" ::
374 "r" ((unsigned short)(GDT_ENTRY_TLS_MIN << 3)));374 "r" ((unsigned short)(GDT_ENTRY_TLS_MIN << 3)));
375 375
376 panic("tried to double fault but didn't die\n");376 pr_err("FAIL: tried to double fault but didn't die\n");
377}377#else
378 pr_err("XFAIL: this test is ia32-only\n");
378#endif379#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
148 struct resources *r = &this->resources;148 struct resources *r = &this->resources;
149 int ret;149 int ret;
150 150
151 ret = pm_runtime_get_sync(this->dev);
152 if (ret < 0)
153 return ret;
154
151 ret = gpmi_reset_block(r->gpmi_regs, false);155 ret = gpmi_reset_block(r->gpmi_regs, false);
152 if (ret)156 if (ret)
153 goto err_out;157 goto err_out;
@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this) · 25 unmodified lines
179 */183 */
180 writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);184 writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
181 185
182 return 0;
183err_out:186err_out:
187 pm_runtime_mark_last_busy(this->dev);
188 pm_runtime_put_autosuspend(this->dev);
184 return ret;189 return ret;
185}190}
186 191
@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev) · 2535 unmodified lines
2722 return ret;2727 return ret;
2723 }2728 }
2724 2729
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
2725 /* re-init the BCH registers */2734 /* re-init the BCH registers */
2726 ret = bch_set_geometry(this);2735 ret = bch_set_geometry(this);
2727 if (ret) {2736 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
2124 if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)2124 if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)
2125 return 0;2125 return 0;
2126 2126
2127 nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1;
2128
2127 return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);2129 return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);
2128}2130}
2129 2131
@@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor) · 2639 unmodified lines
4769 4771
4770static void spansion_post_sfdp_fixups(struct spi_nor *nor)4772static void spansion_post_sfdp_fixups(struct spi_nor *nor)
4771{4773{
4772 struct mtd_info *mtd = &nor->mtd;4774 if (nor->params.size <= SZ_16M)
4773
4774 if (mtd->size <= SZ_16M)
4775 return;4775 return;
4776 4776
4777 nor->flags |= SNOR_F_4B_OPCODES;4777 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
68 68
69 /* Force link status for IMP port */69 /* Force link status for IMP port */
70 reg = core_readl(priv, offset);70 reg = core_readl(priv, offset);
71 reg |= (MII_SW_OR | LINK_STS);71 reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
72 core_writel(priv, reg, offset);72 core_writel(priv, reg, offset);
73 73
74 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */74 /* 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
582 struct device *dev = &priv->spidev->dev;582 struct device *dev = &priv->spidev->dev;
583 struct device_node *child;583 struct device_node *child;
584 584
585 for_each_child_of_node(ports_node, child) {585 for_each_available_child_of_node(ports_node, child) {
586 struct device_node *phy_node;586 struct device_node *phy_node;
587 phy_interface_t phy_mode;587 phy_interface_t phy_mode;
588 u32 index;588 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
2323 ring->switch_queue = qp;2323 ring->switch_queue = qp;
2324 ring->switch_port = port;2324 ring->switch_port = port;
2325 ring->inspect = true;2325 ring->inspect = true;
2326 priv->ring_map[q + port * num_tx_queues] = ring;2326 priv->ring_map[qp + port * num_tx_queues] = ring;
2327 qp++;2327 qp++;
2328 }2328 }
2329 2329
@@ -2338,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 8 unmodified lines
2338 struct net_device *slave_dev;2338 struct net_device *slave_dev;
2339 unsigned int num_tx_queues;2339 unsigned int num_tx_queues;
2340 struct net_device *dev;2340 struct net_device *dev;
2341 unsigned int q, port;2341 unsigned int q, qp, port;
2342 2342
2343 priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);2343 priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
2344 if (priv->netdev != info->master)2344 if (priv->netdev != info->master)
@@ -2364,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 19 unmodified lines
2364 continue;2364 continue;
2365 2365
2366 ring->inspect = false;2366 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;
2368 }2369 }
2369 2370
2370 return 0;2371 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
11065 struct flow_keys *keys1 = &f1->fkeys;11065 struct flow_keys *keys1 = &f1->fkeys;
11066 struct flow_keys *keys2 = &f2->fkeys;11066 struct flow_keys *keys2 = &f2->fkeys;
11067 11067
11068 if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&11068 if (keys1->basic.n_proto != keys2->basic.n_proto ||
11069 keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&11069 keys1->basic.ip_proto != keys2->basic.ip_proto)
11070 keys1->ports.ports == keys2->ports.ports &&11070 return false;
11071 keys1->basic.ip_proto == keys2->basic.ip_proto &&11071
11072 keys1->basic.n_proto == keys2->basic.n_proto &&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 &&
11073 keys1->control.flags == keys2->control.flags &&11085 keys1->control.flags == keys2->control.flags &&
11074 ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&11086 ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
11075 ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))11087 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
11361 return -EOPNOTSUPP;11373 return -EOPNOTSUPP;
11362 11374
11363 /* The PF and it's VF-reps only support the switchdev framework */11375 /* 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))
11365 return -EOPNOTSUPP;11377 return -EOPNOTSUPP;
11366 11378
11367 ppid->id_len = sizeof(bp->switch_id);11379 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
11734 put_unaligned_le32(dw, &dsn[0]);11746 put_unaligned_le32(dw, &dsn[0]);
11735 pci_read_config_dword(pdev, pos + 4, &dw);11747 pci_read_config_dword(pdev, pos + 4, &dw);
11736 put_unaligned_le32(dw, &dsn[4]);11748 put_unaligned_le32(dw, &dsn[4]);
11749 bp->flags |= BNXT_FLAG_DSN_VALID;
11737 return 0;11750 return 0;
11738}11751}
11739 11752
@@ -11845,9 +11858,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 105 unmodified lines
11845 11858
11846 if (BNXT_PF(bp)) {11859 if (BNXT_PF(bp)) {
11847 /* Read the adapter's DSN to use as the eswitch switch_id */11860 /* Read the adapter's DSN to use as the eswitch switch_id */
11848 rc = bnxt_pcie_dsn_get(bp, bp->switch_id);11861 bnxt_pcie_dsn_get(bp, bp->switch_id);
11849 if (rc)
11850 goto init_err_pci_clean;
11851 }11862 }
11852 11863
11853 /* MTU range: 60 - FW defined max */11864 /* MTU range: 60 - FW defined max */
drivers/net/ethernet/broadcom/bnxt/bnxt.h+1−3
@@ -1532,6 +1532,7 @@ struct bnxt { · 1531 unmodified lines
1532 #define BNXT_FLAG_NO_AGG_RINGS 0x200001532 #define BNXT_FLAG_NO_AGG_RINGS 0x20000
1533 #define BNXT_FLAG_RX_PAGE_MODE 0x400001533 #define BNXT_FLAG_RX_PAGE_MODE 0x40000
1534 #define BNXT_FLAG_MULTI_HOST 0x1000001534 #define BNXT_FLAG_MULTI_HOST 0x100000
1535 #define BNXT_FLAG_DSN_VALID 0x200000
1535 #define BNXT_FLAG_DOUBLE_DB 0x4000001536 #define BNXT_FLAG_DOUBLE_DB 0x400000
1536 #define BNXT_FLAG_CHIP_NITRO_A0 0x10000001537 #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
1537 #define BNXT_FLAG_DIM 0x20000001538 #define BNXT_FLAG_DIM 0x2000000
@@ -1936,9 +1937,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type) · 398 unmodified lines
1936 case HWRM_CFA_ENCAP_RECORD_FREE:1937 case HWRM_CFA_ENCAP_RECORD_FREE:
1937 case HWRM_CFA_DECAP_FILTER_ALLOC:1938 case HWRM_CFA_DECAP_FILTER_ALLOC:
1938 case HWRM_CFA_DECAP_FILTER_FREE:1939 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:
1942 case HWRM_CFA_EM_FLOW_ALLOC:1940 case HWRM_CFA_EM_FLOW_ALLOC:
1943 case HWRM_CFA_EM_FLOW_FREE:1941 case HWRM_CFA_EM_FLOW_FREE:
1944 case HWRM_CFA_EM_FLOW_CFG:1942 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
398 struct net_device *dev;398 struct net_device *dev;
399 int rc, i;399 int rc, i;
400 400
401 if (!(bp->flags & BNXT_FLAG_DSN_VALID))
402 return -ENODEV;
403
401 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);404 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);
402 if (!bp->vf_reps)405 if (!bp->vf_reps)
403 return -ENOMEM;406 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
611 .mac_link_up = macb_mac_link_up,611 .mac_link_up = macb_mac_link_up,
612};612};
613 613
614static 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
614static int macb_phylink_connect(struct macb *bp)621static int macb_phylink_connect(struct macb *bp)
615{622{
623 struct device_node *dn = bp->pdev->dev.of_node;
616 struct net_device *dev = bp->dev;624 struct net_device *dev = bp->dev;
617 struct phy_device *phydev;625 struct phy_device *phydev;
618 int ret;626 int ret;
619 627
620 if (bp->pdev->dev.of_node &&628 if (dn)
621 of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) {629 ret = phylink_of_phy_connect(bp->phylink, dn, 0);
622 ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node,630
623 0);631 if (!dn || (ret && !macb_phy_handle_exists(dn))) {
624 if (ret) {
625 netdev_err(dev, "Could not attach PHY (%d)\n", ret);
626 return ret;
627 }
628 } else {
629 phydev = phy_find_first(bp->mii_bus);632 phydev = phy_find_first(bp->mii_bus);
630 if (!phydev) {633 if (!phydev) {
631 netdev_err(dev, "no PHY found\n");634 netdev_err(dev, "no PHY found\n");
@@ -634,10 +637,11 @@ static int macb_phylink_connect(struct macb *bp) · 2 unmodified lines
634 637
635 /* attach the mac to the phy */638 /* attach the mac to the phy */
636 ret = phylink_connect_phy(bp->phylink, phydev);639 ret = phylink_connect_phy(bp->phylink, phydev);
637 if (ret) {640 }
638 netdev_err(dev, "Could not attach to PHY (%d)\n", ret);641
639 return ret;642 if (ret) {
640 }643 netdev_err(dev, "Could not attach PHY (%d)\n", ret);
644 return ret;
641 }645 }
642 646
643 phylink_start(bp->phylink);647 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
3135{3135{
3136 struct port_info *pi = netdev_priv(dev);3136 struct port_info *pi = netdev_priv(dev);
3137 struct adapter *adap = pi->adapter;3137 struct adapter *adap = pi->adapter;
3138 struct ch_sched_queue qe = { 0 };
3139 struct ch_sched_params p = { 0 };
3138 struct sched_class *e;3140 struct sched_class *e;
3139 struct ch_sched_params p;
3140 struct ch_sched_queue qe;
3141 u32 req_rate;3141 u32 req_rate;
3142 int err = 0;3142 int err = 0;
3143 3143
@@ -3154,6 +3154,15 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 10 unmodified lines
3154 return -EINVAL;3154 return -EINVAL;
3155 }3155 }
3156 3156
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
3157 /* Convert from Mbps to Kbps */3166 /* Convert from Mbps to Kbps */
3158 req_rate = rate * 1000;3167 req_rate = rate * 1000;
3159 3168
@@ -3183,7 +3192,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 23 unmodified lines
3183 return 0;3192 return 0;
3184 3193
3185 /* Fetch any available unused or matching scheduling class */3194 /* Fetch any available unused or matching scheduling class */
3186 memset(&p, 0, sizeof(p));
3187 p.type = SCHED_CLASS_TYPE_PACKET;3195 p.type = SCHED_CLASS_TYPE_PACKET;
3188 p.u.params.level = SCHED_CLASS_LEVEL_CL_RL;3196 p.u.params.level = SCHED_CLASS_LEVEL_CL_RL;
3189 p.u.params.mode = SCHED_CLASS_MODE_CLASS;3197 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
15 struct flow_action *actions = &cls->rule->action;15 struct flow_action *actions = &cls->rule->action;
16 struct port_info *pi = netdev2pinfo(dev);16 struct port_info *pi = netdev2pinfo(dev);
17 struct flow_action_entry *entry;17 struct flow_action_entry *entry;
18 struct ch_sched_queue qe;
19 struct sched_class *e;
18 u64 max_link_rate;20 u64 max_link_rate;
19 u32 i, speed;21 u32 i, speed;
20 int ret;22 int ret;
@@ -60,9 +62,61 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev, · 39 unmodified lines
60 }62 }
61 }63 }
62 64
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
63 return 0;77 return 0;
64}78}
65 79
80static 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
97out_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
107static 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
66static int cxgb4_matchall_alloc_tc(struct net_device *dev,120static int cxgb4_matchall_alloc_tc(struct net_device *dev,
67 struct tc_cls_matchall_offload *cls)121 struct tc_cls_matchall_offload *cls)
68{122{
@@ -83,6 +137,7 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev, · 14 unmodified lines
83 struct adapter *adap = netdev2adap(dev);137 struct adapter *adap = netdev2adap(dev);
84 struct flow_action_entry *entry;138 struct flow_action_entry *entry;
85 struct sched_class *e;139 struct sched_class *e;
140 int ret;
86 u32 i;141 u32 i;
87 142
88 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];143 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
101 return -ENOMEM;156 return -ENOMEM;
102 }157 }
103 158
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
104 tc_port_matchall->egress.hwtc = e->idx;166 tc_port_matchall->egress.hwtc = e->idx;
105 tc_port_matchall->egress.cookie = cls->cookie;167 tc_port_matchall->egress.cookie = cls->cookie;
106 tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED;168 tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED;
107 return 0;169 return 0;
170
171out_free:
172 cxgb4_sched_class_free(dev, e->idx);
173 return ret;
108}174}
109 175
110static void cxgb4_matchall_free_tc(struct net_device *dev)176static 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
114 struct adapter *adap = netdev2adap(dev);180 struct adapter *adap = netdev2adap(dev);
115 181
116 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];182 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];
183 cxgb4_matchall_tc_unbind_queues(dev);
117 cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc);184 cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc);
118 185
119 tc_port_matchall->egress.hwtc = SCHED_CLS_NONE;186 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
12 struct port_info *pi = netdev2pinfo(dev);12 struct port_info *pi = netdev2pinfo(dev);
13 struct adapter *adap = netdev2adap(dev);13 struct adapter *adap = netdev2adap(dev);
14 u32 speed, qcount = 0, qoffset = 0;14 u32 speed, qcount = 0, qoffset = 0;
15 u32 start_a, start_b, end_a, end_b;
15 int ret;16 int ret;
16 u8 i;17 u8 i, j;
17 18
18 if (!mqprio->qopt.num_tc)19 if (!mqprio->qopt.num_tc)
19 return 0;20 return 0;
@@ -47,6 +48,31 @@ static int cxgb4_mqprio_validate(struct net_device *dev, · 27 unmodified lines
47 qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset);48 qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset);
48 qcount += mqprio->qopt.count[i];49 qcount += mqprio->qopt.count[i];
49 50
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
50 /* Convert byte per second to bits per second */76 /* Convert byte per second to bits per second */
51 min_rate += (mqprio->min_rate[i] * 8);77 min_rate += (mqprio->min_rate[i] * 8);
52 max_rate += (mqprio->max_rate[i] * 8);78 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
165 return found;165 return found;
166}166}
167 167
168struct 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
168static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p)184static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p)
169{185{
170 struct sched_queue_entry *qe = NULL;186 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
103 return true;103 return true;
104}104}
105 105
106struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev,
107 struct ch_sched_queue *p);
106int cxgb4_sched_class_bind(struct net_device *dev, void *arg,108int cxgb4_sched_class_bind(struct net_device *dev, void *arg,
107 enum sched_bind_type type);109 enum sched_bind_type type);
108int cxgb4_sched_class_unbind(struct net_device *dev, void *arg,110int 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
565 skb = *out_skb = napi_alloc_skb(&ring_data->napi,565 skb = *out_skb = napi_alloc_skb(&ring_data->napi,
566 HNS_RX_HEAD_SIZE);566 HNS_RX_HEAD_SIZE);
567 if (unlikely(!skb)) {567 if (unlikely(!skb)) {
568 netdev_err(ndev, "alloc rx skb fail\n");
569 ring->stats.sw_err_cnt++;568 ring->stats.sw_err_cnt++;
570 return -ENOMEM;569 return -ENOMEM;
571 }570 }
@@ -1056,7 +1055,6 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget) · 484 unmodified lines
1056 container_of(napi, struct hns_nic_ring_data, napi);1055 container_of(napi, struct hns_nic_ring_data, napi);
1057 struct hnae_ring *ring = ring_data->ring;1056 struct hnae_ring *ring = ring_data->ring;
1058 1057
1059try_again:
1060 clean_complete += ring_data->poll_one(1058 clean_complete += ring_data->poll_one(
1061 ring_data, budget - clean_complete,1059 ring_data, budget - clean_complete,
1062 ring_data->ex_process);1060 ring_data->ex_process);
@@ -1066,7 +1064,7 @@ try_again: · 3 unmodified lines
1066 napi_complete(napi);1064 napi_complete(napi);
1067 ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);1065 ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);
1068 } else {1066 } else {
1069 goto try_again;1067 return budget;
1070 }1068 }
1071 }1069 }
1072 1070
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
54#define HNS3_INNER_VLAN_TAG 154#define HNS3_INNER_VLAN_TAG 1
55#define HNS3_OUTER_VLAN_TAG 255#define HNS3_OUTER_VLAN_TAG 2
56 56
57#define HNS3_MIN_TX_LEN 33U
58
57/* hns3_pci_tbl - PCI Device ID Table59/* hns3_pci_tbl - PCI Device ID Table
58 *60 *
59 * Last entry must be all 0s61 * 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
1405 int bd_num = 0;1407 int bd_num = 0;
1406 int ret;1408 int ret;
1407 1409
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
1408 /* Prefetch the data used later */1414 /* Prefetch the data used later */
1409 prefetch(skb->data);1415 prefetch(skb->data);
1410 1416
drivers/net/ethernet/intel/e1000e/e1000.h+2−3
@@ -185,13 +185,12 @@ struct e1000_phy_regs { · 184 unmodified lines
185 185
186/* board specific private data structure */186/* board specific private data structure */
187struct e1000_adapter {187struct e1000_adapter {
188 struct timer_list watchdog_timer;
188 struct timer_list phy_info_timer;189 struct timer_list phy_info_timer;
189 struct timer_list blink_timer;190 struct timer_list blink_timer;
190 191
191 struct work_struct reset_task;192 struct work_struct reset_task;
192 struct delayed_work watchdog_task;193 struct work_struct watchdog_task;
193
194 struct workqueue_struct *e1000_workqueue;
195 194
196 const struct e1000_info *ei;195 const struct e1000_info *ei;
197 196
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
1780 }1780 }
1781 /* guard against interrupt when we're going down */1781 /* guard against interrupt when we're going down */
1782 if (!test_bit(__E1000_DOWN, &adapter->state))1782 if (!test_bit(__E1000_DOWN, &adapter->state))
1783 mod_delayed_work(adapter->e1000_workqueue,1783 mod_timer(&adapter->watchdog_timer, jiffies + 1);
1784 &adapter->watchdog_task, HZ);
1785 }1784 }
1786 1785
1787 /* Reset on uncorrectable ECC error */1786 /* Reset on uncorrectable ECC error */
@@ -1861,8 +1860,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) · 73 unmodified lines
1861 }1860 }
1862 /* guard against interrupt when we're going down */1861 /* guard against interrupt when we're going down */
1863 if (!test_bit(__E1000_DOWN, &adapter->state))1862 if (!test_bit(__E1000_DOWN, &adapter->state))
1864 mod_delayed_work(adapter->e1000_workqueue,1863 mod_timer(&adapter->watchdog_timer, jiffies + 1);
1865 &adapter->watchdog_task, HZ);
1866 }1864 }
1867 1865
1868 /* Reset on uncorrectable ECC error */1866 /* Reset on uncorrectable ECC error */
@@ -1907,8 +1905,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) · 38 unmodified lines
1907 hw->mac.get_link_status = true;1905 hw->mac.get_link_status = true;
1908 /* guard against interrupt when we're going down */1906 /* guard against interrupt when we're going down */
1909 if (!test_bit(__E1000_DOWN, &adapter->state))1907 if (!test_bit(__E1000_DOWN, &adapter->state))
1910 mod_delayed_work(adapter->e1000_workqueue,1908 mod_timer(&adapter->watchdog_timer, jiffies + 1);
1911 &adapter->watchdog_task, HZ);
1912 }1909 }
1913 1910
1914 if (!test_bit(__E1000_DOWN, &adapter->state))1911 if (!test_bit(__E1000_DOWN, &adapter->state))
@@ -4284,6 +4281,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset) · 2369 unmodified lines
4284 4281
4285 napi_synchronize(&adapter->napi);4282 napi_synchronize(&adapter->napi);
4286 4283
4284 del_timer_sync(&adapter->watchdog_timer);
4287 del_timer_sync(&adapter->phy_info_timer);4285 del_timer_sync(&adapter->phy_info_timer);
4288 4286
4289 spin_lock(&adapter->stats64_lock);4287 spin_lock(&adapter->stats64_lock);
@@ -5155,11 +5153,25 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) · 865 unmodified lines
5155 }5153 }
5156}5154}
5157 5155
5156/**
5157 * e1000_watchdog - Timer Call-back
5158 * @data: pointer to adapter cast into an unsigned long
5159 **/
5160static 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
5158static void e1000_watchdog_task(struct work_struct *work)5170static void e1000_watchdog_task(struct work_struct *work)
5159{5171{
5160 struct e1000_adapter *adapter = container_of(work,5172 struct e1000_adapter *adapter = container_of(work,
5161 struct e1000_adapter,5173 struct e1000_adapter,
5162 watchdog_task.work);5174 watchdog_task);
5163 struct net_device *netdev = adapter->netdev;5175 struct net_device *netdev = adapter->netdev;
5164 struct e1000_mac_info *mac = &adapter->hw.mac;5176 struct e1000_mac_info *mac = &adapter->hw.mac;
5165 struct e1000_phy_info *phy = &adapter->hw.phy;5177 struct e1000_phy_info *phy = &adapter->hw.phy;
@@ -5407,9 +5419,8 @@ link_up: · 241 unmodified lines
5407 5419
5408 /* Reset the timer */5420 /* Reset the timer */
5409 if (!test_bit(__E1000_DOWN, &adapter->state))5421 if (!test_bit(__E1000_DOWN, &adapter->state))
5410 queue_delayed_work(adapter->e1000_workqueue,5422 mod_timer(&adapter->watchdog_timer,
5411 &adapter->watchdog_task,5423 round_jiffies(jiffies + 2 * HZ));
5412 round_jiffies(2 * HZ));
5413}5424}
5414 5425
5415#define E1000_TX_FLAGS_CSUM 0x000000015426#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
7449 goto err_eeprom;7460 goto err_eeprom;
7450 }7461 }
7451 7462
7452 adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,7463 timer_setup(&adapter->watchdog_timer, e1000_watchdog, 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
7464 timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);7464 timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);
7465 7465
7466 INIT_WORK(&adapter->reset_task, e1000_reset_task);7466 INIT_WORK(&adapter->reset_task, e1000_reset_task);
7467 INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
7467 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);7468 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
7468 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);7469 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
7469 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);7470 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
7557 return 0;7558 return 0;
7558 7559
7559err_register:7560err_register:
7560 flush_workqueue(adapter->e1000_workqueue);
7561 destroy_workqueue(adapter->e1000_workqueue);
7562err_workqueue:
7563 if (!(adapter->flags & FLAG_HAS_AMT))7561 if (!(adapter->flags & FLAG_HAS_AMT))
7564 e1000e_release_hw_control(adapter);7562 e1000e_release_hw_control(adapter);
7565err_eeprom:7563err_eeprom:
@@ -7604,17 +7602,15 @@ static void e1000_remove(struct pci_dev *pdev) · 38 unmodified lines
7604 * from being rescheduled.7602 * from being rescheduled.
7605 */7603 */
7606 set_bit(__E1000_DOWN, &adapter->state);7604 set_bit(__E1000_DOWN, &adapter->state);
7605 del_timer_sync(&adapter->watchdog_timer);
7607 del_timer_sync(&adapter->phy_info_timer);7606 del_timer_sync(&adapter->phy_info_timer);
7608 7607
7609 cancel_work_sync(&adapter->reset_task);7608 cancel_work_sync(&adapter->reset_task);
7609 cancel_work_sync(&adapter->watchdog_task);
7610 cancel_work_sync(&adapter->downshift_task);7610 cancel_work_sync(&adapter->downshift_task);
7611 cancel_work_sync(&adapter->update_phy_task);7611 cancel_work_sync(&adapter->update_phy_task);
7612 cancel_work_sync(&adapter->print_hang_task);7612 cancel_work_sync(&adapter->print_hang_task);
7613 7613
7614 cancel_delayed_work(&adapter->watchdog_task);
7615 flush_workqueue(adapter->e1000_workqueue);
7616 destroy_workqueue(adapter->e1000_workqueue);
7617
7618 if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {7614 if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
7619 cancel_work_sync(&adapter->tx_hwtstamp_work);7615 cancel_work_sync(&adapter->tx_hwtstamp_work);
7620 if (adapter->tx_hwtstamp_skb) {7616 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
536 (aq->api_maj_ver == 1 &&536 (aq->api_maj_ver == 1 &&
537 aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722))537 aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722))
538 hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE;538 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;
539 /* fall through */544 /* fall through */
540 default:545 default:
541 break;546 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
2321 return ret;2321 return ret;
2322}2322}
2323 2323
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 */
2330static 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
2324/**2340/**
2325 * i40e_vc_enable_queues_msg2341 * i40e_vc_enable_queues_msg
2326 * @vf: pointer to the VF info2342 * @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
2346 goto error_param;2362 goto error_param;
2347 }2363 }
2348 2364
2349 if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) {2365 if (i40e_vc_validate_vqs_bitmaps(vqs)) {
2350 aq_ret = I40E_ERR_PARAM;2366 aq_ret = I40E_ERR_PARAM;
2351 goto error_param;2367 goto error_param;
2352 }2368 }
@@ -2408,9 +2424,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) · 55 unmodified lines
2408 goto error_param;2424 goto error_param;
2409 }2425 }
2410 2426
2411 if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) ||2427 if (i40e_vc_validate_vqs_bitmaps(vqs)) {
2412 vqs->rx_queues > I40E_MAX_VF_QUEUES ||
2413 vqs->tx_queues > I40E_MAX_VF_QUEUES) {
2414 aq_ret = I40E_ERR_PARAM;2428 aq_ret = I40E_ERR_PARAM;
2415 goto error_param;2429 goto error_param;
2416 }2430 }
drivers/net/ethernet/intel/iavf/iavf.h+2−0
@@ -415,4 +415,6 @@ void iavf_enable_channels(struct iavf_adapter *adapter); · 414 unmodified lines
415void iavf_disable_channels(struct iavf_adapter *adapter);415void iavf_disable_channels(struct iavf_adapter *adapter);
416void iavf_add_cloud_filter(struct iavf_adapter *adapter);416void iavf_add_cloud_filter(struct iavf_adapter *adapter);
417void iavf_del_cloud_filter(struct iavf_adapter *adapter);417void iavf_del_cloud_filter(struct iavf_adapter *adapter);
418struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
419 const u8 *macaddr);
418#endif /* _IAVF_H_ */420#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
743 *743 *
744 * Returns ptr to the filter object or NULL when no memory available.744 * Returns ptr to the filter object or NULL when no memory available.
745 **/745 **/
746static struct746struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
747iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,747 const u8 *macaddr)
748 const u8 *macaddr)
749{748{
750 struct iavf_mac_filter *f;749 struct iavf_mac_filter *f;
751 750
@@ -2065,9 +2064,9 @@ static void iavf_reset_task(struct work_struct *work) · 1313 unmodified lines
2065 struct virtchnl_vf_resource *vfres = adapter->vf_res;2064 struct virtchnl_vf_resource *vfres = adapter->vf_res;
2066 struct net_device *netdev = adapter->netdev;2065 struct net_device *netdev = adapter->netdev;
2067 struct iavf_hw *hw = &adapter->hw;2066 struct iavf_hw *hw = &adapter->hw;
2067 struct iavf_mac_filter *f, *ftmp;
2068 struct iavf_vlan_filter *vlf;2068 struct iavf_vlan_filter *vlf;
2069 struct iavf_cloud_filter *cf;2069 struct iavf_cloud_filter *cf;
2070 struct iavf_mac_filter *f;
2071 u32 reg_val;2070 u32 reg_val;
2072 int i = 0, err;2071 int i = 0, err;
2073 bool running;2072 bool running;
@@ -2181,6 +2180,16 @@ continue_reset: · 107 unmodified lines
2181 2180
2182 spin_lock_bh(&adapter->mac_vlan_list_lock);2181 spin_lock_bh(&adapter->mac_vlan_list_lock);
2183 2182
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 }
2184 /* re-add all MAC filters */2193 /* re-add all MAC filters */
2185 list_for_each_entry(f, &adapter->mac_filter_list, list) {2194 list_for_each_entry(f, &adapter->mac_filter_list, list) {
2186 f->add = true;2195 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
1359 ether_addr_copy(netdev->perm_addr,1359 ether_addr_copy(netdev->perm_addr,
1360 adapter->hw.mac.addr);1360 adapter->hw.mac.addr);
1361 }1361 }
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);
1362 iavf_process_config(adapter);1365 iavf_process_config(adapter);
1363 }1366 }
1364 break;1367 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
530 dev_spec->module_plugged = true;530 dev_spec->module_plugged = true;
531 if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) {531 if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) {
532 hw->phy.media_type = e1000_media_type_internal_serdes;532 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) {
534 dev_spec->sgmii_active = true;534 dev_spec->sgmii_active = true;
535 hw->phy.media_type = e1000_media_type_internal_serdes;535 hw->phy.media_type = e1000_media_type_internal_serdes;
536 } else if (eth_flags->e1000_base_t) {536 } else if (eth_flags->e1000_base_t) {
@@ -657,14 +657,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) · 120 unmodified lines
657 break;657 break;
658 }658 }
659 659
660 /* do not change link mode for 100BaseFX */
661 if (dev_spec->eth_flags.e100_base_fx)
662 break;
663
664 /* change current link mode setting */660 /* change current link mode setting */
665 ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK;661 ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
666 662
667 if (hw->phy.media_type == e1000_media_type_copper)663 if (dev_spec->sgmii_active)
668 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII;664 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII;
669 else665 else
670 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;666 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
181 advertising &= ~ADVERTISED_1000baseKX_Full;181 advertising &= ~ADVERTISED_1000baseKX_Full;
182 }182 }
183 }183 }
184 if (eth_flags->e100_base_fx) {184 if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) {
185 supported |= SUPPORTED_100baseT_Full;185 supported |= SUPPORTED_100baseT_Full;
186 advertising |= ADVERTISED_100baseT_Full;186 advertising |= ADVERTISED_100baseT_Full;
187 }187 }
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
5239 struct ixgbe_hw *hw = &adapter->hw;5239 struct ixgbe_hw *hw = &adapter->hw;
5240 struct hlist_node *node2;5240 struct hlist_node *node2;
5241 struct ixgbe_fdir_filter *filter;5241 struct ixgbe_fdir_filter *filter;
5242 u64 action;5242 u8 queue;
5243 5243
5244 spin_lock(&adapter->fdir_perfect_lock);5244 spin_lock(&adapter->fdir_perfect_lock);
5245 5245
@@ -5248,17 +5248,34 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) · 2 unmodified lines
5248 5248
5249 hlist_for_each_entry_safe(filter, node2,5249 hlist_for_each_entry_safe(filter, node2,
5250 &adapter->fdir_filter_list, fdir_node) {5250 &adapter->fdir_filter_list, fdir_node) {
5251 action = filter->action;5251 if (filter->action == IXGBE_FDIR_DROP_QUEUE) {
5252 if (action != IXGBE_FDIR_DROP_QUEUE && action != 0)5252 queue = IXGBE_FDIR_DROP_QUEUE;
5253 action =5253 } else {
5254 (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1;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 }
5255 5276
5256 ixgbe_fdir_write_perfect_filter_82599(hw,5277 ixgbe_fdir_write_perfect_filter_82599(hw,
5257 &filter->filter,5278 &filter->filter, filter->sw_idx, queue);
5258 filter->sw_idx,
5259 (action == IXGBE_FDIR_DROP_QUEUE) ?
5260 IXGBE_FDIR_DROP_QUEUE :
5261 adapter->rx_ring[action]->reg_idx);
5262 }5279 }
5263 5280
5264 spin_unlock(&adapter->fdir_perfect_lock);5281 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
2081 struct ixgbe_hw *hw = &adapter->hw;2081 struct ixgbe_hw *hw = &adapter->hw;
2082 int count = 0;2082 int count = 0;
2083 2083
2084 if ((netdev_uc_count(netdev)) > 10) {
2085 pr_err("Too many unicast filters - No Space\n");
2086 return -ENOSPC;
2087 }
2088
2089 if (!netdev_uc_empty(netdev)) {2084 if (!netdev_uc_empty(netdev)) {
2090 struct netdev_hw_addr *ha;2085 struct netdev_hw_addr *ha;
2091 2086
drivers/net/ethernet/marvell/mvneta.c+10−9
@@ -2081,7 +2081,11 @@ static int · 2080 unmodified lines
2081mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,2081mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
2082 struct bpf_prog *prog, struct xdp_buff *xdp)2082 struct bpf_prog *prog, struct xdp_buff *xdp)
2083{2083{
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);
2085 2089
2086 switch (act) {2090 switch (act) {
2087 case XDP_PASS:2091 case XDP_PASS:
@@ -2094,9 +2098,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 6 unmodified lines
2094 if (err) {2098 if (err) {
2095 ret = MVNETA_XDP_DROPPED;2099 ret = MVNETA_XDP_DROPPED;
2096 __page_pool_put_page(rxq->page_pool,2100 __page_pool_put_page(rxq->page_pool,
2097 virt_to_head_page(xdp->data),2101 virt_to_head_page(xdp->data),
2098 xdp->data_end - xdp->data_hard_start,2102 len, true);
2099 true);
2100 } else {2103 } else {
2101 ret = MVNETA_XDP_REDIR;2104 ret = MVNETA_XDP_REDIR;
2102 }2105 }
@@ -2106,9 +2109,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 3 unmodified lines
2106 ret = mvneta_xdp_xmit_back(pp, xdp);2109 ret = mvneta_xdp_xmit_back(pp, xdp);
2107 if (ret != MVNETA_XDP_TX)2110 if (ret != MVNETA_XDP_TX)
2108 __page_pool_put_page(rxq->page_pool,2111 __page_pool_put_page(rxq->page_pool,
2109 virt_to_head_page(xdp->data),2112 virt_to_head_page(xdp->data),
2110 xdp->data_end - xdp->data_hard_start,2113 len, true);
2111 true);
2112 break;2114 break;
2113 default:2115 default:
2114 bpf_warn_invalid_xdp_action(act);2116 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
2119 case XDP_DROP:2121 case XDP_DROP:
2120 __page_pool_put_page(rxq->page_pool,2122 __page_pool_put_page(rxq->page_pool,
2121 virt_to_head_page(xdp->data),2123 virt_to_head_page(xdp->data),
2122 xdp->data_end - xdp->data_hard_start,2124 len, true);
2123 true);
2124 ret = MVNETA_XDP_DROPPED;2125 ret = MVNETA_XDP_DROPPED;
2125 break;2126 break;
2126 }2127 }
drivers/net/ethernet/mellanox/mlx4/crdump.c+1−1
@@ -182,7 +182,7 @@ int mlx4_crdump_collect(struct mlx4_dev *dev) · 181 unmodified lines
182 crdump_enable_crspace_access(dev, cr_space);182 crdump_enable_crspace_access(dev, cr_space);
183 183
184 /* Get the available snapshot ID for the dumps */184 /* Get the available snapshot ID for the dumps */
185 id = devlink_region_shapshot_id_get(devlink);185 id = devlink_region_snapshot_id_get(devlink);
186 186
187 /* Try to capture dumps */187 /* Try to capture dumps */
188 mlx4_crdump_collect_crspace(dev, cr_space, id);188 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
860 u64 len;860 u64 len;
861 int err;861 int err;
862 862
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
863 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));869 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
864 870
865 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info))871 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info))
866 return NETDEV_TX_BUSY;872 return NETDEV_TX_BUSY;
867 873
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
880 if (eth_skb_pad(skb)) {874 if (eth_skb_pad(skb)) {
881 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);875 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
882 return NETDEV_TX_OK;876 return NETDEV_TX_OK;
@@ -1215,6 +1209,9 @@ static void update_stats_cache(struct work_struct *work) · 332 unmodified lines
1215 periodic_hw_stats.update_dw.work);1209 periodic_hw_stats.update_dw.work);
1216 1210
1217 if (!netif_carrier_ok(mlxsw_sp_port->dev))1211 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 */
1218 goto out;1215 goto out;
1219 1216
1220 mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev,1217 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
4324 return 0;4321 return 0;
4325}4322}
4326 4323
4324static void
4325mlxsw_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
4327static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,4333static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
4328 char *pude_pl, void *priv)4334 char *pude_pl, void *priv)
4329{4335{
@@ -4345,6 +4351,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, · 15 unmodified lines
4345 } else {4351 } else {
4346 netdev_info(mlxsw_sp_port->dev, "link down\n");4352 netdev_info(mlxsw_sp_port->dev, "link down\n");
4347 netif_carrier_off(mlxsw_sp_port->dev);4353 netif_carrier_off(mlxsw_sp_port->dev);
4354 mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port);
4348 }4355 }
4349}4356}
4350 4357
@@ -5132,6 +5139,27 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core, · 781 unmodified lines
5132 return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);5139 return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
5133}5140}
5134 5141
5142static 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
5135static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)5163static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
5136{5164{
5137 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);5165 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
5634static struct mlxsw_driver mlxsw_sp3_driver = {5662static struct mlxsw_driver mlxsw_sp3_driver = {
5635 .kind = mlxsw_sp3_driver_name,5663 .kind = mlxsw_sp3_driver_name,
5636 .priv_size = sizeof(struct mlxsw_sp),5664 .priv_size = sizeof(struct mlxsw_sp),
5637 .init = mlxsw_sp2_init,5665 .init = mlxsw_sp3_init,
5638 .fini = mlxsw_sp_fini,5666 .fini = mlxsw_sp_fini,
5639 .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set,5667 .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set,
5640 .port_split = mlxsw_sp_port_split,5668 .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
195 return -EOPNOTSUPP;195 return -EOPNOTSUPP;
196}196}
197 197
198static u64
199mlxsw_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
205static u64
206mlxsw_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
198static void212static void
199mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats,213mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats,
200 u8 prio_bitmap, u64 *tx_packets,214 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
269 &stats_base->tx_bytes);283 &stats_base->tx_bytes);
270 red_base->prob_mark = xstats->ecn;284 red_base->prob_mark = xstats->ecn;
271 red_base->prob_drop = xstats->wred_drop[tclass_num];285 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);
273 287
274 stats_base->overlimits = red_base->prob_drop + red_base->prob_mark;288 stats_base->overlimits = red_base->prob_drop + red_base->prob_mark;
275 stats_base->drops = red_base->prob_drop + red_base->pdrop;289 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
370 384
371 early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop;385 early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop;
372 marks = xstats->ecn - xstats_base->prob_mark;386 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;
374 389
375 res->pdrop += pdrops;390 res->pdrop += pdrops;
376 res->prob_drop += early_drops;391 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
403 418
404 overlimits = xstats->wred_drop[tclass_num] + xstats->ecn -419 overlimits = xstats->wred_drop[tclass_num] + xstats->ecn -
405 stats_base->overlimits;420 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) -
407 stats_base->drops;423 stats_base->drops;
408 backlog = xstats->backlog[tclass_num];424 backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num);
409 425
410 _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets);426 _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets);
411 stats_ptr->qstats->overlimits += overlimits;427 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
576 tx_packets = stats->tx_packets - stats_base->tx_packets;592 tx_packets = stats->tx_packets - stats_base->tx_packets;
577 593
578 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {594 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
579 drops += xstats->tail_drop[i];595 drops += mlxsw_sp_xstats_tail_drop(xstats, i);
580 drops += xstats->wred_drop[i];596 drops += xstats->wred_drop[i];
581 backlog += xstats->backlog[i];597 backlog += mlxsw_sp_xstats_backlog(xstats, i);
582 }598 }
583 drops = drops - stats_base->drops;599 drops = drops - stats_base->drops;
584 600
@@ -614,7 +630,7 @@ mlxsw_sp_setup_tc_qdisc_prio_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 29 unmodified lines
614 630
615 stats_base->drops = 0;631 stats_base->drops = 0;
616 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {632 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);
618 stats_base->drops += xstats->wred_drop[i];634 stats_base->drops += xstats->wred_drop[i];
619 }635 }
620 636
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
299 u64 len;299 u64 len;
300 int err;300 int err;
301 301
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
302 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));308 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
303 309
304 if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info))310 if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info))
305 return NETDEV_TX_BUSY;311 return NETDEV_TX_BUSY;
306 312
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 }
318 mlxsw_sx_txhdr_construct(skb, &tx_info);313 mlxsw_sx_txhdr_construct(skb, &tx_info);
319 /* TX header is consumed by HW on the way so we shouldn't count its314 /* TX header is consumed by HW on the way so we shouldn't count its
320 * bytes as being sent.315 * 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
2204 if (cd->tsu) {2204 if (cd->tsu) {
2205 add_tsu_reg(ARSTR);2205 add_tsu_reg(ARSTR);
2206 add_tsu_reg(TSU_CTRST);2206 add_tsu_reg(TSU_CTRST);
2207 add_tsu_reg(TSU_FWEN0);2207 if (cd->dual_port) {
2208 add_tsu_reg(TSU_FWEN1);2208 add_tsu_reg(TSU_FWEN0);
2209 add_tsu_reg(TSU_FCM);2209 add_tsu_reg(TSU_FWEN1);
2210 add_tsu_reg(TSU_BSYSL0);2210 add_tsu_reg(TSU_FCM);
2211 add_tsu_reg(TSU_BSYSL1);2211 add_tsu_reg(TSU_BSYSL0);
2212 add_tsu_reg(TSU_PRISL0);2212 add_tsu_reg(TSU_BSYSL1);
2213 add_tsu_reg(TSU_PRISL1);2213 add_tsu_reg(TSU_PRISL0);
2214 add_tsu_reg(TSU_FWSL0);2214 add_tsu_reg(TSU_PRISL1);
2215 add_tsu_reg(TSU_FWSL1);2215 add_tsu_reg(TSU_FWSL0);
2216 add_tsu_reg(TSU_FWSL1);
2217 }
2216 add_tsu_reg(TSU_FWSLC);2218 add_tsu_reg(TSU_FWSLC);
2217 add_tsu_reg(TSU_QTAGM0);2219 if (cd->dual_port) {
2218 add_tsu_reg(TSU_QTAGM1);2220 add_tsu_reg(TSU_QTAGM0);
2219 add_tsu_reg(TSU_FWSR);2221 add_tsu_reg(TSU_QTAGM1);
2220 add_tsu_reg(TSU_FWINMK);2222 add_tsu_reg(TSU_FWSR);
2221 add_tsu_reg(TSU_ADQT0);2223 add_tsu_reg(TSU_FWINMK);
2222 add_tsu_reg(TSU_ADQT1);2224 add_tsu_reg(TSU_ADQT0);
2223 add_tsu_reg(TSU_VTAG0);2225 add_tsu_reg(TSU_ADQT1);
2224 add_tsu_reg(TSU_VTAG1);2226 add_tsu_reg(TSU_VTAG0);
2227 add_tsu_reg(TSU_VTAG1);
2228 }
2225 add_tsu_reg(TSU_ADSBSY);2229 add_tsu_reg(TSU_ADSBSY);
2226 add_tsu_reg(TSU_TEN);2230 add_tsu_reg(TSU_TEN);
2227 add_tsu_reg(TSU_POST1);2231 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
424 phy_ethtool_get_wol(ndev->phydev, wol);424 phy_ethtool_get_wol(ndev->phydev, wol);
425}425}
426 426
427static int ave_ethtool_set_wol(struct net_device *ndev,427static int __ave_ethtool_set_wol(struct net_device *ndev,
428 struct ethtool_wolinfo *wol)428 struct ethtool_wolinfo *wol)
429{429{
430 int ret;
431
432 if (!ndev->phydev ||430 if (!ndev->phydev ||
433 (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))431 (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))
434 return -EOPNOTSUPP;432 return -EOPNOTSUPP;
435 433
436 ret = phy_ethtool_set_wol(ndev->phydev, wol);434 return phy_ethtool_set_wol(ndev->phydev, wol);
435}
436
437static 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);
437 if (!ret)443 if (!ret)
438 device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);444 device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);
439 445
@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev) · 776 unmodified lines
1216 1222
1217 /* set wol initial state disabled */1223 /* set wol initial state disabled */
1218 wol.wolopts = 0;1224 wol.wolopts = 0;
1219 ave_ethtool_set_wol(ndev, &wol);1225 __ave_ethtool_set_wol(ndev, &wol);
1220 1226
1221 if (!phy_interface_is_rgmii(phydev))1227 if (!phy_interface_is_rgmii(phydev))
1222 phy_set_max_speed(phydev, SPEED_100);1228 phy_set_max_speed(phydev, SPEED_100);
@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev) · 545 unmodified lines
1768 1774
1769 ave_ethtool_get_wol(ndev, &wol);1775 ave_ethtool_get_wol(ndev, &wol);
1770 wol.wolopts = priv->wolopts;1776 wol.wolopts = priv->wolopts;
1771 ave_ethtool_set_wol(ndev, &wol);1777 __ave_ethtool_set_wol(ndev, &wol);
1772 1778
1773 if (ndev->phydev) {1779 if (ndev->phydev) {
1774 ret = phy_resume(ndev->phydev);1780 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
80 if (attr->max_size && (attr->max_size > size))80 if (attr->max_size && (attr->max_size > size))
81 size = attr->max_size;81 size = attr->max_size;
82 82
83 skb = netdev_alloc_skb_ip_align(priv->dev, size);83 skb = netdev_alloc_skb(priv->dev, size);
84 if (!skb)84 if (!skb)
85 return NULL;85 return NULL;
86 86
@@ -244,6 +244,8 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 157 unmodified lines
244 struct net_device *orig_ndev)244 struct net_device *orig_ndev)
245{245{
246 struct stmmac_test_priv *tpriv = pt->af_packet_priv;246 struct stmmac_test_priv *tpriv = pt->af_packet_priv;
247 unsigned char *src = tpriv->packet->src;
248 unsigned char *dst = tpriv->packet->dst;
247 struct stmmachdr *shdr;249 struct stmmachdr *shdr;
248 struct ethhdr *ehdr;250 struct ethhdr *ehdr;
249 struct udphdr *uhdr;251 struct udphdr *uhdr;
@@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 10 unmodified lines
260 goto out;262 goto out;
261 263
262 ehdr = (struct ethhdr *)skb_mac_header(skb);264 ehdr = (struct ethhdr *)skb_mac_header(skb);
263 if (tpriv->packet->dst) {265 if (dst) {
264 if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))266 if (!ether_addr_equal_unaligned(ehdr->h_dest, dst))
265 goto out;267 goto out;
266 }268 }
267 if (tpriv->packet->sarc) {269 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))
269 goto out;271 goto out;
270 } else if (tpriv->packet->src) {272 } else if (src) {
271 if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src))273 if (!ether_addr_equal_unaligned(ehdr->h_source, src))
272 goto out;274 goto out;
273 }275 }
274 276
@@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb, · 439 unmodified lines
714 struct ethhdr *ehdr;716 struct ethhdr *ehdr;
715 717
716 ehdr = (struct ethhdr *)skb_mac_header(skb);718 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))
718 goto out;720 goto out;
719 if (ehdr->h_proto != htons(ETH_P_PAUSE))721 if (ehdr->h_proto != htons(ETH_P_PAUSE))
720 goto out;722 goto out;
@@ -851,12 +853,16 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb, · 130 unmodified lines
851 if (tpriv->vlan_id) {853 if (tpriv->vlan_id) {
852 if (skb->vlan_proto != htons(proto))854 if (skb->vlan_proto != htons(proto))
853 goto out;855 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);
855 goto out;860 goto out;
861 }
856 }862 }
857 863
858 ehdr = (struct ethhdr *)skb_mac_header(skb);864 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))
860 goto out;866 goto out;
861 867
862 ihdr = ip_hdr(skb);868 ihdr = ip_hdr(skb);
@@ -965,6 +971,9 @@ static int stmmac_test_vlanfilt_perfect(struct stmmac_priv *priv) · 102 unmodified lines
965{971{
966 int ret, prev_cap = priv->dma_cap.vlhash;972 int ret, prev_cap = priv->dma_cap.vlhash;
967 973
974 if (!(priv->dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
975 return -EOPNOTSUPP;
976
968 priv->dma_cap.vlhash = 0;977 priv->dma_cap.vlhash = 0;
969 ret = __stmmac_test_vlanfilt(priv);978 ret = __stmmac_test_vlanfilt(priv);
970 priv->dma_cap.vlhash = prev_cap;979 priv->dma_cap.vlhash = prev_cap;
@@ -1057,6 +1066,9 @@ static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) · 86 unmodified lines
1057{1066{
1058 int ret, prev_cap = priv->dma_cap.vlhash;1067 int ret, prev_cap = priv->dma_cap.vlhash;
1059 1068
1069 if (!(priv->dev->features & NETIF_F_HW_VLAN_STAG_FILTER))
1070 return -EOPNOTSUPP;
1071
1060 priv->dma_cap.vlhash = 0;1072 priv->dma_cap.vlhash = 0;
1061 ret = __stmmac_test_dvlanfilt(priv);1073 ret = __stmmac_test_dvlanfilt(priv);
1062 priv->dma_cap.vlhash = prev_cap;1074 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
1323 struct stmmac_packet_attrs attr = { };1335 struct stmmac_packet_attrs attr = { };
1324 struct flow_dissector *dissector;1336 struct flow_dissector *dissector;
1325 struct flow_cls_offload *cls;1337 struct flow_cls_offload *cls;
1338 int ret, old_enable = 0;
1326 struct flow_rule *rule;1339 struct flow_rule *rule;
1327 int ret;
1328 1340
1329 if (!tc_can_offload(priv->dev))1341 if (!tc_can_offload(priv->dev))
1330 return -EOPNOTSUPP;1342 return -EOPNOTSUPP;
1331 if (!priv->dma_cap.l3l4fnum)1343 if (!priv->dma_cap.l3l4fnum)
1332 return -EOPNOTSUPP;1344 return -EOPNOTSUPP;
1333 if (priv->rss.enable)1345 if (priv->rss.enable) {
1346 old_enable = priv->rss.enable;
1347 priv->rss.enable = false;
1334 stmmac_rss_configure(priv, priv->hw, NULL,1348 stmmac_rss_configure(priv, priv->hw, NULL,
1335 priv->plat->rx_queues_to_use);1349 priv->plat->rx_queues_to_use);
1350 }
1336 1351
1337 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);1352 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
1338 if (!dissector) {1353 if (!dissector) {
@@ -1399,7 +1414,8 @@ cleanup_cls: · 60 unmodified lines
1399cleanup_dissector:1414cleanup_dissector:
1400 kfree(dissector);1415 kfree(dissector);
1401cleanup_rss:1416cleanup_rss:
1402 if (priv->rss.enable) {1417 if (old_enable) {
1418 priv->rss.enable = old_enable;
1403 stmmac_rss_configure(priv, priv->hw, &priv->rss,1419 stmmac_rss_configure(priv, priv->hw, &priv->rss,
1404 priv->plat->rx_queues_to_use);1420 priv->plat->rx_queues_to_use);
1405 }1421 }
@@ -1444,16 +1460,19 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, · 38 unmodified lines
1444 struct stmmac_packet_attrs attr = { };1460 struct stmmac_packet_attrs attr = { };
1445 struct flow_dissector *dissector;1461 struct flow_dissector *dissector;
1446 struct flow_cls_offload *cls;1462 struct flow_cls_offload *cls;
1463 int ret, old_enable = 0;
1447 struct flow_rule *rule;1464 struct flow_rule *rule;
1448 int ret;
1449 1465
1450 if (!tc_can_offload(priv->dev))1466 if (!tc_can_offload(priv->dev))
1451 return -EOPNOTSUPP;1467 return -EOPNOTSUPP;
1452 if (!priv->dma_cap.l3l4fnum)1468 if (!priv->dma_cap.l3l4fnum)
1453 return -EOPNOTSUPP;1469 return -EOPNOTSUPP;
1454 if (priv->rss.enable)1470 if (priv->rss.enable) {
1471 old_enable = priv->rss.enable;
1472 priv->rss.enable = false;
1455 stmmac_rss_configure(priv, priv->hw, NULL,1473 stmmac_rss_configure(priv, priv->hw, NULL,
1456 priv->plat->rx_queues_to_use);1474 priv->plat->rx_queues_to_use);
1475 }
1457 1476
1458 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);1477 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
1459 if (!dissector) {1478 if (!dissector) {
@@ -1525,7 +1544,8 @@ cleanup_cls: · 65 unmodified lines
1525cleanup_dissector:1544cleanup_dissector:
1526 kfree(dissector);1545 kfree(dissector);
1527cleanup_rss:1546cleanup_rss:
1528 if (priv->rss.enable) {1547 if (old_enable) {
1548 priv->rss.enable = old_enable;
1529 stmmac_rss_configure(priv, priv->hw, &priv->rss,1549 stmmac_rss_configure(priv, priv->hw, &priv->rss,
1530 priv->plat->rx_queues_to_use);1550 priv->plat->rx_queues_to_use);
1531 }1551 }
@@ -1578,7 +1598,7 @@ static int stmmac_test_arp_validate(struct sk_buff *skb, · 46 unmodified lines
1578 struct arphdr *ahdr;1598 struct arphdr *ahdr;
1579 1599
1580 ehdr = (struct ethhdr *)skb_mac_header(skb);1600 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))
1582 goto out;1602 goto out;
1583 1603
1584 ahdr = arp_hdr(skb);1604 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
577{577{
578 int ret = 0;578 int ret = 0;
579 579
580 /* When RSS is enabled, the filtering will be bypassed */
581 if (priv->rss.enable)
582 return -EBUSY;
583
580 switch (cls->command) {584 switch (cls->command) {
581 case FLOW_CLS_REPLACE:585 case FLOW_CLS_REPLACE:
582 ret = tc_add_flow(priv, cls);586 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
1443 /* Halt and release the rndis device */1443 /* Halt and release the rndis device */
1444 rndis_filter_halt_device(net_dev, rndis_dev);1444 rndis_filter_halt_device(net_dev, rndis_dev);
1445 1445
1446 net_dev->extension = NULL;
1447
1448 netvsc_device_remove(dev);1446 netvsc_device_remove(dev);
1449}1447}
1450 1448
drivers/net/macvlan.c+3−2
@@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb, · 258 unmodified lines
259 struct net_device *src,259 struct net_device *src,
260 enum macvlan_mode mode)260 enum macvlan_mode mode)
261{261{
262 const struct ethhdr *eth = skb_eth_hdr(skb);262 const struct ethhdr *eth = eth_hdr(skb);
263 const struct macvlan_dev *vlan;263 const struct macvlan_dev *vlan;
264 struct sk_buff *nskb;264 struct sk_buff *nskb;
265 unsigned int i;265 unsigned int i;
@@ -513,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) · 247 unmodified lines
513 const struct macvlan_dev *dest;513 const struct macvlan_dev *dest;
514 514
515 if (vlan->mode == MACVLAN_MODE_BRIDGE) {515 if (vlan->mode == MACVLAN_MODE_BRIDGE) {
516 const struct ethhdr *eth = (void *)skb->data;516 const struct ethhdr *eth = skb_eth_hdr(skb);
517 517
518 /* send to other bridge ports directly */518 /* send to other bridge ports directly */
519 if (is_multicast_ether_addr(eth->h_dest)) {519 if (is_multicast_ether_addr(eth->h_dest)) {
520 skb_reset_mac_header(skb);
520 macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);521 macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
521 goto xmit_world;522 goto xmit_world;
522 }523 }
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
53 53
54 get_random_bytes(dummy_data, NSIM_DEV_DUMMY_REGION_SIZE);54 get_random_bytes(dummy_data, NSIM_DEV_DUMMY_REGION_SIZE);
55 55
56 id = devlink_region_shapshot_id_get(priv_to_devlink(nsim_dev));56 id = devlink_region_snapshot_id_get(priv_to_devlink(nsim_dev));
57 err = devlink_region_snapshot_create(nsim_dev->dummy_region,57 err = devlink_region_snapshot_create(nsim_dev->dummy_region,
58 dummy_data, id, kfree);58 dummy_data, id, kfree);
59 if (err) {59 if (err) {
drivers/net/phy/Kconfig+4−4
@@ -340,14 +340,14 @@ config DAVICOM_PHY · 339 unmodified lines
340 Currently supports dm9161e and dm9131340 Currently supports dm9161e and dm9131
341 341
342config DP83822_PHY342config DP83822_PHY
343 tristate "Texas Instruments DP83822 PHY"343 tristate "Texas Instruments DP83822/825 PHYs"
344 ---help---344 ---help---
345 Supports the DP83822 PHY.345 Supports the DP83822 and DP83825I PHYs.
346 346
347config DP83TC811_PHY347config DP83TC811_PHY
348 tristate "Texas Instruments DP83TC822 PHY"348 tristate "Texas Instruments DP83TC811 PHY"
349 ---help---349 ---help---
350 Supports the DP83TC822 PHY.350 Supports the DP83TC811 PHY.
351 351
352config DP83848_PHY352config DP83848_PHY
353 tristate "Texas Instruments DP83848 PHY"353 tristate "Texas Instruments DP83848 PHY"
drivers/net/phy/dp83867.c+7−1
@@ -97,6 +97,7 @@ · 96 unmodified lines
97#define DP83867_PHYCR_FIFO_DEPTH_MAX 0x0397#define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03
98#define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14)98#define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14)
99#define DP83867_PHYCR_RESERVED_MASK BIT(11)99#define DP83867_PHYCR_RESERVED_MASK BIT(11)
100#define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10)
100 101
101/* RGMIIDCTL bits */102/* RGMIIDCTL bits */
102#define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf103#define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf
@@ -599,7 +600,12 @@ static int dp83867_phy_reset(struct phy_device *phydev) · 496 unmodified lines
599 600
600 usleep_range(10, 20);601 usleep_range(10, 20);
601 602
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);
603}609}
604 610
605static struct phy_driver dp83867_driver[] = {611static 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
3750 3750
3751 /* MTU range: 68 - 9000 */3751 /* MTU range: 68 - 9000 */
3752 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;3752 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
3753 netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
3753 3754
3754 dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;3755 dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
3755 dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;3756 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
1062 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */1062 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
1063 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */1063 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
1064 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */1064 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
1065 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
1065 1066
1066 /* 3. Combined interface devices matching on interface number */1067 /* 3. Combined interface devices matching on interface number */
1067 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */1068 {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
6597 return -ENODEV;6597 return -ENODEV;
6598 }6598 }
6599 6599
6600 if (intf->cur_altsetting->desc.bNumEndpoints < 3)
6601 return -ENODEV;
6602
6600 usb_reset_device(udev);6603 usb_reset_device(udev);
6601 netdev = alloc_etherdev(sizeof(struct r8152));6604 netdev = alloc_etherdev(sizeof(struct r8152));
6602 if (!netdev) {6605 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
73 },73 },
74};74};
75 75
76static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM];76static struct ucc_tdm_info utdm_info[UCC_MAX_NUM];
77 77
78static int uhdlc_init(struct ucc_hdlc_private *priv)78static int uhdlc_init(struct ucc_hdlc_private *priv)
79{79{
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
64{64{
65 struct lapbethdev *lapbeth;65 struct lapbethdev *lapbeth;
66 66
67 list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) {67 list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) {
68 if (lapbeth->ethdev == dev) 68 if (lapbeth->ethdev == dev)
69 return lapbeth;69 return lapbeth;
70 }70 }
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
391 cmd, sizeof(cmd), false);391 cmd, sizeof(cmd), false);
392 392
393 rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd),393 rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd),
394 &transferred, 0);394 &transferred, 5000);
395 kfree(buffer);395 kfree(buffer);
396 if (rc || (transferred != sizeof(cmd))) {396 if (rc || (transferred != sizeof(cmd))) {
397 nfc_err(&phy->udev->dev,397 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
73 return ret;73 return ret;
74 }74 }
75 75
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
83 return 0;76 return 0;
84}77}
85 78
@@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) · 1 unmodified line
87{80{
88 struct wilco_keyboard_leds_msg request;81 struct wilco_keyboard_leds_msg request;
89 struct wilco_keyboard_leds_msg response;82 struct wilco_keyboard_leds_msg response;
83 int ret;
90 84
91 memset(&request, 0, sizeof(request));85 memset(&request, 0, sizeof(request));
92 request.command = WILCO_EC_COMMAND_KBBL;86 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
94 request.mode = WILCO_KBBL_MODE_FLAG_PWM;88 request.mode = WILCO_KBBL_MODE_FLAG_PWM;
95 request.percent = brightness;89 request.percent = brightness;
96 90
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;
98}103}
99 104
100static int kbbl_exist(struct wilco_ec_device *ec, bool *exists)105static 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
140 if (ret < 0)145 if (ret < 0)
141 return ret;146 return ret;
142 147
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
143 if (response.mode & WILCO_KBBL_MODE_FLAG_PWM)155 if (response.mode & WILCO_KBBL_MODE_FLAG_PWM)
144 return response.percent;156 return response.percent;
145 157
drivers/platform/mellanox/mlxbf-tmfifo.c+10−9
@@ -149,7 +149,7 @@ struct mlxbf_tmfifo_irq_info { · 148 unmodified lines
149 * @work: work struct for deferred process149 * @work: work struct for deferred process
150 * @timer: background timer150 * @timer: background timer
151 * @vring: Tx/Rx ring151 * @vring: Tx/Rx ring
152 * @spin_lock: spin lock152 * @spin_lock: Tx/Rx spin lock
153 * @is_ready: ready flag153 * @is_ready: ready flag
154 */154 */
155struct mlxbf_tmfifo {155struct mlxbf_tmfifo {
@@ -164,7 +164,7 @@ struct mlxbf_tmfifo { · 8 unmodified lines
164 struct work_struct work;164 struct work_struct work;
165 struct timer_list timer;165 struct timer_list timer;
166 struct mlxbf_tmfifo_vring *vring[2];166 struct mlxbf_tmfifo_vring *vring[2];
167 spinlock_t spin_lock; /* spin lock */167 spinlock_t spin_lock[2]; /* spin lock */
168 bool is_ready;168 bool is_ready;
169};169};
170 170
@@ -525,7 +525,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) · 354 unmodified lines
525 writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA);525 writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA);
526 526
527 /* Use spin-lock to protect the 'cons->tx_buf'. */527 /* 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);
529 529
530 while (size > 0) {530 while (size > 0) {
531 addr = cons->tx_buf.buf + cons->tx_buf.tail;531 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
552 }552 }
553 }553 }
554 554
555 spin_unlock_irqrestore(&fifo->spin_lock, flags);555 spin_unlock_irqrestore(&fifo->spin_lock[0], flags);
556}556}
557 557
558/* Rx/Tx one word in the descriptor buffer. */558/* 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
731 fifo->vring[is_rx] = NULL;731 fifo->vring[is_rx] = NULL;
732 732
733 /* Notify upper layer that packet is done. */733 /* 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);
735 vring_interrupt(0, vring->vq);735 vring_interrupt(0, vring->vq);
736 spin_unlock_irqrestore(&fifo->spin_lock, flags);736 spin_unlock_irqrestore(&fifo->spin_lock[is_rx], flags);
737 }737 }
738 738
739mlxbf_tmfifo_desc_done:739mlxbf_tmfifo_desc_done:
@@ -852,10 +852,10 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) · 112 unmodified lines
852 * worker handler.852 * worker handler.
853 */853 */
854 if (vring->vdev_id == VIRTIO_ID_CONSOLE) {854 if (vring->vdev_id == VIRTIO_ID_CONSOLE) {
855 spin_lock_irqsave(&fifo->spin_lock, flags);855 spin_lock_irqsave(&fifo->spin_lock[0], flags);
856 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE];856 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE];
857 mlxbf_tmfifo_console_output(tm_vdev, vring);857 mlxbf_tmfifo_console_output(tm_vdev, vring);
858 spin_unlock_irqrestore(&fifo->spin_lock, flags);858 spin_unlock_irqrestore(&fifo->spin_lock[0], flags);
859 } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ,859 } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ,
860 &fifo->pend_events)) {860 &fifo->pend_events)) {
861 return true;861 return true;
@@ -1189,7 +1189,8 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) · 327 unmodified lines
1189 if (!fifo)1189 if (!fifo)
1190 return -ENOMEM;1190 return -ENOMEM;
1191 1191
1192 spin_lock_init(&fifo->spin_lock);1192 spin_lock_init(&fifo->spin_lock[0]);
1193 spin_lock_init(&fifo->spin_lock[1]);
1193 INIT_WORK(&fifo->work, mlxbf_tmfifo_work_handler);1194 INIT_WORK(&fifo->work, mlxbf_tmfifo_work_handler);
1194 mutex_init(&fifo->lock);1195 mutex_init(&fifo->lock);
1195 1196
drivers/platform/x86/asus-wmi.c+1−7
@@ -512,13 +512,7 @@ static void kbd_led_update(struct asus_wmi *asus) · 511 unmodified lines
512{512{
513 int ctrl_param = 0;513 int ctrl_param = 0;
514 514
515 /*515 ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
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
522 asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);516 asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
523}517}
524 518
drivers/platform/x86/gpd-pocket-fan.c+20−7
@@ -16,17 +16,27 @@ · 15 unmodified lines
16 16
17#define MAX_SPEED 317#define MAX_SPEED 3
18 18
19static 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
27static int temp_limits[3] = {
28 TEMP_LIMIT0_DEFAULT, TEMP_LIMIT1_DEFAULT, TEMP_LIMIT2_DEFAULT,
29};
20module_param_array(temp_limits, int, NULL, 0444);30module_param_array(temp_limits, int, NULL, 0444);
21MODULE_PARM_DESC(temp_limits,31MODULE_PARM_DESC(temp_limits,
22 "Millicelsius values above which the fan speed increases");32 "Millicelsius values above which the fan speed increases");
23 33
24static int hysteresis = 3000;34static int hysteresis = HYSTERESIS_DEFAULT;
25module_param(hysteresis, int, 0444);35module_param(hysteresis, int, 0444);
26MODULE_PARM_DESC(hysteresis,36MODULE_PARM_DESC(hysteresis,
27 "Hysteresis in millicelsius before lowering the fan speed");37 "Hysteresis in millicelsius before lowering the fan speed");
28 38
29static int speed_on_ac = 2;39static int speed_on_ac = SPEED_ON_AC_DEFAULT;
30module_param(speed_on_ac, int, 0444);40module_param(speed_on_ac, int, 0444);
31MODULE_PARM_DESC(speed_on_ac,41MODULE_PARM_DESC(speed_on_ac,
32 "minimum fan speed to allow when system is powered by AC");42 "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
117 int i;127 int i;
118 128
119 for (i = 0; i < ARRAY_SIZE(temp_limits); i++) {129 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) {
121 dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n",131 dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n",
122 temp_limits[i]);132 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;
124 }137 }
125 }138 }
126 if (hysteresis < 1000 || hysteresis > 10000) {139 if (hysteresis < 1000 || hysteresis > 10000) {
127 dev_err(&pdev->dev, "Invalid hysteresis %d (must be between 1000 and 10000)\n",140 dev_err(&pdev->dev, "Invalid hysteresis %d (must be between 1000 and 10000)\n",
128 hysteresis);141 hysteresis);
129 return -EINVAL;142 hysteresis = HYSTERESIS_DEFAULT;
130 }143 }
131 if (speed_on_ac < 0 || speed_on_ac > MAX_SPEED) {144 if (speed_on_ac < 0 || speed_on_ac > MAX_SPEED) {
132 dev_err(&pdev->dev, "Invalid speed_on_ac %d (must be between 0 and 3)\n",145 dev_err(&pdev->dev, "Invalid speed_on_ac %d (must be between 0 and 3)\n",
133 speed_on_ac);146 speed_on_ac);
134 return -EINVAL;147 speed_on_ac = SPEED_ON_AC_DEFAULT;
135 }148 }
136 149
137 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);150 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.01/* SPDX-License-Identifier: GPL-2.0 */
2/*2/*
3 * Copyright (c) 2010 Intel Corporation3 * Copyright (c) 2010 Intel Corporation
4 */4 */
drivers/platform/x86/intel_pmc_core.h+1−1
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.01/* SPDX-License-Identifier: GPL-2.0 */
2/*2/*
3 * Intel Core SoC Power Management Controller Header File3 * Intel Core SoC Power Management Controller Header File
4 *4 *
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
44 INTEL_CPU_FAM6(KABYLAKE, pmc_core_device),44 INTEL_CPU_FAM6(KABYLAKE, pmc_core_device),
45 INTEL_CPU_FAM6(CANNONLAKE_L, pmc_core_device),45 INTEL_CPU_FAM6(CANNONLAKE_L, pmc_core_device),
46 INTEL_CPU_FAM6(ICELAKE_L, pmc_core_device),46 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),
47 {}49 {}
48};50};
49MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);51MODULE_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
170{170{
171 struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);171 struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);
172 172
173 ptp_cleanup_pin_groups(ptp);
173 mutex_destroy(&ptp->tsevq_mux);174 mutex_destroy(&ptp->tsevq_mux);
174 mutex_destroy(&ptp->pincfg_mux);175 mutex_destroy(&ptp->pincfg_mux);
175 ida_simple_remove(&ptp_clocks_map, ptp->index);176 ida_simple_remove(&ptp_clocks_map, ptp->index);
@@ -302,9 +303,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp) · 126 unmodified lines
302 if (ptp->pps_source)303 if (ptp->pps_source)
303 pps_unregister_source(ptp->pps_source);304 pps_unregister_source(ptp->pps_source);
304 305
305 ptp_cleanup_pin_groups(ptp);
306
307 posix_clock_unregister(&ptp->clock);306 posix_clock_unregister(&ptp->clock);
307
308 return 0;308 return 0;
309}309}
310EXPORT_SYMBOL(ptp_clock_unregister);310EXPORT_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
793 drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT;793 drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT;
794 if (!!devres != !!drvres)794 if (!!devres != !!drvres)
795 return -ENODEV;795 return -ENODEV;
796 /* (re-)init queue's state machine */
797 ap_queue_reinit_state(to_ap_queue(dev));
798 }796 }
799 797
800 /* Add queue/card to list of active queues/cards */798 /* 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
261void ap_queue_remove(struct ap_queue *aq);261void ap_queue_remove(struct ap_queue *aq);
262void ap_queue_suspend(struct ap_device *ap_dev);262void ap_queue_suspend(struct ap_device *ap_dev);
263void ap_queue_resume(struct ap_device *ap_dev);263void ap_queue_resume(struct ap_device *ap_dev);
264void ap_queue_reinit_state(struct ap_queue *aq);264void ap_queue_init_state(struct ap_queue *aq);
265 265
266struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type,266struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type,
267 int comp_device_type, unsigned int functions);267 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
638 aq->ap_dev.device.type = &ap_queue_type;638 aq->ap_dev.device.type = &ap_queue_type;
639 aq->ap_dev.device_type = device_type;639 aq->ap_dev.device_type = device_type;
640 aq->qid = qid;640 aq->qid = qid;
641 aq->state = AP_STATE_RESET_START;641 aq->state = AP_STATE_UNBOUND;
642 aq->interrupt = AP_INTR_DISABLED;642 aq->interrupt = AP_INTR_DISABLED;
643 spin_lock_init(&aq->lock);643 spin_lock_init(&aq->lock);
644 INIT_LIST_HEAD(&aq->list);644 INIT_LIST_HEAD(&aq->list);
@@ -771,10 +771,11 @@ void ap_queue_remove(struct ap_queue *aq) · 126 unmodified lines
771 spin_unlock_bh(&aq->lock);771 spin_unlock_bh(&aq->lock);
772}772}
773 773
774void ap_queue_reinit_state(struct ap_queue *aq)774void ap_queue_init_state(struct ap_queue *aq)
775{775{
776 spin_lock_bh(&aq->lock);776 spin_lock_bh(&aq->lock);
777 aq->state = AP_STATE_RESET_START;777 aq->state = AP_STATE_RESET_START;
778 ap_wait(ap_sm_event(aq, AP_EVENT_POLL));778 ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
779 spin_unlock_bh(&aq->lock);779 spin_unlock_bh(&aq->lock);
780}780}
781EXPORT_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
1037 prepparm = (struct iprepparm *) prepcblk->rpl_parmb;1037 prepparm = (struct iprepparm *) prepcblk->rpl_parmb;
1038 1038
1039 /* do some plausibility checks on the key block */1039 /* do some plausibility checks on the key block */
1040 if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) ||1040 if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) ||
1041 prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) {1041 prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) {
1042 DEBUG_ERR("%s reply with invalid or unknown key block\n",1042 DEBUG_ERR("%s reply with invalid or unknown key block\n",
1043 __func__);1043 __func__);
1044 rc = -EIO;1044 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
175 zq->queue = aq;175 zq->queue = aq;
176 zq->online = 1;176 zq->online = 1;
177 atomic_set(&zq->load, 0);177 atomic_set(&zq->load, 0);
178 ap_queue_init_state(aq);
178 ap_queue_init_reply(aq, &zq->reply);179 ap_queue_init_reply(aq, &zq->reply);
179 aq->request_timeout = CEX2A_CLEANUP_TIME,180 aq->request_timeout = CEX2A_CLEANUP_TIME,
180 aq->private = zq;181 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
220 zq->queue = aq;220 zq->queue = aq;
221 zq->online = 1;221 zq->online = 1;
222 atomic_set(&zq->load, 0);222 atomic_set(&zq->load, 0);
223 ap_rapq(aq->qid);
223 rc = zcrypt_cex2c_rng_supported(aq);224 rc = zcrypt_cex2c_rng_supported(aq);
224 if (rc < 0) {225 if (rc < 0) {
225 zcrypt_queue_free(zq);226 zcrypt_queue_free(zq);
@@ -231,6 +232,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev) · 5 unmodified lines
231 else232 else
232 zq->ops = zcrypt_msgtype(MSGTYPE06_NAME,233 zq->ops = zcrypt_msgtype(MSGTYPE06_NAME,
233 MSGTYPE06_VARIANT_NORNG);234 MSGTYPE06_VARIANT_NORNG);
235 ap_queue_init_state(aq);
234 ap_queue_init_reply(aq, &zq->reply);236 ap_queue_init_reply(aq, &zq->reply);
235 aq->request_timeout = CEX2C_CLEANUP_TIME;237 aq->request_timeout = CEX2C_CLEANUP_TIME;
236 aq->private = zq;238 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
381 zq->queue = aq;381 zq->queue = aq;
382 zq->online = 1;382 zq->online = 1;
383 atomic_set(&zq->load, 0);383 atomic_set(&zq->load, 0);
384 ap_queue_init_state(aq);
384 ap_queue_init_reply(aq, &zq->reply);385 ap_queue_init_reply(aq, &zq->reply);
385 aq->request_timeout = CEX4_CLEANUP_TIME,386 aq->request_timeout = CEX4_CLEANUP_TIME,
386 aq->private = zq;387 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
688 688
689int vnic_dev_hang_notify(struct vnic_dev *vdev)689int vnic_dev_hang_notify(struct vnic_dev *vdev)
690{690{
691 u64 a0, a1;691 u64 a0 = 0, a1 = 0;
692 int wait = 1000;692 int wait = 1000;
693 return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait);693 return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait);
694}694}
695 695
696int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)696int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
697{697{
698 u64 a0, a1;698 u64 a[2] = {};
699 int wait = 1000;699 int wait = 1000;
700 int err, i;700 int err, i;
701 701
702 for (i = 0; i < ETH_ALEN; i++)702 for (i = 0; i < ETH_ALEN; i++)
703 mac_addr[i] = 0;703 mac_addr[i] = 0;
704 704
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);
706 if (err)706 if (err)
707 return err;707 return err;
708 708
709 for (i = 0; i < ETH_ALEN; i++)709 for (i = 0; i < ETH_ALEN; i++)
710 mac_addr[i] = ((u8 *)&a0)[i];710 mac_addr[i] = ((u8 *)&a)[i];
711 711
712 return 0;712 return 0;
713}713}
@@ -732,30 +732,30 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, · 18 unmodified lines
732 732
733void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)733void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
734{734{
735 u64 a0 = 0, a1 = 0;735 u64 a[2] = {};
736 int wait = 1000;736 int wait = 1000;
737 int err;737 int err;
738 int i;738 int i;
739 739
740 for (i = 0; i < ETH_ALEN; i++)740 for (i = 0; i < ETH_ALEN; i++)
741 ((u8 *)&a0)[i] = addr[i];741 ((u8 *)&a)[i] = addr[i];
742 742
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);
744 if (err)744 if (err)
745 pr_err("Can't add addr [%pM], %d\n", addr, err);745 pr_err("Can't add addr [%pM], %d\n", addr, err);
746}746}
747 747
748void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)748void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
749{749{
750 u64 a0 = 0, a1 = 0;750 u64 a[2] = {};
751 int wait = 1000;751 int wait = 1000;
752 int err;752 int err;
753 int i;753 int i;
754 754
755 for (i = 0; i < ETH_ALEN; i++)755 for (i = 0; i < ETH_ALEN; i++)
756 ((u8 *)&a0)[i] = addr[i];756 ((u8 *)&a)[i] = addr[i];
757 757
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);
759 if (err)759 if (err)
760 pr_err("Can't del addr [%pM], %d\n", addr, err);760 pr_err("Can't del addr [%pM], %d\n", addr, err);
761}761}
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
2211 u8 type;2211 u8 type;
2212 int ret = 0;2212 int ret = 0;
2213 2213
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;
2215 return ret;2216 return ret;
2217 }
2216 2218
2217 type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */2219 type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */
2218 2220
drivers/scsi/storvsc_drv.c+3−1
@@ -1842,9 +1842,11 @@ static int storvsc_probe(struct hv_device *device, · 1841 unmodified lines
1842 */1842 */
1843 host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);1843 host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
1844 /*1844 /*
1845 * For non-IDE disks, the host supports multiple channels.
1845 * Set the number of HW queues we are supporting.1846 * Set the number of HW queues we are supporting.
1846 */1847 */
1847 host->nr_hw_queues = num_present_cpus();1848 if (!dev_is_ide)
1849 host->nr_hw_queues = num_present_cpus();
1848 1850
1849 /*1851 /*
1850 * Set the error handler work queue.1852 * 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
323 struct meson_ee_pwrc *pwrc,323 struct meson_ee_pwrc *pwrc,
324 struct meson_ee_pwrc_domain *dom)324 struct meson_ee_pwrc_domain *dom)
325{325{
326 int ret;
327
326 dom->pwrc = pwrc;328 dom->pwrc = pwrc;
327 dom->num_rstc = dom->desc.reset_names_count;329 dom->num_rstc = dom->desc.reset_names_count;
328 dom->num_clks = dom->desc.clk_names_count;330 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
368 * prepare/enable counters won't be in sync.370 * prepare/enable counters won't be in sync.
369 */371 */
370 if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) {372 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);
372 if (ret)374 if (ret)
373 return ret;375 return ret;
374 376
375 pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false);377 ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov,
376 } else378 false);
377 pm_genpd_init(&dom->base, NULL,379 if (ret)
378 (dom->desc.get_power ?380 return ret;
379 dom->desc.get_power(dom) : true));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 }
380 388
381 return 0;389 return 0;
382}390}
@@ -441,9 +449,7 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev) · 58 unmodified lines
441 pwrc->xlate.domains[i] = &dom->base;449 pwrc->xlate.domains[i] = &dom->base;
442 }450 }
443 451
444 of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);452 return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
445
446 return 0;
447}453}
448 454
449static void meson_ee_pwrc_shutdown(struct platform_device *pdev)455static 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
419 ret = rproc_boot(m3_ipc->rproc);419 ret = rproc_boot(m3_ipc->rproc);
420 if (ret)420 if (ret)
421 dev_err(dev, "rproc_boot failed\n");421 dev_err(dev, "rproc_boot failed\n");
422 else
423 m3_ipc_state = m3_ipc;
422 424
423 do_exit(0);425 do_exit(0);
424}426}
@@ -505,8 +507,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) · 80 unmodified lines
505 goto err_put_rproc;507 goto err_put_rproc;
506 }508 }
507 509
508 m3_ipc_state = m3_ipc;
509
510 return 0;510 return 0;
511 511
512err_put_rproc:512err_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
72 }72 }
73 }73 }
74 74
75 if (!rv)
76 return -ENODATA;
77
78 /* Second, find the set of routes valid for this device. */75 /* Second, find the set of routes valid for this device. */
79 for (i = 0; ni_device_routes_list[i]; ++i) {76 for (i = 0; ni_device_routes_list[i]; ++i) {
80 if (memcmp(ni_device_routes_list[i]->device, board_name,77 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
84 }81 }
85 }82 }
86 83
87 if (!dr)
88 return -ENODATA;
89
90 tables->route_values = rv;84 tables->route_values = rv;
91 tables->valid_routes = dr;85 tables->valid_routes = dr;
92 86
87 if (!rv || !dr)
88 return -ENODATA;
89
93 return 0;90 return 0;
94}91}
95 92
@@ -487,6 +484,9 @@ int ni_find_route_source(const u8 src_sel_reg_value, int dest, · 391 unmodified lines
487{484{
488 int src;485 int src;
489 486
487 if (!tables->route_values)
488 return -EINVAL;
489
490 dest = B(dest); /* subtract NI names offset */490 dest = B(dest); /* subtract NI names offset */
491 /* ensure we are not going to under/over run the route value table */491 /* ensure we are not going to under/over run the route value table */
492 if (dest < 0 || dest >= NI_NUM_NAMES)492 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
28 shm->size = PAGE_SIZE << order;28 shm->size = PAGE_SIZE << order;
29 29
30 if (shm->flags & TEE_SHM_DMA_BUF) {30 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
31 shm->flags |= TEE_SHM_REGISTER;43 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,
33 (unsigned long)shm->kaddr);45 (unsigned long)shm->kaddr);
46 kfree(pages);
34 }47 }
35 48
36 return rc;49 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
1192 * PORT_OVER_CURRENT is not. So check for any of them.1192 * PORT_OVER_CURRENT is not. So check for any of them.
1193 */1193 */
1194 if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||1194 if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
1195 (portchange & USB_PORT_STAT_C_CONNECTION) ||
1195 (portstatus & USB_PORT_STAT_OVERCURRENT) ||1196 (portstatus & USB_PORT_STAT_OVERCURRENT) ||
1196 (portchange & USB_PORT_STAT_C_OVERCURRENT))1197 (portchange & USB_PORT_STAT_C_OVERCURRENT))
1197 set_bit(port1, hub->change_bits);1198 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
642static int ch341_reset_resume(struct usb_serial *serial)642static int ch341_reset_resume(struct usb_serial *serial)
643{643{
644 struct usb_serial_port *port = serial->port[0];644 struct usb_serial_port *port = serial->port[0];
645 struct ch341_private *priv = usb_get_serial_port_data(port);645 struct ch341_private *priv;
646 int ret;646 int ret;
647 647
648 priv = usb_get_serial_port_data(port);
649 if (!priv)
650 return 0;
651
648 /* reconfigure ch341 serial port after bus-reset */652 /* reconfigure ch341 serial port after bus-reset */
649 ch341_configure(serial->dev, priv);653 ch341_configure(serial->dev, priv);
650 654
drivers/usb/serial/io_edgeport.c+9−7
@@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb) · 715 unmodified lines
716 if (txCredits) {716 if (txCredits) {
717 port = edge_serial->serial->port[portNumber];717 port = edge_serial->serial->port[portNumber];
718 edge_port = usb_get_serial_port_data(port);718 edge_port = usb_get_serial_port_data(port);
719 if (edge_port->open) {719 if (edge_port && edge_port->open) {
720 spin_lock_irqsave(&edge_port->ep_lock,720 spin_lock_irqsave(&edge_port->ep_lock,
721 flags);721 flags);
722 edge_port->txCredits += txCredits;722 edge_port->txCredits += txCredits;
@@ -1725,7 +1725,8 @@ static void edge_break(struct tty_struct *tty, int break_state) · 1002 unmodified lines
1725static void process_rcvd_data(struct edgeport_serial *edge_serial,1725static void process_rcvd_data(struct edgeport_serial *edge_serial,
1726 unsigned char *buffer, __u16 bufferLength)1726 unsigned char *buffer, __u16 bufferLength)
1727{1727{
1728 struct device *dev = &edge_serial->serial->dev->dev;1728 struct usb_serial *serial = edge_serial->serial;
1729 struct device *dev = &serial->dev->dev;
1729 struct usb_serial_port *port;1730 struct usb_serial_port *port;
1730 struct edgeport_port *edge_port;1731 struct edgeport_port *edge_port;
1731 __u16 lastBufferLength;1732 __u16 lastBufferLength;
@@ -1821,11 +1822,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 89 unmodified lines
1821 1822
1822 /* spit this data back into the tty driver if this1823 /* spit this data back into the tty driver if this
1823 port is open */1824 port is open */
1824 if (rxLen) {1825 if (rxLen && edge_serial->rxPort < serial->num_ports) {
1825 port = edge_serial->serial->port[1826 port = serial->port[edge_serial->rxPort];
1826 edge_serial->rxPort];
1827 edge_port = usb_get_serial_port_data(port);1827 edge_port = usb_get_serial_port_data(port);
1828 if (edge_port->open) {1828 if (edge_port && edge_port->open) {
1829 dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n",1829 dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n",
1830 __func__, rxLen,1830 __func__, rxLen,
1831 edge_serial->rxPort);1831 edge_serial->rxPort);
@@ -1833,8 +1833,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 1 unmodified line
1833 rxLen);1833 rxLen);
1834 edge_port->port->icount.rx += rxLen;1834 edge_port->port->icount.rx += rxLen;
1835 }1835 }
1836 buffer += rxLen;
1837 }1836 }
1837 buffer += rxLen;
1838 break;1838 break;
1839 1839
1840 case EXPECT_HDR3: /* Expect 3rd byte of status header */1840 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
1869 __u8 code = edge_serial->rxStatusCode;1869 __u8 code = edge_serial->rxStatusCode;
1870 1870
1871 /* switch the port pointer to the one being currently talked about */1871 /* switch the port pointer to the one being currently talked about */
1872 if (edge_serial->rxPort >= edge_serial->serial->num_ports)
1873 return;
1872 port = edge_serial->serial->port[edge_serial->rxPort];1874 port = edge_serial->serial->port[edge_serial->rxPort];
1873 edge_port = usb_get_serial_port_data(port);1875 edge_port = usb_get_serial_port_data(port);
1874 if (edge_port == NULL) {1876 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
1058 for (i = 0; i < serial->num_ports; ++i) {1058 for (i = 0; i < serial->num_ports; ++i) {
1059 port = serial->port[i];1059 port = serial->port[i];
1060 p_priv = usb_get_serial_port_data(port);1060 p_priv = usb_get_serial_port_data(port);
1061 if (!p_priv)
1062 continue;
1061 1063
1062 if (p_priv->resend_cont) {1064 if (p_priv->resend_cont) {
1063 dev_dbg(&port->dev, "%s - sending setup\n", __func__);1065 dev_dbg(&port->dev, "%s - sending setup\n", __func__);
@@ -1459,6 +1461,8 @@ static void usa67_glocont_callback(struct urb *urb) · 395 unmodified lines
1459 for (i = 0; i < serial->num_ports; ++i) {1461 for (i = 0; i < serial->num_ports; ++i) {
1460 port = serial->port[i];1462 port = serial->port[i];
1461 p_priv = usb_get_serial_port_data(port);1463 p_priv = usb_get_serial_port_data(port);
1464 if (!p_priv)
1465 continue;
1462 1466
1463 if (p_priv->resend_cont) {1467 if (p_priv->resend_cont) {
1464 dev_dbg(&port->dev, "%s - sending setup\n", __func__);1468 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
113 retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),113 retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
114 requesttype,114 requesttype,
115 USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,115 USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
116 0, 0, buffer, 1, 0);116 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT);
117 kfree(buffer);117 kfree(buffer);
118 118
119 if (retval < 0)119 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
248#define QUECTEL_PRODUCT_BG96 0x0296248#define QUECTEL_PRODUCT_BG96 0x0296
249#define QUECTEL_PRODUCT_EP06 0x0306249#define QUECTEL_PRODUCT_EP06 0x0306
250#define QUECTEL_PRODUCT_EM12 0x0512250#define QUECTEL_PRODUCT_EM12 0x0512
251#define QUECTEL_PRODUCT_RM500Q 0x0800
251 252
252#define CMOTECH_VENDOR_ID 0x16d8253#define CMOTECH_VENDOR_ID 0x16d8
253#define CMOTECH_PRODUCT_6001 0x6001254#define CMOTECH_PRODUCT_6001 0x6001
@@ -1104,6 +1105,11 @@ static const struct usb_device_id option_ids[] = { · 850 unmodified lines
1104 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),1105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
1105 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },1106 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1106 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },1107 { 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
1107 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },1113 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
1108 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },1114 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
1109 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),1115 { 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
841 u8 newMSR = (u8) *ch;841 u8 newMSR = (u8) *ch;
842 unsigned long flags;842 unsigned long flags;
843 843
844 /* May be called from qt2_process_read_urb() for an unbound port. */
844 port_priv = usb_get_serial_port_data(port);845 port_priv = usb_get_serial_port_data(port);
846 if (!port_priv)
847 return;
845 848
846 spin_lock_irqsave(&port_priv->lock, flags);849 spin_lock_irqsave(&port_priv->lock, flags);
847 port_priv->shadowMSR = newMSR;850 port_priv->shadowMSR = newMSR;
@@ -869,7 +872,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) · 21 unmodified lines
869 unsigned long flags;872 unsigned long flags;
870 u8 newLSR = (u8) *ch;873 u8 newLSR = (u8) *ch;
871 874
875 /* May be called from qt2_process_read_urb() for an unbound port. */
872 port_priv = usb_get_serial_port_data(port);876 port_priv = usb_get_serial_port_data(port);
877 if (!port_priv)
878 return;
873 879
874 if (newLSR & UART_LSR_BI)880 if (newLSR & UART_LSR_BI)
875 newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI);881 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
86#define MOTOROLA_TETRA_IDS() \86#define MOTOROLA_TETRA_IDS() \
87 { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \87 { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \
88 { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \88 { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \
89 { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \
90 { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \
89 { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */91 { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */
90DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);92DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
91 93
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
1317 return -EINVAL;1317 return -EINVAL;
1318 }1318 }
1319 1319
1320 /* Prevent individual ports from being unbound. */
1321 driver->driver.suppress_bind_attrs = true;
1322
1320 usb_serial_operations_init(driver);1323 usb_serial_operations_init(driver);
1321 1324
1322 /* Add this device to our list of devices */1325 /* 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
908 unsigned int flags)908 unsigned int flags)
909{909{
910 struct afs_vnode *dvnode = AFS_FS_I(dir);910 struct afs_vnode *dvnode = AFS_FS_I(dir);
911 struct afs_fid fid = {};
911 struct inode *inode;912 struct inode *inode;
912 struct dentry *d;913 struct dentry *d;
913 struct key *key;914 struct key *key;
@@ -951,21 +952,18 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, · 37 unmodified lines
951 afs_stat_v(dvnode, n_lookup);952 afs_stat_v(dvnode, n_lookup);
952 inode = afs_do_lookup(dir, dentry, key);953 inode = afs_do_lookup(dir, dentry, key);
953 key_put(key);954 key_put(key);
954 if (inode == ERR_PTR(-ENOENT)) {955 if (inode == ERR_PTR(-ENOENT))
955 inode = afs_try_auto_mntpt(dentry, dir);956 inode = afs_try_auto_mntpt(dentry, dir);
956 } else {957
957 dentry->d_fsdata =958 if (!IS_ERR_OR_NULL(inode))
958 (void *)(unsigned long)dvnode->status.data_version;959 fid = AFS_FS_I(inode)->fid;
959 }960
960 d = d_splice_alias(inode, dentry);961 d = d_splice_alias(inode, dentry);
961 if (!IS_ERR_OR_NULL(d)) {962 if (!IS_ERR_OR_NULL(d)) {
962 d->d_fsdata = dentry->d_fsdata;963 d->d_fsdata = dentry->d_fsdata;
963 trace_afs_lookup(dvnode, &d->d_name,964 trace_afs_lookup(dvnode, &d->d_name, &fid);
964 inode ? AFS_FS_I(inode) : NULL);
965 } else {965 } else {
966 trace_afs_lookup(dvnode, &dentry->d_name,966 trace_afs_lookup(dvnode, &dentry->d_name, &fid);
967 IS_ERR_OR_NULL(inode) ? NULL
968 : AFS_FS_I(inode));
969 }967 }
970 return d;968 return d;
971}969}
fs/btrfs/inode.c+39−34
@@ -4238,18 +4238,30 @@ out: · 4237 unmodified lines
4238}4238}
4239 4239
4240static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,4240static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
4241 struct inode *dir, u64 objectid,4241 struct inode *dir, struct dentry *dentry)
4242 const char *name, int name_len)
4243{4242{
4244 struct btrfs_root *root = BTRFS_I(dir)->root;4243 struct btrfs_root *root = BTRFS_I(dir)->root;
4244 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));
4245 struct btrfs_path *path;4245 struct btrfs_path *path;
4246 struct extent_buffer *leaf;4246 struct extent_buffer *leaf;
4247 struct btrfs_dir_item *di;4247 struct btrfs_dir_item *di;
4248 struct btrfs_key key;4248 struct btrfs_key key;
4249 const char *name = dentry->d_name.name;
4250 int name_len = dentry->d_name.len;
4249 u64 index;4251 u64 index;
4250 int ret;4252 int ret;
4253 u64 objectid;
4251 u64 dir_ino = btrfs_ino(BTRFS_I(dir));4254 u64 dir_ino = btrfs_ino(BTRFS_I(dir));
4252 4255
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
4253 path = btrfs_alloc_path();4265 path = btrfs_alloc_path();
4254 if (!path)4266 if (!path)
4255 return -ENOMEM;4267 return -ENOMEM;
@@ -4271,13 +4283,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 15 unmodified lines
4271 }4283 }
4272 btrfs_release_path(path);4284 btrfs_release_path(path);
4273 4285
4274 ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid,4286 /*
4275 dir_ino, &index, name, name_len);4287 * This is a placeholder inode for a subvolume we didn't have a
4276 if (ret < 0) {4288 * reference to at the time of the snapshot creation. In the meantime
4277 if (ret != -ENOENT) {4289 * we could have renamed the real subvol link into our snapshot, so
4278 btrfs_abort_transaction(trans, ret);4290 * depending on btrfs_del_root_ref to return -ENOENT here is incorret.
4279 goto out;4291 * Instead simply lookup the dir_index_item for this entry so we can
4280 }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) {
4281 di = btrfs_search_dir_index_item(root, path, dir_ino,4296 di = btrfs_search_dir_index_item(root, path, dir_ino,
4282 name, name_len);4297 name, name_len);
4283 if (IS_ERR_OR_NULL(di)) {4298 if (IS_ERR_OR_NULL(di)) {
@@ -4292,8 +4307,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 8 unmodified lines
4292 leaf = path->nodes[0];4307 leaf = path->nodes[0];
4293 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);4308 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
4294 index = key.offset;4309 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 }
4295 }4319 }
4296 btrfs_release_path(path);
4297 4320
4298 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index);4321 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index);
4299 if (ret) {4322 if (ret) {
@@ -4487,8 +4510,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) · 187 unmodified lines
4487 4510
4488 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));4511 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));
4489 4512
4490 ret = btrfs_unlink_subvol(trans, dir, dest->root_key.objectid,4513 ret = btrfs_unlink_subvol(trans, dir, dentry);
4491 dentry->d_name.name, dentry->d_name.len);
4492 if (ret) {4514 if (ret) {
4493 err = ret;4515 err = ret;
4494 btrfs_abort_transaction(trans, ret);4516 btrfs_abort_transaction(trans, ret);
@@ -4583,10 +4605,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · 88 unmodified lines
4583 return PTR_ERR(trans);4605 return PTR_ERR(trans);
4584 4606
4585 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {4607 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
4586 err = btrfs_unlink_subvol(trans, dir,4608 err = btrfs_unlink_subvol(trans, dir, dentry);
4587 BTRFS_I(inode)->location.objectid,
4588 dentry->d_name.name,
4589 dentry->d_name.len);
4590 goto out;4609 goto out;
4591 }4610 }
4592 4611
@@ -9536,7 +9555,6 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 4943 unmodified lines
9536 u64 new_ino = btrfs_ino(BTRFS_I(new_inode));9555 u64 new_ino = btrfs_ino(BTRFS_I(new_inode));
9537 u64 old_idx = 0;9556 u64 old_idx = 0;
9538 u64 new_idx = 0;9557 u64 new_idx = 0;
9539 u64 root_objectid;
9540 int ret;9558 int ret;
9541 bool root_log_pinned = false;9559 bool root_log_pinned = false;
9542 bool dest_log_pinned = false;9560 bool dest_log_pinned = false;
@@ -9642,10 +9660,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 99 unmodified lines
9642 9660
9643 /* src is a subvolume */9661 /* src is a subvolume */
9644 if (old_ino == BTRFS_FIRST_FREE_OBJECTID) {9662 if (old_ino == BTRFS_FIRST_FREE_OBJECTID) {
9645 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;9663 ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
9646 ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
9647 old_dentry->d_name.name,
9648 old_dentry->d_name.len);
9649 } else { /* src is an inode */9664 } else { /* src is an inode */
9650 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),9665 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
9651 BTRFS_I(old_dentry->d_inode),9666 BTRFS_I(old_dentry->d_inode),
@@ -9661,10 +9676,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 9 unmodified lines
9661 9676
9662 /* dest is a subvolume */9677 /* dest is a subvolume */
9663 if (new_ino == BTRFS_FIRST_FREE_OBJECTID) {9678 if (new_ino == BTRFS_FIRST_FREE_OBJECTID) {
9664 root_objectid = BTRFS_I(new_inode)->root->root_key.objectid;9679 ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
9665 ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
9666 new_dentry->d_name.name,
9667 new_dentry->d_name.len);
9668 } else { /* dest is an inode */9680 } else { /* dest is an inode */
9669 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),9681 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
9670 BTRFS_I(new_dentry->d_inode),9682 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
9862 struct inode *new_inode = d_inode(new_dentry);9874 struct inode *new_inode = d_inode(new_dentry);
9863 struct inode *old_inode = d_inode(old_dentry);9875 struct inode *old_inode = d_inode(old_dentry);
9864 u64 index = 0;9876 u64 index = 0;
9865 u64 root_objectid;
9866 int ret;9877 int ret;
9867 u64 old_ino = btrfs_ino(BTRFS_I(old_inode));9878 u64 old_ino = btrfs_ino(BTRFS_I(old_inode));
9868 bool log_pinned = false;9879 bool log_pinned = false;
@@ -9970,10 +9981,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 101 unmodified lines
9970 BTRFS_I(old_inode), 1);9981 BTRFS_I(old_inode), 1);
9971 9982
9972 if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) {9983 if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) {
9973 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;9984 ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
9974 ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
9975 old_dentry->d_name.name,
9976 old_dentry->d_name.len);
9977 } else {9985 } else {
9978 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),9986 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
9979 BTRFS_I(d_inode(old_dentry)),9987 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
9992 new_inode->i_ctime = current_time(new_inode);10000 new_inode->i_ctime = current_time(new_inode);
9993 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) ==10001 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) ==
9994 BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {10002 BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
9995 root_objectid = BTRFS_I(new_inode)->location.objectid;10003 ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
9996 ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
9997 new_dentry->d_name.name,
9998 new_dentry->d_name.len);
9999 BUG_ON(new_inode->i_nlink == 0);10004 BUG_ON(new_inode->i_nlink == 0);
10000 } else {10005 } else {
10001 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),10006 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
4252 &sa->progress, sa->flags & BTRFS_SCRUB_READONLY,4252 &sa->progress, sa->flags & BTRFS_SCRUB_READONLY,
4253 0);4253 0);
4254 4254
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)))
4256 ret = -EFAULT;4268 ret = -EFAULT;
4257 4269
4258 if (!(sa->flags & BTRFS_SCRUB_READONLY))4270 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
2423 u64 nr_old_roots = 0;2423 u64 nr_old_roots = 0;
2424 int ret = 0;2424 int ret = 0;
2425 2425
2426 /*
2427 * If quotas get disabled meanwhile, the resouces need to be freed and
2428 * we can't just exit here.
2429 */
2426 if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))2430 if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
2427 return 0;2431 goto out_free;
2428 2432
2429 if (new_roots) {2433 if (new_roots) {
2430 if (!maybe_fs_roots(new_roots))2434 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
517 return 1;517 return 1;
518}518}
519 519
520static 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 */
540static 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}
520 548
521static int should_ignore_root(struct btrfs_root *root)549static int should_ignore_root(struct btrfs_root *root)
522{550{
@@ -525,6 +553,10 @@ static int should_ignore_root(struct btrfs_root *root) · 2 unmodified lines
525 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))553 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
526 return 0;554 return 0;
527 555
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
528 reloc_root = root->reloc_root;560 reloc_root = root->reloc_root;
529 if (!reloc_root)561 if (!reloc_root)
530 return 0;562 return 0;
@@ -1439,7 +1471,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, · 908 unmodified lines
1439 * The subvolume has reloc tree but the swap is finished, no need to1471 * The subvolume has reloc tree but the swap is finished, no need to
1440 * create/update the dead reloc tree1472 * create/update the dead reloc tree
1441 */1473 */
1442 if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state))1474 if (reloc_root_is_dead(root))
1443 return 0;1475 return 0;
1444 1476
1445 if (root->reloc_root) {1477 if (root->reloc_root) {
@@ -1478,8 +1510,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 32 unmodified lines
1478 struct btrfs_root_item *root_item;1510 struct btrfs_root_item *root_item;
1479 int ret;1511 int ret;
1480 1512
1481 if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state) ||1513 if (!have_reloc_root(root))
1482 !root->reloc_root)
1483 goto out;1514 goto out;
1484 1515
1485 reloc_root = root->reloc_root;1516 reloc_root = root->reloc_root;
@@ -1489,6 +1520,11 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 3 unmodified lines
1489 if (fs_info->reloc_ctl->merge_reloc_tree &&1520 if (fs_info->reloc_ctl->merge_reloc_tree &&
1490 btrfs_root_refs(root_item) == 0) {1521 btrfs_root_refs(root_item) == 0) {
1491 set_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);1522 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();
1492 __del_reloc_root(reloc_root);1528 __del_reloc_root(reloc_root);
1493 }1529 }
1494 1530
@@ -2201,6 +2237,11 @@ static int clean_dirty_subvols(struct reloc_control *rc) · 706 unmodified lines
2201 if (ret2 < 0 && !ret)2237 if (ret2 < 0 && !ret)
2202 ret = ret2;2238 ret = ret2;
2203 }2239 }
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();
2204 clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);2245 clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
2205 btrfs_put_fs_root(root);2246 btrfs_put_fs_root(root);
2206 } else {2247 } else {
@@ -4718,7 +4759,7 @@ void btrfs_reloc_pre_snapshot(struct btrfs_pending_snapshot *pending, · 2511 unmodified lines
4718 struct btrfs_root *root = pending->root;4759 struct btrfs_root *root = pending->root;
4719 struct reloc_control *rc = root->fs_info->reloc_ctl;4760 struct reloc_control *rc = root->fs_info->reloc_ctl;
4720 4761
4721 if (!root->reloc_root || !rc)4762 if (!rc || !have_reloc_root(root))
4722 return;4763 return;
4723 4764
4724 if (!rc->merge_reloc_tree)4765 if (!rc->merge_reloc_tree)
@@ -4752,7 +4793,7 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, · 27 unmodified lines
4752 struct reloc_control *rc = root->fs_info->reloc_ctl;4793 struct reloc_control *rc = root->fs_info->reloc_ctl;
4753 int ret;4794 int ret;
4754 4795
4755 if (!root->reloc_root || !rc)4796 if (!rc || !have_reloc_root(root))
4756 return 0;4797 return 0;
4757 4798
4758 rc = root->fs_info->reloc_ctl;4799 rc = root->fs_info->reloc_ctl;
fs/btrfs/root-tree.c+6−4
@@ -376,11 +376,13 @@ again: · 375 unmodified lines
376 leaf = path->nodes[0];376 leaf = path->nodes[0];
377 ref = btrfs_item_ptr(leaf, path->slots[0],377 ref = btrfs_item_ptr(leaf, path->slots[0],
378 struct btrfs_root_ref);378 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);
382 ptr = (unsigned long)(ref + 1);379 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 }
384 *sequence = btrfs_root_ref_sequence(leaf, ref);386 *sequence = btrfs_root_ref_sequence(leaf, ref);
385 387
386 ret = btrfs_del_item(trans, tree_root, path);388 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
3881 }3881 }
3882 }3882 }
3883 3883
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;
3885 3889
3886 /*3890 /*
3887 * SINGLE profile on-disk has no profile bit, but in-memory we have a3891 * 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
882 struct fuse_args_pages *ap = &ia->ap;882 struct fuse_args_pages *ap = &ia->ap;
883 loff_t pos = page_offset(ap->pages[0]);883 loff_t pos = page_offset(ap->pages[0]);
884 size_t count = ap->num_pages << PAGE_SHIFT;884 size_t count = ap->num_pages << PAGE_SHIFT;
885 ssize_t res;
885 int err;886 int err;
886 887
887 ap->args.out_pages = true;888 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
896 if (!err)897 if (!err)
897 return;898 return;
898 } else {899 } else {
899 err = fuse_simple_request(fc, &ap->args);900 res = fuse_simple_request(fc, &ap->args);
901 err = res < 0 ? res : 0;
900 }902 }
901 fuse_readpages_end(fc, &ap->args, err);903 fuse_readpages_end(fc, &ap->args, err);
902}904}
fs/io-wq.c+8−4
@@ -445,10 +445,14 @@ next: · 444 unmodified lines
445 task_unlock(current);445 task_unlock(current);
446 }446 }
447 if ((work->flags & IO_WQ_WORK_NEEDS_USER) && !worker->mm &&447 if ((work->flags & IO_WQ_WORK_NEEDS_USER) && !worker->mm &&
448 wq->mm && mmget_not_zero(wq->mm)) {448 wq->mm) {
449 use_mm(wq->mm);449 if (mmget_not_zero(wq->mm)) {
450 set_fs(USER_DS);450 use_mm(wq->mm);
451 worker->mm = wq->mm;451 set_fs(USER_DS);
452 worker->mm = wq->mm;
453 } else {
454 work->flags |= IO_WQ_WORK_CANCEL;
455 }
452 }456 }
453 if (!worker->creds)457 if (!worker->creds)
454 worker->creds = override_creds(wq->creds);458 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
1786 struct iovec *iovec, struct iovec *fast_iov,1786 struct iovec *iovec, struct iovec *fast_iov,
1787 struct iov_iter *iter)1787 struct iov_iter *iter)
1788{1788{
1789 if (req->opcode == IORING_OP_READ_FIXED ||
1790 req->opcode == IORING_OP_WRITE_FIXED)
1791 return 0;
1789 if (!req->io && io_alloc_async_ctx(req))1792 if (!req->io && io_alloc_async_ctx(req))
1790 return -ENOMEM;1793 return -ENOMEM;
1791 1794
@@ -1840,6 +1843,7 @@ static int io_read(struct io_kiocb *req, struct io_kiocb **nxt, · 48 unmodified lines
1840 if (!force_nonblock)1843 if (!force_nonblock)
1841 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;1844 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;
1842 1845
1846 req->result = 0;
1843 io_size = ret;1847 io_size = ret;
1844 if (req->flags & REQ_F_LINK)1848 if (req->flags & REQ_F_LINK)
1845 req->result = io_size;1849 req->result = io_size;
@@ -1927,6 +1931,7 @@ static int io_write(struct io_kiocb *req, struct io_kiocb **nxt, · 81 unmodified lines
1927 if (!force_nonblock)1931 if (!force_nonblock)
1928 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;1932 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;
1929 1933
1934 req->result = 0;
1930 io_size = ret;1935 io_size = ret;
1931 if (req->flags & REQ_F_LINK)1936 if (req->flags & REQ_F_LINK)
1932 req->result = io_size;1937 req->result = io_size;
@@ -2034,6 +2039,28 @@ static bool io_req_cancelled(struct io_kiocb *req) · 101 unmodified lines
2034 return false;2039 return false;
2035}2040}
2036 2041
2042static 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
2051static 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
2037static void io_fsync_finish(struct io_wq_work **workptr)2064static void io_fsync_finish(struct io_wq_work **workptr)
2038{2065{
2039 struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);2066 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
2052 io_cqring_add_event(req, ret);2079 io_cqring_add_event(req, ret);
2053 io_put_req_find_next(req, &nxt);2080 io_put_req_find_next(req, &nxt);
2054 if (nxt)2081 if (nxt)
2055 *workptr = &nxt->work;2082 io_wq_assign_next(workptr, nxt);
2056}2083}
2057 2084
2058static int io_fsync(struct io_kiocb *req, struct io_kiocb **nxt,2085static 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
2108 io_cqring_add_event(req, ret);2135 io_cqring_add_event(req, ret);
2109 io_put_req_find_next(req, &nxt);2136 io_put_req_find_next(req, &nxt);
2110 if (nxt)2137 if (nxt)
2111 *workptr = &nxt->work;2138 io_wq_assign_next(workptr, nxt);
2112}2139}
2113 2140
2114static int io_sync_file_range(struct io_kiocb *req, struct io_kiocb **nxt,2141static 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
2374 return;2401 return;
2375 __io_accept(req, &nxt, false);2402 __io_accept(req, &nxt, false);
2376 if (nxt)2403 if (nxt)
2377 *workptr = &nxt->work;2404 io_wq_assign_next(workptr, nxt);
2378}2405}
2379#endif2406#endif
2380 2407
@@ -2605,7 +2632,7 @@ static void io_poll_complete_work(struct io_wq_work **workptr) · 224 unmodified lines
2605 req_set_fail_links(req);2632 req_set_fail_links(req);
2606 io_put_req_find_next(req, &nxt);2633 io_put_req_find_next(req, &nxt);
2607 if (nxt)2634 if (nxt)
2608 *workptr = &nxt->work;2635 io_wq_assign_next(workptr, nxt);
2609}2636}
2610 2637
2611static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,2638static 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
3259 return ret;3286 return ret;
3260 3287
3261 if (ctx->flags & IORING_SETUP_IOPOLL) {3288 if (ctx->flags & IORING_SETUP_IOPOLL) {
3289 const bool in_async = io_wq_current_is_worker();
3290
3262 if (req->result == -EAGAIN)3291 if (req->result == -EAGAIN)
3263 return -EAGAIN;3292 return -EAGAIN;
3264 3293
3294 /* workqueue context doesn't hold uring_lock, grab it now */
3295 if (in_async)
3296 mutex_lock(&ctx->uring_lock);
3297
3265 io_iopoll_req_issued(req);3298 io_iopoll_req_issued(req);
3299
3300 if (in_async)
3301 mutex_unlock(&ctx->uring_lock);
3266 }3302 }
3267 3303
3268 return 0;3304 return 0;
3269}3305}
3270 3306
3271static 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
3280static void io_wq_submit_work(struct io_wq_work **workptr)3307static void io_wq_submit_work(struct io_wq_work **workptr)
3281{3308{
3282 struct io_wq_work *work = *workptr;3309 struct io_wq_work *work = *workptr;
@@ -3313,17 +3340,8 @@ static void io_wq_submit_work(struct io_wq_work **workptr) · 30 unmodified lines
3313 }3340 }
3314 3341
3315 /* if a dependent link is ready, pass it back */3342 /* if a dependent link is ready, pass it back */
3316 if (!ret && nxt) {3343 if (!ret && nxt)
3317 struct io_kiocb *link;3344 io_wq_assign_next(workptr, nxt);
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 }
3327}3345}
3328 3346
3329static bool io_req_op_valid(int op)3347static 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
5141 } else if (to_submit) {5159 } else if (to_submit) {
5142 struct mm_struct *cur_mm;5160 struct mm_struct *cur_mm;
5143 5161
5162 if (current->mm != ctx->sqo_mm ||
5163 current_cred() != ctx->creds) {
5164 ret = -EPERM;
5165 goto out;
5166 }
5167
5144 to_submit = min(to_submit, ctx->sq_entries);5168 to_submit = min(to_submit, ctx->sq_entries);
5145 mutex_lock(&ctx->uring_lock);5169 mutex_lock(&ctx->uring_lock);
5146 /* already have mm, so io_submit_sqes() won't try to grab it */5170 /* 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
1232 BUG_ON(!path->dentry->d_op);1232 BUG_ON(!path->dentry->d_op);
1233 BUG_ON(!path->dentry->d_op->d_manage);1233 BUG_ON(!path->dentry->d_op->d_manage);
1234 ret = path->dentry->d_op->d_manage(path, false);1234 ret = path->dentry->d_op->d_manage(path, false);
1235 flags = smp_load_acquire(&path->dentry->d_flags);
1235 if (ret < 0)1236 if (ret < 0)
1236 break;1237 break;
1237 }1238 }
@@ -1649,17 +1650,15 @@ again: · 411 unmodified lines
1649 if (IS_ERR(dentry))1650 if (IS_ERR(dentry))
1650 return dentry;1651 return dentry;
1651 if (unlikely(!d_in_lookup(dentry))) {1652 if (unlikely(!d_in_lookup(dentry))) {
1652 if (!(flags & LOOKUP_NO_REVAL)) {1653 int error = d_revalidate(dentry, flags);
1653 int error = d_revalidate(dentry, flags);1654 if (unlikely(error <= 0)) {
1654 if (unlikely(error <= 0)) {1655 if (!error) {
1655 if (!error) {1656 d_invalidate(dentry);
1656 d_invalidate(dentry);
1657 dput(dentry);
1658 goto again;
1659 }
1660 dput(dentry);1657 dput(dentry);
1661 dentry = ERR_PTR(error);1658 goto again;
1662 }1659 }
1660 dput(dentry);
1661 dentry = ERR_PTR(error);
1663 }1662 }
1664 } else {1663 } else {
1665 old = inode->i_op->lookup(inode, dentry, flags);1664 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
2617}2616}
2618EXPORT_SYMBOL(user_path_at_empty);2617EXPORT_SYMBOL(user_path_at_empty);
2619 2618
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 */
2643static int
2644mountpoint_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
2686/**2619/**
2687 * path_mountpoint - look up a path to be umounted2620 * path_mountpoint - look up a path to be umounted
2688 * @nd: lookup context2621 * @nd: lookup context
@@ -2699,14 +2632,17 @@ path_mountpoint(struct nameidata *nd, unsigned flags, struct path *path) · 10 unmodified lines
2699 int err;2632 int err;
2700 2633
2701 while (!(err = link_path_walk(s, nd)) &&2634 while (!(err = link_path_walk(s, nd)) &&
2702 (err = mountpoint_last(nd)) > 0) {2635 (err = lookup_last(nd)) > 0) {
2703 s = trailing_symlink(nd);2636 s = trailing_symlink(nd);
2704 }2637 }
2638 if (!err && (nd->flags & LOOKUP_RCU))
2639 err = unlazy_walk(nd);
2640 if (!err)
2641 err = handle_lookup_down(nd);
2705 if (!err) {2642 if (!err) {
2706 *path = nd->path;2643 *path = nd->path;
2707 nd->path.mnt = NULL;2644 nd->path.mnt = NULL;
2708 nd->path.dentry = NULL;2645 nd->path.dentry = NULL;
2709 follow_mount(path);
2710 }2646 }
2711 terminate_walk(nd);2647 terminate_walk(nd);
2712 return err;2648 return err;
fs/nfs/nfstrace.h+0−2
@@ -206,7 +206,6 @@ TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT); · 205 unmodified lines
206TRACE_DEFINE_ENUM(LOOKUP_PARENT);206TRACE_DEFINE_ENUM(LOOKUP_PARENT);
207TRACE_DEFINE_ENUM(LOOKUP_REVAL);207TRACE_DEFINE_ENUM(LOOKUP_REVAL);
208TRACE_DEFINE_ENUM(LOOKUP_RCU);208TRACE_DEFINE_ENUM(LOOKUP_RCU);
209TRACE_DEFINE_ENUM(LOOKUP_NO_REVAL);
210TRACE_DEFINE_ENUM(LOOKUP_OPEN);209TRACE_DEFINE_ENUM(LOOKUP_OPEN);
211TRACE_DEFINE_ENUM(LOOKUP_CREATE);210TRACE_DEFINE_ENUM(LOOKUP_CREATE);
212TRACE_DEFINE_ENUM(LOOKUP_EXCL);211TRACE_DEFINE_ENUM(LOOKUP_EXCL);
@@ -224,7 +223,6 @@ TRACE_DEFINE_ENUM(LOOKUP_DOWN); · 11 unmodified lines
224 { LOOKUP_PARENT, "PARENT" }, \223 { LOOKUP_PARENT, "PARENT" }, \
225 { LOOKUP_REVAL, "REVAL" }, \224 { LOOKUP_REVAL, "REVAL" }, \
226 { LOOKUP_RCU, "RCU" }, \225 { LOOKUP_RCU, "RCU" }, \
227 { LOOKUP_NO_REVAL, "NO_REVAL" }, \
228 { LOOKUP_OPEN, "OPEN" }, \226 { LOOKUP_OPEN, "OPEN" }, \
229 { LOOKUP_CREATE, "CREATE" }, \227 { LOOKUP_CREATE, "CREATE" }, \
230 { LOOKUP_EXCL, "EXCL" }, \228 { LOOKUP_EXCL, "EXCL" }, \
include/asm-generic/cacheflush.h+32−1
@@ -11,71 +11,102 @@ · 10 unmodified lines
11 * The cache doesn't need to be flushed when TLB entries change when11 * The cache doesn't need to be flushed when TLB entries change when
12 * the cache is mapped to physical memory, not virtual memory12 * the cache is mapped to physical memory, not virtual memory
13 */13 */
14#ifndef flush_cache_all
14static inline void flush_cache_all(void)15static inline void flush_cache_all(void)
15{16{
16}17}
18#endif
17 19
20#ifndef flush_cache_mm
18static inline void flush_cache_mm(struct mm_struct *mm)21static inline void flush_cache_mm(struct mm_struct *mm)
19{22{
20}23}
24#endif
21 25
26#ifndef flush_cache_dup_mm
22static inline void flush_cache_dup_mm(struct mm_struct *mm)27static inline void flush_cache_dup_mm(struct mm_struct *mm)
23{28{
24}29}
30#endif
25 31
32#ifndef flush_cache_range
26static inline void flush_cache_range(struct vm_area_struct *vma,33static inline void flush_cache_range(struct vm_area_struct *vma,
27 unsigned long start,34 unsigned long start,
28 unsigned long end)35 unsigned long end)
29{36{
30}37}
38#endif
31 39
40#ifndef flush_cache_page
32static inline void flush_cache_page(struct vm_area_struct *vma,41static inline void flush_cache_page(struct vm_area_struct *vma,
33 unsigned long vmaddr,42 unsigned long vmaddr,
34 unsigned long pfn)43 unsigned long pfn)
35{44{
36}45}
46#endif
37 47
48#ifndef flush_dcache_page
38static inline void flush_dcache_page(struct page *page)49static inline void flush_dcache_page(struct page *page)
39{50{
40}51}
52#endif
41 53
54#ifndef flush_dcache_mmap_lock
42static inline void flush_dcache_mmap_lock(struct address_space *mapping)55static inline void flush_dcache_mmap_lock(struct address_space *mapping)
43{56{
44}57}
58#endif
45 59
60#ifndef flush_dcache_mmap_unlock
46static inline void flush_dcache_mmap_unlock(struct address_space *mapping)61static inline void flush_dcache_mmap_unlock(struct address_space *mapping)
47{62{
48}63}
64#endif
49 65
66#ifndef flush_icache_range
50static inline void flush_icache_range(unsigned long start, unsigned long end)67static inline void flush_icache_range(unsigned long start, unsigned long end)
51{68{
52}69}
70#endif
53 71
72#ifndef flush_icache_page
54static inline void flush_icache_page(struct vm_area_struct *vma,73static inline void flush_icache_page(struct vm_area_struct *vma,
55 struct page *page)74 struct page *page)
56{75{
57}76}
77#endif
58 78
79#ifndef flush_icache_user_range
59static inline void flush_icache_user_range(struct vm_area_struct *vma,80static inline void flush_icache_user_range(struct vm_area_struct *vma,
60 struct page *page,81 struct page *page,
61 unsigned long addr, int len)82 unsigned long addr, int len)
62{83{
63}84}
85#endif
64 86
87#ifndef flush_cache_vmap
65static inline void flush_cache_vmap(unsigned long start, unsigned long end)88static inline void flush_cache_vmap(unsigned long start, unsigned long end)
66{89{
67}90}
91#endif
68 92
93#ifndef flush_cache_vunmap
69static inline void flush_cache_vunmap(unsigned long start, unsigned long end)94static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
70{95{
71}96}
97#endif
72 98
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) \
74 do { \101 do { \
75 memcpy(dst, src, len); \102 memcpy(dst, src, len); \
76 flush_icache_user_range(vma, page, vaddr, len); \103 flush_icache_user_range(vma, page, vaddr, len); \
77 } while (0)104 } while (0)
105#endif
106
107#ifndef copy_from_user_page
78#define copy_from_user_page(vma, page, vaddr, dst, src, len) \108#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
79 memcpy(dst, src, len)109 memcpy(dst, src, len)
110#endif
80 111
81#endif /* __ASM_CACHEFLUSH_H */112#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
605 * &drm_dp_sideband_msg_tx.state once they are queued605 * &drm_dp_sideband_msg_tx.state once they are queued
606 */606 */
607 struct mutex qlock;607 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
608 /**614 /**
609 * @tx_msg_downq: List of pending down replies.615 * @tx_msg_downq: List of pending down replies.
610 */616 */
include/dt-bindings/reset/amlogic,meson8b-reset.h+3−3
@@ -46,9 +46,9 @@ · 45 unmodified lines
46#define RESET_VD_RMEM 6446#define RESET_VD_RMEM 64
47#define RESET_AUDIN 6547#define RESET_AUDIN 65
48#define RESET_DBLK 6648#define RESET_DBLK 66
49#define RESET_PIC_DC 6649#define RESET_PIC_DC 67
50#define RESET_PSC 6650#define RESET_PSC 68
51#define RESET_NAND 6651#define RESET_NAND 69
52#define RESET_GE2D 7052#define RESET_GE2D 70
53#define RESET_PARSER_REG 7153#define RESET_PARSER_REG 71
54#define RESET_PARSER_FETCH 7254#define RESET_PARSER_FETCH 72
include/linux/blkdev.h+4−4
@@ -328,6 +328,7 @@ struct queue_limits { · 327 unmodified lines
328 unsigned int max_sectors;328 unsigned int max_sectors;
329 unsigned int max_segment_size;329 unsigned int max_segment_size;
330 unsigned int physical_block_size;330 unsigned int physical_block_size;
331 unsigned int logical_block_size;
331 unsigned int alignment_offset;332 unsigned int alignment_offset;
332 unsigned int io_min;333 unsigned int io_min;
333 unsigned int io_opt;334 unsigned int io_opt;
@@ -338,7 +339,6 @@ struct queue_limits { · 4 unmodified lines
338 unsigned int discard_granularity;339 unsigned int discard_granularity;
339 unsigned int discard_alignment;340 unsigned int discard_alignment;
340 341
341 unsigned short logical_block_size;
342 unsigned short max_segments;342 unsigned short max_segments;
343 unsigned short max_integrity_segments;343 unsigned short max_integrity_segments;
344 unsigned short max_discard_segments;344 unsigned short max_discard_segments;
@@ -1077,7 +1077,7 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q, · 732 unmodified lines
1077 unsigned int max_write_same_sectors);1077 unsigned int max_write_same_sectors);
1078extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q,1078extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
1079 unsigned int max_write_same_sectors);1079 unsigned int max_write_same_sectors);
1080extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);1080extern void blk_queue_logical_block_size(struct request_queue *, unsigned int);
1081extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);1081extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
1082extern void blk_queue_alignment_offset(struct request_queue *q,1082extern void blk_queue_alignment_offset(struct request_queue *q,
1083 unsigned int alignment);1083 unsigned int alignment);
@@ -1291,7 +1291,7 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q) · 207 unmodified lines
1291 return q->limits.max_segment_size;1291 return q->limits.max_segment_size;
1292}1292}
1293 1293
1294static inline unsigned short queue_logical_block_size(const struct request_queue *q)1294static inline unsigned queue_logical_block_size(const struct request_queue *q)
1295{1295{
1296 int retval = 512;1296 int retval = 512;
1297 1297
@@ -1301,7 +1301,7 @@ static inline unsigned short queue_logical_block_size(const struct request_queue · 3 unmodified lines
1301 return retval;1301 return retval;
1302}1302}
1303 1303
1304static inline unsigned short bdev_logical_block_size(struct block_device *bdev)1304static inline unsigned int bdev_logical_block_size(struct block_device *bdev)
1305{1305{
1306 return queue_logical_block_size(bdev_get_queue(bdev));1306 return queue_logical_block_size(bdev_get_queue(bdev));
1307}1307}
include/linux/mm.h+15−3
@@ -2658,13 +2658,25 @@ static inline bool want_init_on_free(void) · 2657 unmodified lines
2658 !page_poisoning_enabled();2658 !page_poisoning_enabled();
2659}2659}
2660 2660
2661#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT2661#ifdef CONFIG_DEBUG_PAGEALLOC
2662DECLARE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);2662extern void init_debug_pagealloc(void);
2663#else2663#else
2664DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);2664static inline void init_debug_pagealloc(void) {}
2665#endif2665#endif
2666extern bool _debug_pagealloc_enabled_early;
2667DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
2666 2668
2667static inline bool debug_pagealloc_enabled(void)2669static 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 */
2679static inline bool debug_pagealloc_enabled_static(void)
2668{2680{
2669 if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC))2681 if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC))
2670 return false;2682 return false;
include/linux/mmzone.h+2−3
@@ -215,9 +215,8 @@ enum node_stat_item { · 214 unmodified lines
215 NR_INACTIVE_FILE, /* " " " " " */215 NR_INACTIVE_FILE, /* " " " " " */
216 NR_ACTIVE_FILE, /* " " " " " */216 NR_ACTIVE_FILE, /* " " " " " */
217 NR_UNEVICTABLE, /* " " " " " */217 NR_UNEVICTABLE, /* " " " " " */
218 NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */218 NR_SLAB_RECLAIMABLE,
219 NR_SLAB_UNRECLAIMABLE, /* and this one without looking at219 NR_SLAB_UNRECLAIMABLE,
220 * memcg_flush_percpu_vmstats() first. */
221 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */220 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
222 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */221 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
223 WORKINGSET_NODES,222 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
34 34
35/* internal use only */35/* internal use only */
36#define LOOKUP_PARENT 0x001036#define LOOKUP_PARENT 0x0010
37#define LOOKUP_NO_REVAL 0x0080
38#define LOOKUP_JUMPED 0x100037#define LOOKUP_JUMPED 0x1000
39#define LOOKUP_ROOT 0x200038#define LOOKUP_ROOT 0x2000
40#define LOOKUP_ROOT_GRABBED 0x000839#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
1929 1929
1930/*1930/*
1931 * If parent process has a registered restartable sequences area, the1931 * 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.
1933 */1933 */
1934static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)1934static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
1935{1935{
1936 if (clone_flags & CLONE_THREAD) {1936 if (clone_flags & CLONE_VM) {
1937 t->rseq = NULL;1937 t->rseq = NULL;
1938 t->rseq_sig = 0;1938 t->rseq_sig = 0;
1939 t->rseq_event_mask = 0;1939 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
358static inline void sk_psock_restore_proto(struct sock *sk,358static inline void sk_psock_restore_proto(struct sock *sk,
359 struct sk_psock *psock)359 struct sk_psock *psock)
360{360{
361 sk->sk_write_space = psock->saved_write_space;361 sk->sk_prot->unhash = psock->saved_unhash;
362 362
363 if (psock->sk_proto) {363 if (psock->sk_proto) {
364 struct inet_connection_sock *icsk = inet_csk(sk);364 struct inet_connection_sock *icsk = inet_csk(sk);
365 bool has_ulp = !!icsk->icsk_ulp_data;365 bool has_ulp = !!icsk->icsk_ulp_data;
366 366
367 if (has_ulp)367 if (has_ulp) {
368 tcp_update_ulp(sk, psock->sk_proto);368 tcp_update_ulp(sk, psock->sk_proto,
369 else369 psock->saved_write_space);
370 } else {
370 sk->sk_prot = psock->sk_proto;371 sk->sk_prot = psock->sk_proto;
372 sk->sk_write_space = psock->saved_write_space;
373 }
371 psock->sk_proto = NULL;374 psock->sk_proto = NULL;
375 } else {
376 sk->sk_write_space = psock->saved_write_space;
372 }377 }
373}378}
374 379
include/linux/tnum.h+1−1
@@ -30,7 +30,7 @@ struct tnum tnum_lshift(struct tnum a, u8 shift); · 29 unmodified lines
30/* Shift (rsh) a tnum right (by a fixed shift) */30/* Shift (rsh) a tnum right (by a fixed shift) */
31struct tnum tnum_rshift(struct tnum a, u8 shift);31struct tnum tnum_rshift(struct tnum a, u8 shift);
32/* Shift (arsh) a tnum right (by a fixed min_shift) */32/* Shift (arsh) a tnum right (by a fixed min_shift) */
33struct tnum tnum_arshift(struct tnum a, u8 min_shift);33struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness);
34/* Add two tnums, return @a + @b */34/* Add two tnums, return @a + @b */
35struct tnum tnum_add(struct tnum a, struct tnum b);35struct tnum tnum_add(struct tnum a, struct tnum b);
36/* Subtract two tnums, return @a - @b */36/* Subtract two tnums, return @a - @b */
include/net/cfg80211.h+5−0
@@ -3548,6 +3548,9 @@ struct cfg80211_update_owe_info { · 3547 unmodified lines
3548 *3548 *
3549 * @start_radar_detection: Start radar detection in the driver.3549 * @start_radar_detection: Start radar detection in the driver.
3550 *3550 *
3551 * @end_cac: End running CAC, probably because a related CAC
3552 * was finished on another phy.
3553 *
3551 * @update_ft_ies: Provide updated Fast BSS Transition information to the3554 * @update_ft_ies: Provide updated Fast BSS Transition information to the
3552 * driver. If the SME is in the driver/firmware, this information can be3555 * driver. If the SME is in the driver/firmware, this information can be
3553 * used in building Authentication and Reassociation Request frames.3556 * used in building Authentication and Reassociation Request frames.
@@ -3874,6 +3877,8 @@ struct cfg80211_ops { · 320 unmodified lines
3874 struct net_device *dev,3877 struct net_device *dev,
3875 struct cfg80211_chan_def *chandef,3878 struct cfg80211_chan_def *chandef,
3876 u32 cac_time_ms);3879 u32 cac_time_ms);
3880 void (*end_cac)(struct wiphy *wiphy,
3881 struct net_device *dev);
3877 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,3882 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
3878 struct cfg80211_update_ft_ies_params *ftie);3883 struct cfg80211_update_ft_ies_params *ftie);
3879 int (*crit_proto_start)(struct wiphy *wiphy,3884 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
938 u32 region_max_snapshots,938 u32 region_max_snapshots,
939 u64 region_size);939 u64 region_size);
940void devlink_region_destroy(struct devlink_region *region);940void devlink_region_destroy(struct devlink_region *region);
941u32 devlink_region_shapshot_id_get(struct devlink *devlink);941u32 devlink_region_snapshot_id_get(struct devlink *devlink);
942int devlink_region_snapshot_create(struct devlink_region *region,942int devlink_region_snapshot_create(struct devlink_region *region,
943 u8 *data, u32 snapshot_id,943 u8 *data, u32 snapshot_id,
944 devlink_snapshot_data_dest_t *data_destructor);944 devlink_snapshot_data_dest_t *data_destructor);
include/net/tcp.h+4−2
@@ -2147,7 +2147,8 @@ struct tcp_ulp_ops { · 2146 unmodified lines
2147 /* initialize ulp */2147 /* initialize ulp */
2148 int (*init)(struct sock *sk);2148 int (*init)(struct sock *sk);
2149 /* update ulp */2149 /* 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));
2151 /* cleanup ulp */2152 /* cleanup ulp */
2152 void (*release)(struct sock *sk);2153 void (*release)(struct sock *sk);
2153 /* diagnostic */2154 /* diagnostic */
@@ -2162,7 +2163,8 @@ void tcp_unregister_ulp(struct tcp_ulp_ops *type); · 8 unmodified lines
2162int tcp_set_ulp(struct sock *sk, const char *name);2163int tcp_set_ulp(struct sock *sk, const char *name);
2163void tcp_get_available_ulp(char *buf, size_t len);2164void tcp_get_available_ulp(char *buf, size_t len);
2164void tcp_cleanup_ulp(struct sock *sk);2165void tcp_cleanup_ulp(struct sock *sk);
2165void tcp_update_ulp(struct sock *sk, struct proto *p);2166void tcp_update_ulp(struct sock *sk, struct proto *p,
2167 void (*write_space)(struct sock *sk));
2166 2168
2167#define MODULE_ALIAS_TCP_ULP(name) \2169#define MODULE_ALIAS_TCP_ULP(name) \
2168 __MODULE_INFO(alias, alias_userspace, name); \2170 __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
915 915
916TRACE_EVENT(afs_lookup,916TRACE_EVENT(afs_lookup,
917 TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,917 TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
918 struct afs_vnode *vnode),918 struct afs_fid *fid),
919 919
920 TP_ARGS(dvnode, name, vnode),920 TP_ARGS(dvnode, name, fid),
921 921
922 TP_STRUCT__entry(922 TP_STRUCT__entry(
923 __field_struct(struct afs_fid, dfid )923 __field_struct(struct afs_fid, dfid )
@@ -928,13 +928,7 @@ TRACE_EVENT(afs_lookup, · 4 unmodified lines
928 TP_fast_assign(928 TP_fast_assign(
929 int __len = min_t(int, name->len, 23);929 int __len = min_t(int, name->len, 23);
930 __entry->dfid = dvnode->fid;930 __entry->dfid = dvnode->fid;
931 if (vnode) {931 __entry->fid = *fid;
932 __entry->fid = vnode->fid;
933 } else {
934 __entry->fid.vid = 0;
935 __entry->fid.vnode = 0;
936 __entry->fid.unique = 0;
937 }
938 memcpy(__entry->name, name->name, __len);932 memcpy(__entry->name, name->name, __len);
939 __entry->name[__len] = 0;933 __entry->name[__len] = 0;
940 ),934 ),
include/trace/events/huge_memory.h+2−1
@@ -31,7 +31,8 @@ · 30 unmodified lines
31 EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \31 EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \
32 EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \32 EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \
33 EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \33 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") \
35 36
36#undef EM37#undef EM
37#undef EMe38#undef EMe
init/main.c+1−0
@@ -553,6 +553,7 @@ static void __init mm_init(void) · 552 unmodified lines
553 * bigger than MAX_ORDER unless SPARSEMEM.553 * bigger than MAX_ORDER unless SPARSEMEM.
554 */554 */
555 page_ext_init_flatmem();555 page_ext_init_flatmem();
556 init_debug_pagealloc();
556 report_meminit();557 report_meminit();
557 mem_init();558 mem_init();
558 kmem_cache_init();559 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
44 return TNUM(a.value >> shift, a.mask >> shift);44 return TNUM(a.value >> shift, a.mask >> shift);
45}45}
46 46
47struct tnum tnum_arshift(struct tnum a, u8 min_shift)47struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness)
48{48{
49 /* if a.value is negative, arithmetic shifting by minimum shift49 /* if a.value is negative, arithmetic shifting by minimum shift
50 * will have larger negative offset compared to more shifting.50 * will have larger negative offset compared to more shifting.
51 * If a.value is nonnegative, arithmetic shifting by minimum shift51 * If a.value is nonnegative, arithmetic shifting by minimum shift
52 * will have larger positive offset compare to more shifting.52 * will have larger positive offset compare to more shifting.
53 */53 */
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);
55}60}
56 61
57struct tnum tnum_add(struct tnum a, struct tnum b)62struct 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
5049 /* Upon reaching here, src_known is true and5049 /* Upon reaching here, src_known is true and
5050 * umax_val is equal to umin_val.5050 * umax_val is equal to umin_val.
5051 */5051 */
5052 dst_reg->smin_value >>= umin_val;5052 if (insn_bitness == 32) {
5053 dst_reg->smax_value >>= umin_val;5053 dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val);
5054 dst_reg->var_off = tnum_arshift(dst_reg->var_off, 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);
5055 5062
5056 /* blow away the dst_reg umin_value/umax_value and rely on5063 /* blow away the dst_reg umin_value/umax_value and rely on
5057 * dst_reg var_off to refine the result.5064 * 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
1909}1909}
1910EXPORT_SYMBOL(__cpuhp_remove_state);1910EXPORT_SYMBOL(__cpuhp_remove_state);
1911 1911
1912#ifdef CONFIG_HOTPLUG_SMT
1913static 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
1922static 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
1931int 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
1963int 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
1912#if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU)1984#if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU)
1913static ssize_t show_cpuhp_state(struct device *dev,1985static ssize_t show_cpuhp_state(struct device *dev,
1914 struct device_attribute *attr, char *buf)1986 struct device_attribute *attr, char *buf)
@@ -2063,77 +2135,6 @@ static const struct attribute_group cpuhp_cpu_root_attr_group = { · 148 unmodified lines
2063 2135
2064#ifdef CONFIG_HOTPLUG_SMT2136#ifdef CONFIG_HOTPLUG_SMT
2065 2137
2066static 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
2075static 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
2084int 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
2116int 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
2137static ssize_t2138static ssize_t
2138__store_smt_control(struct device *dev, struct device_attribute *attr,2139__store_smt_control(struct device *dev, struct device_attribute *attr,
2139 const char *buf, size_t count)2140 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
175 put_cred(cred);175 put_cred(cred);
176 176
177#ifdef CONFIG_KEYS_REQUEST_CACHE177#ifdef CONFIG_KEYS_REQUEST_CACHE
178 key_put(current->cached_requested_key);178 key_put(tsk->cached_requested_key);
179 current->cached_requested_key = NULL;179 tsk->cached_requested_key = NULL;
180#endif180#endif
181}181}
182 182
kernel/events/core.c+3−1
@@ -11465,8 +11465,10 @@ SYSCALL_DEFINE5(perf_event_open, · 11464 unmodified lines
11465 }11465 }
11466 }11466 }
11467 11467
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;
11469 goto err_locked;11470 goto err_locked;
11471 }
11470 11472
11471 /*11473 /*
11472 * Must be under the same ctx::mutex as perf_install_in_context(),11474 * 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
1178 1178
1179/**1179/**
1180 * wait_for_owner_exiting - Block until the owner has exited1180 * wait_for_owner_exiting - Block until the owner has exited
1181 * @ret: owner's current futex lock status
1181 * @exiting: Pointer to the exiting task1182 * @exiting: Pointer to the exiting task
1182 *1183 *
1183 * Caller must hold a refcount on @exiting.1184 * 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
482 struct lock_trace *trace, *t2;482 struct lock_trace *trace, *t2;
483 struct hlist_head *hash_head;483 struct hlist_head *hash_head;
484 u32 hash;484 u32 hash;
485 unsigned int max_entries;485 int max_entries;
486 486
487 BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE);487 BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE);
488 BUILD_BUG_ON(LOCK_TRACE_SIZE_IN_LONGS >= MAX_STACK_TRACE_ENTRIES);488 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
490 trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries);490 trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries);
491 max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries -491 max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries -
492 LOCK_TRACE_SIZE_IN_LONGS;492 LOCK_TRACE_SIZE_IN_LONGS;
493 trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
494 493
495 if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES -494 if (max_entries <= 0) {
496 LOCK_TRACE_SIZE_IN_LONGS - 1) {
497 if (!debug_locks_off_graph_unlock())495 if (!debug_locks_off_graph_unlock())
498 return NULL;496 return NULL;
499 497
@@ -502,6 +500,7 @@ static struct lock_trace *save_trace(void) · 2 unmodified lines
502 500
503 return NULL;501 return NULL;
504 }502 }
503 trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
505 504
506 hash = jhash(trace->entries, trace->nr_entries *505 hash = jhash(trace->entries, trace->nr_entries *
507 sizeof(trace->entries[0]), 0);506 sizeof(trace->entries[0]), 0);
kernel/locking/rwsem.c+2−2
@@ -1226,8 +1226,8 @@ wait: · 1225 unmodified lines
1226 * In this case, we attempt to acquire the lock again1226 * In this case, we attempt to acquire the lock again
1227 * without sleeping.1227 * without sleeping.
1228 */1228 */
1229 if ((wstate == WRITER_HANDOFF) &&1229 if (wstate == WRITER_HANDOFF &&
1230 (rwsem_spin_on_owner(sem, 0) == OWNER_NULL))1230 rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL)
1231 goto trylock_again;1231 goto trylock_again;
1232 1232
1233 /* Block until there are no active lockers. */1233 /* 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
264 return ret;264 return ret;
265}265}
266 266
267static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode)267static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns,
268 unsigned int mode)
268{269{
270 int ret;
271
269 if (mode & PTRACE_MODE_NOAUDIT)272 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);
271 else274 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;
273}278}
274 279
275/* Returns 0 on success, -errno on denial. */280/* 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
321 gid_eq(caller_gid, tcred->sgid) &&326 gid_eq(caller_gid, tcred->sgid) &&
322 gid_eq(caller_gid, tcred->gid))327 gid_eq(caller_gid, tcred->gid))
323 goto ok;328 goto ok;
324 if (ptrace_has_cap(tcred->user_ns, mode))329 if (ptrace_has_cap(cred, tcred->user_ns, mode))
325 goto ok;330 goto ok;
326 rcu_read_unlock();331 rcu_read_unlock();
327 return -EPERM;332 return -EPERM;
@@ -340,7 +345,7 @@ ok: · 12 unmodified lines
340 mm = task->mm;345 mm = task->mm;
341 if (mm &&346 if (mm &&
342 ((get_dumpable(mm) != SUID_DUMP_USER) &&347 ((get_dumpable(mm) != SUID_DUMP_USER) &&
343 !ptrace_has_cap(mm->user_ns, mode)))348 !ptrace_has_cap(cred, mm->user_ns, mode)))
344 return -EPERM;349 return -EPERM;
345 350
346 return security_ptrace_access_check(task, mode);351 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
310 int ret;310 int ret;
311 311
312 if (flags & RSEQ_FLAG_UNREGISTER) {312 if (flags & RSEQ_FLAG_UNREGISTER) {
313 if (flags & ~RSEQ_FLAG_UNREGISTER)
314 return -EINVAL;
313 /* Unregister rseq for current thread. */315 /* Unregister rseq for current thread. */
314 if (current->rseq != rseq || !current->rseq)316 if (current->rseq != rseq || !current->rseq)
315 return -EINVAL;317 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
151 151
152#ifdef CONFIG_COMPAT152#ifdef CONFIG_COMPAT
153COMPAT_SYS_NI(timer_create);153COMPAT_SYS_NI(timer_create);
154#endif
155
156#if defined(CONFIG_COMPAT) || defined(CONFIG_ALPHA)
154COMPAT_SYS_NI(getitimer);157COMPAT_SYS_NI(getitimer);
155COMPAT_SYS_NI(setitimer);158COMPAT_SYS_NI(setitimer);
156#endif159#endif
kernel/time/tick-sched.c+9−5
@@ -58,8 +58,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 57 unmodified lines
58 58
59 /*59 /*
60 * Do a quick check without holding jiffies_lock:60 * Do a quick check without holding jiffies_lock:
61 * The READ_ONCE() pairs with two updates done later in this function.
61 */62 */
62 delta = ktime_sub(now, last_jiffies_update);63 delta = ktime_sub(now, READ_ONCE(last_jiffies_update));
63 if (delta < tick_period)64 if (delta < tick_period)
64 return;65 return;
65 66
@@ -70,8 +71,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 4 unmodified lines
70 if (delta >= tick_period) {71 if (delta >= tick_period) {
71 72
72 delta = ktime_sub(delta, tick_period);73 delta = ktime_sub(delta, tick_period);
73 last_jiffies_update = ktime_add(last_jiffies_update,74 /* Pairs with the lockless read in this function. */
74 tick_period);75 WRITE_ONCE(last_jiffies_update,
76 ktime_add(last_jiffies_update, tick_period));
75 77
76 /* Slow path for long timeouts */78 /* Slow path for long timeouts */
77 if (unlikely(delta >= tick_period)) {79 if (unlikely(delta >= tick_period)) {
@@ -79,8 +81,10 @@ static void tick_do_update_jiffies64(ktime_t now) · 1 unmodified line
79 81
80 ticks = ktime_divns(delta, incr);82 ticks = ktime_divns(delta, incr);
81 83
82 last_jiffies_update = ktime_add_ns(last_jiffies_update,84 /* Pairs with the lockless read in this function. */
83 incr * ticks);85 WRITE_ONCE(last_jiffies_update,
86 ktime_add_ns(last_jiffies_update,
87 incr * ticks));
84 }88 }
85 do_timer(++ticks);89 do_timer(++ticks);
86 90
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
221 return 0;221 return 0;
222}222}
223 223
224static __maybe_unused
224int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res)225int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res)
225{226{
226 int ret = __cvdso_clock_getres_common(clock, res);227 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
527 set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);527 set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
528}528}
529 529
530static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,530static unsigned long __thp_get_unmapped_area(struct file *filp,
531 unsigned long addr, unsigned long len,
531 loff_t off, unsigned long flags, unsigned long size)532 loff_t off, unsigned long flags, unsigned long size)
532{533{
533 unsigned long addr;
534 loff_t off_end = off + len;534 loff_t off_end = off + len;
535 loff_t off_align = round_up(off, size);535 loff_t off_align = round_up(off, size);
536 unsigned long len_pad;536 unsigned long len_pad, ret;
537 537
538 if (off_end <= off_align || (off_end - off_align) < size)538 if (off_end <= off_align || (off_end - off_align) < size)
539 return 0;539 return 0;
@@ -542,30 +542,40 @@ static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long le · 2 unmodified lines
542 if (len_pad < len || (off + len_pad) < off)542 if (len_pad < len || (off + len_pad) < off)
543 return 0;543 return 0;
544 544
545 addr = current->mm->get_unmapped_area(filp, 0, len_pad,545 ret = current->mm->get_unmapped_area(filp, addr, len_pad,
546 off >> PAGE_SHIFT, flags);546 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))
548 return 0;553 return 0;
549 554
550 addr += (off - addr) & (size - 1);555 /*
551 return addr;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;
552}564}
553 565
554unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,566unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
555 unsigned long len, unsigned long pgoff, unsigned long flags)567 unsigned long len, unsigned long pgoff, unsigned long flags)
556{568{
569 unsigned long ret;
557 loff_t off = (loff_t)pgoff << PAGE_SHIFT;570 loff_t off = (loff_t)pgoff << PAGE_SHIFT;
558 571
559 if (addr)
560 goto out;
561 if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD))572 if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD))
562 goto out;573 goto out;
563 574
564 addr = __thp_get_unmapped_area(filp, len, off, flags, PMD_SIZE);575 ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE);
565 if (addr)576 if (ret)
566 return addr;577 return ret;
567 578out:
568 out:
569 return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);579 return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);
570}580}
571EXPORT_SYMBOL_GPL(thp_get_unmapped_area);581EXPORT_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
3287 }3287 }
3288}3288}
3289 3289
3290static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg, bool slab_only)3290static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg)
3291{3291{
3292 unsigned long stat[MEMCG_NR_STAT];3292 unsigned long stat[MEMCG_NR_STAT] = {0};
3293 struct mem_cgroup *mi;3293 struct mem_cgroup *mi;
3294 int node, cpu, i;3294 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;
3307 3295
3308 for_each_online_cpu(cpu)3296 for_each_online_cpu(cpu)
3309 for (i = min_idx; i < max_idx; i++)3297 for (i = 0; i < MEMCG_NR_STAT; i++)
3310 stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu);3298 stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu);
3311 3299
3312 for (mi = memcg; mi; mi = parent_mem_cgroup(mi))3300 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++)
3314 atomic_long_add(stat[i], &mi->vmstats[i]);3302 atomic_long_add(stat[i], &mi->vmstats[i]);
3315 3303
3316 if (!slab_only)
3317 max_idx = NR_VM_NODE_STAT_ITEMS;
3318
3319 for_each_node(node) {3304 for_each_node(node) {
3320 struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];3305 struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];
3321 struct mem_cgroup_per_node *pi;3306 struct mem_cgroup_per_node *pi;
3322 3307
3323 for (i = min_idx; i < max_idx; i++)3308 for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
3324 stat[i] = 0;3309 stat[i] = 0;
3325 3310
3326 for_each_online_cpu(cpu)3311 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++)
3328 stat[i] += per_cpu(3313 stat[i] += per_cpu(
3329 pn->lruvec_stat_cpu->count[i], cpu);3314 pn->lruvec_stat_cpu->count[i], cpu);
3330 3315
3331 for (pi = pn; pi; pi = parent_nodeinfo(pi, node))3316 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++)
3333 atomic_long_add(stat[i], &pi->lruvec_stat[i]);3318 atomic_long_add(stat[i], &pi->lruvec_stat[i]);
3334 }3319 }
3335}3320}
@@ -3403,13 +3388,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) · 67 unmodified lines
3403 parent = root_mem_cgroup;3388 parent = root_mem_cgroup;
3404 3389
3405 /*3390 /*
3406 * Deactivate and reparent kmem_caches. Then flush percpu3391 * Deactivate and reparent kmem_caches.
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.
3410 */3392 */
3411 memcg_deactivate_kmem_caches(memcg, parent);3393 memcg_deactivate_kmem_caches(memcg, parent);
3412 memcg_flush_percpu_vmstats(memcg, true);
3413 3394
3414 kmemcg_id = memcg->kmemcg_id;3395 kmemcg_id = memcg->kmemcg_id;
3415 BUG_ON(kmemcg_id < 0);3396 BUG_ON(kmemcg_id < 0);
@@ -4913,7 +4894,7 @@ static void mem_cgroup_free(struct mem_cgroup *memcg) · 1497 unmodified lines
4913 * Flush percpu vmstats and vmevents to guarantee the value correctness4894 * Flush percpu vmstats and vmevents to guarantee the value correctness
4914 * on parent's and all ancestor levels.4895 * on parent's and all ancestor levels.
4915 */4896 */
4916 memcg_flush_percpu_vmstats(memcg, false);4897 memcg_flush_percpu_vmstats(memcg);
4917 memcg_flush_percpu_vmevents(memcg);4898 memcg_flush_percpu_vmevents(memcg);
4918 __mem_cgroup_free(memcg);4899 __mem_cgroup_free(memcg);
4919}4900}
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
2148 nmask = policy_nodemask(gfp, pol);2148 nmask = policy_nodemask(gfp, pol);
2149 if (!nmask || node_isset(hpage_node, *nmask)) {2149 if (!nmask || node_isset(hpage_node, *nmask)) {
2150 mpol_cond_put(pol);2150 mpol_cond_put(pol);
2151 /*
2152 * First, try to allocate THP only on local node, but
2153 * don't reclaim unnecessarily, just compact.
2154 */
2151 page = __alloc_pages_node(hpage_node,2155 page = __alloc_pages_node(hpage_node,
2152 gfp | __GFP_THISNODE, order);2156 gfp | __GFP_THISNODE | __GFP_NORETRY, order);
2153 2157
2154 /*2158 /*
2155 * If hugepage allocations are configured to always2159 * If hugepage allocations are configured to always
2156 * synchronous compact or the vma has been madvised2160 * synchronous compact or the vma has been madvised
2157 * to prefer hugepage backing, retry allowing remote2161 * to prefer hugepage backing, retry allowing remote
2158 * memory as well.2162 * memory with both reclaim and compact as well.
2159 */2163 */
2160 if (!page && (gfp & __GFP_DIRECT_RECLAIM))2164 if (!page && (gfp & __GFP_DIRECT_RECLAIM))
2161 page = __alloc_pages_node(hpage_node,2165 page = __alloc_pages_node(hpage_node,
2162 gfp | __GFP_NORETRY, order);2166 gfp, order);
2163 2167
2164 goto out;2168 goto out;
2165 }2169 }
mm/page-writeback.c+5−5
@@ -201,11 +201,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, · 200 unmodified lines
201 if (this_bw < tot_bw) {201 if (this_bw < tot_bw) {
202 if (min) {202 if (min) {
203 min *= this_bw;203 min *= this_bw;
204 do_div(min, tot_bw);204 min = div64_ul(min, tot_bw);
205 }205 }
206 if (max < 100) {206 if (max < 100) {
207 max *= this_bw;207 max *= this_bw;
208 do_div(max, tot_bw);208 max = div64_ul(max, tot_bw);
209 }209 }
210 }210 }
211 211
@@ -766,7 +766,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 554 unmodified lines
766 struct wb_domain *dom = dtc_dom(dtc);766 struct wb_domain *dom = dtc_dom(dtc);
767 unsigned long thresh = dtc->thresh;767 unsigned long thresh = dtc->thresh;
768 u64 wb_thresh;768 u64 wb_thresh;
769 long numerator, denominator;769 unsigned long numerator, denominator;
770 unsigned long wb_min_ratio, wb_max_ratio;770 unsigned long wb_min_ratio, wb_max_ratio;
771 771
772 /*772 /*
@@ -777,7 +777,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 4 unmodified lines
777 777
778 wb_thresh = (thresh * (100 - bdi_min_ratio)) / 100;778 wb_thresh = (thresh * (100 - bdi_min_ratio)) / 100;
779 wb_thresh *= numerator;779 wb_thresh *= numerator;
780 do_div(wb_thresh, denominator);780 wb_thresh = div64_ul(wb_thresh, denominator);
781 781
782 wb_min_max_ratio(dtc->wb, &wb_min_ratio, &wb_max_ratio);782 wb_min_max_ratio(dtc->wb, &wb_min_ratio, &wb_max_ratio);
783 783
@@ -1102,7 +1102,7 @@ static void wb_update_write_bandwidth(struct bdi_writeback *wb, · 318 unmodified lines
1102 bw = written - min(written, wb->written_stamp);1102 bw = written - min(written, wb->written_stamp);
1103 bw *= HZ;1103 bw *= HZ;
1104 if (unlikely(elapsed > period)) {1104 if (unlikely(elapsed > period)) {
1105 do_div(bw, elapsed);1105 bw = div64_ul(bw, elapsed);
1106 avg = bw;1106 avg = bw;
1107 goto out;1107 goto out;
1108 }1108 }
mm/page_alloc.c+18−43
@@ -694,34 +694,27 @@ void prep_compound_page(struct page *page, unsigned int order) · 693 unmodified lines
694#ifdef CONFIG_DEBUG_PAGEALLOC694#ifdef CONFIG_DEBUG_PAGEALLOC
695unsigned int _debug_guardpage_minorder;695unsigned int _debug_guardpage_minorder;
696 696
697#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT697bool _debug_pagealloc_enabled_early __read_mostly
698DEFINE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);698 = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT);
699#else699EXPORT_SYMBOL(_debug_pagealloc_enabled_early);
700DEFINE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);700DEFINE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
701#endif
702EXPORT_SYMBOL(_debug_pagealloc_enabled);701EXPORT_SYMBOL(_debug_pagealloc_enabled);
703 702
704DEFINE_STATIC_KEY_FALSE(_debug_guardpage_enabled);703DEFINE_STATIC_KEY_FALSE(_debug_guardpage_enabled);
705 704
706static int __init early_debug_pagealloc(char *buf)705static int __init early_debug_pagealloc(char *buf)
707{706{
708 bool enable = false;707 return kstrtobool(buf, &_debug_pagealloc_enabled_early);
709
710 if (kstrtobool(buf, &enable))
711 return -EINVAL;
712
713 if (enable)
714 static_branch_enable(&_debug_pagealloc_enabled);
715
716 return 0;
717}708}
718early_param("debug_pagealloc", early_debug_pagealloc);709early_param("debug_pagealloc", early_debug_pagealloc);
719 710
720static void init_debug_guardpage(void)711void init_debug_pagealloc(void)
721{712{
722 if (!debug_pagealloc_enabled())713 if (!debug_pagealloc_enabled())
723 return;714 return;
724 715
716 static_branch_enable(&_debug_pagealloc_enabled);
717
725 if (!debug_guardpage_minorder())718 if (!debug_guardpage_minorder())
726 return;719 return;
727 720
@@ -1186,7 +1179,7 @@ static __always_inline bool free_pages_prepare(struct page *page, · 458 unmodified lines
1186 */1179 */
1187 arch_free_page(page, order);1180 arch_free_page(page, order);
1188 1181
1189 if (debug_pagealloc_enabled())1182 if (debug_pagealloc_enabled_static())
1190 kernel_map_pages(page, 1 << order, 0);1183 kernel_map_pages(page, 1 << order, 0);
1191 1184
1192 kasan_free_nondeferred_pages(page, order);1185 kasan_free_nondeferred_pages(page, order);
@@ -1207,7 +1200,7 @@ static bool free_pcp_prepare(struct page *page) · 14 unmodified lines
1207 1200
1208static bool bulkfree_pcp_prepare(struct page *page)1201static bool bulkfree_pcp_prepare(struct page *page)
1209{1202{
1210 if (debug_pagealloc_enabled())1203 if (debug_pagealloc_enabled_static())
1211 return free_pages_check(page);1204 return free_pages_check(page);
1212 else1205 else
1213 return false;1206 return false;
@@ -1221,7 +1214,7 @@ static bool bulkfree_pcp_prepare(struct page *page) · 7 unmodified lines
1221 */1214 */
1222static bool free_pcp_prepare(struct page *page)1215static bool free_pcp_prepare(struct page *page)
1223{1216{
1224 if (debug_pagealloc_enabled())1217 if (debug_pagealloc_enabled_static())
1225 return free_pages_prepare(page, 0, true);1218 return free_pages_prepare(page, 0, true);
1226 else1219 else
1227 return free_pages_prepare(page, 0, false);1220 return free_pages_prepare(page, 0, false);
@@ -1973,10 +1966,6 @@ void __init page_alloc_init_late(void) · 745 unmodified lines
1973 1966
1974 for_each_populated_zone(zone)1967 for_each_populated_zone(zone)
1975 set_zone_contiguous(zone);1968 set_zone_contiguous(zone);
1976
1977#ifdef CONFIG_DEBUG_PAGEALLOC
1978 init_debug_guardpage();
1979#endif
1980}1969}
1981 1970
1982#ifdef CONFIG_CMA1971#ifdef CONFIG_CMA
@@ -2106,7 +2095,7 @@ static inline bool free_pages_prezeroed(void) · 123 unmodified lines
2106 */2095 */
2107static inline bool check_pcp_refill(struct page *page)2096static inline bool check_pcp_refill(struct page *page)
2108{2097{
2109 if (debug_pagealloc_enabled())2098 if (debug_pagealloc_enabled_static())
2110 return check_new_page(page);2099 return check_new_page(page);
2111 else2100 else
2112 return false;2101 return false;
@@ -2128,7 +2117,7 @@ static inline bool check_pcp_refill(struct page *page) · 15 unmodified lines
2128}2117}
2129static inline bool check_new_pcp(struct page *page)2118static inline bool check_new_pcp(struct page *page)
2130{2119{
2131 if (debug_pagealloc_enabled())2120 if (debug_pagealloc_enabled_static())
2132 return check_new_page(page);2121 return check_new_page(page);
2133 else2122 else
2134 return false;2123 return false;
@@ -2155,7 +2144,7 @@ inline void post_alloc_hook(struct page *page, unsigned int order, · 20 unmodified lines
2155 set_page_refcounted(page);2144 set_page_refcounted(page);
2156 2145
2157 arch_alloc_page(page, order);2146 arch_alloc_page(page, order);
2158 if (debug_pagealloc_enabled())2147 if (debug_pagealloc_enabled_static())
2159 kernel_map_pages(page, 1 << order, 1);2148 kernel_map_pages(page, 1 << order, 1);
2160 kasan_alloc_pages(page, order);2149 kasan_alloc_pages(page, order);
2161 kernel_poison_pages(page, 1 << order, 1);2150 kernel_poison_pages(page, 1 << order, 1);
@@ -4476,8 +4465,11 @@ retry_cpuset: · 2314 unmodified lines
4476 if (page)4465 if (page)
4477 goto got_pg;4466 goto got_pg;
4478 4467
4479 if (order >= pageblock_order && (gfp_mask & __GFP_IO) &&4468 /*
4480 !(gfp_mask & __GFP_RETRY_MAYFAIL)) {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)) {
4481 /*4473 /*
4482 * If allocating entire pageblock(s) and compaction4474 * If allocating entire pageblock(s) and compaction
4483 * failed because all zones are below low watermarks4475 * failed because all zones are below low watermarks
@@ -4498,23 +4490,6 @@ retry_cpuset: · 14 unmodified lines
4498 if (compact_result == COMPACT_SKIPPED ||4490 if (compact_result == COMPACT_SKIPPED ||
4499 compact_result == COMPACT_DEFERRED)4491 compact_result == COMPACT_DEFERRED)
4500 goto nopage;4492 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;
4518 4493
4519 /*4494 /*
4520 * Looks like reclaim/compaction is worth trying, but4495 * 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
2107 /*2107 /*
2108 * Our priority is to support MAP_SHARED mapped hugely;2108 * Our priority is to support MAP_SHARED mapped hugely;
2109 * and support MAP_PRIVATE mapped hugely too, until it is COWed.2109 * 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.
2111 */2112 */
2112 if (uaddr)2113 if (uaddr == addr)
2113 return addr;2114 return addr;
2114 2115
2115 if (shmem_huge != SHMEM_HUGE_FORCE) {2116 if (shmem_huge != SHMEM_HUGE_FORCE) {
@@ -2143,7 +2144,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, · 27 unmodified lines
2143 if (inflated_len < len)2144 if (inflated_len < len)
2144 return addr;2145 return addr;
2145 2146
2146 inflated_addr = get_area(NULL, 0, inflated_len, 0, flags);2147 inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags);
2147 if (IS_ERR_VALUE(inflated_addr))2148 if (IS_ERR_VALUE(inflated_addr))
2148 return addr;2149 return addr;
2149 if (inflated_addr & ~PAGE_MASK)2150 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
1416#if DEBUG1416#if DEBUG
1417static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)1417static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
1418{1418{
1419 if (debug_pagealloc_enabled() && OFF_SLAB(cachep) &&1419 if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) &&
1420 (cachep->size % PAGE_SIZE) == 0)1420 (cachep->size % PAGE_SIZE) == 0)
1421 return true;1421 return true;
1422 1422
@@ -2008,7 +2008,7 @@ int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags) · 585 unmodified lines
2008 * to check size >= 256. It guarantees that all necessary small2008 * to check size >= 256. It guarantees that all necessary small
2009 * sized slab is initialized in current slab initialization sequence.2009 * sized slab is initialized in current slab initialization sequence.
2010 */2010 */
2011 if (debug_pagealloc_enabled() && (flags & SLAB_POISON) &&2011 if (debug_pagealloc_enabled_static() && (flags & SLAB_POISON) &&
2012 size >= 256 && cachep->object_size > cache_line_size()) {2012 size >= 256 && cachep->object_size > cache_line_size()) {
2013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) {2013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) {
2014 size_t tmp_size = ALIGN(size, PAGE_SIZE);2014 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
903 * deactivates the memcg kmem_caches through workqueue. Make sure all903 * deactivates the memcg kmem_caches through workqueue. Make sure all
904 * previous workitems on workqueue are processed.904 * previous workitems on workqueue are processed.
905 */905 */
906 flush_workqueue(memcg_kmem_cache_wq);906 if (likely(memcg_kmem_cache_wq))
907 flush_workqueue(memcg_kmem_cache_wq);
907 908
908 /*909 /*
909 * If we're racing with children kmem_cache deactivation, it might910 * 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
288 unsigned long freepointer_addr;288 unsigned long freepointer_addr;
289 void *p;289 void *p;
290 290
291 if (!debug_pagealloc_enabled())291 if (!debug_pagealloc_enabled_static())
292 return get_freepointer(s, object);292 return get_freepointer(s, object);
293 293
294 freepointer_addr = (unsigned long)object + s->offset;294 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
777 if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) {777 if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) {
778 unsigned long section_nr = pfn_to_section_nr(pfn);778 unsigned long section_nr = pfn_to_section_nr(pfn);
779 779
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))) {
781 kfree(ms->usage);788 kfree(ms->usage);
782 ms->usage = NULL;789 ms->usage = NULL;
783 }790 }
mm/vmalloc.c+2−2
@@ -1383,7 +1383,7 @@ static void free_unmap_vmap_area(struct vmap_area *va) · 1382 unmodified lines
1383{1383{
1384 flush_cache_vunmap(va->va_start, va->va_end);1384 flush_cache_vunmap(va->va_start, va->va_end);
1385 unmap_vmap_area(va);1385 unmap_vmap_area(va);
1386 if (debug_pagealloc_enabled())1386 if (debug_pagealloc_enabled_static())
1387 flush_tlb_kernel_range(va->va_start, va->va_end);1387 flush_tlb_kernel_range(va->va_start, va->va_end);
1388 1388
1389 free_vmap_area_noflush(va);1389 free_vmap_area_noflush(va);
@@ -1681,7 +1681,7 @@ static void vb_free(const void *addr, unsigned long size) · 291 unmodified lines
1681 1681
1682 vunmap_page_range((unsigned long)addr, (unsigned long)addr + size);1682 vunmap_page_range((unsigned long)addr, (unsigned long)addr + size);
1683 1683
1684 if (debug_pagealloc_enabled())1684 if (debug_pagealloc_enabled_static())
1685 flush_tlb_kernel_range((unsigned long)addr,1685 flush_tlb_kernel_range((unsigned long)addr,
1686 (unsigned long)addr + size);1686 (unsigned long)addr + size);
1687 1687
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
285 u32 hash = 0;285 u32 hash = 0;
286 const struct batadv_dat_entry *dat = data;286 const struct batadv_dat_entry *dat = data;
287 const unsigned char *key;287 const unsigned char *key;
288 __be16 vid;
288 u32 i;289 u32 i;
289 290
290 key = (const unsigned char *)&dat->ip;291 key = (const unsigned char *)&dat->ip;
@@ -294,7 +295,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) · 3 unmodified lines
294 hash ^= (hash >> 6);295 hash ^= (hash >> 6);
295 }296 }
296 297
297 key = (const unsigned char *)&dat->vid;298 vid = htons(dat->vid);
299 key = (__force const unsigned char *)&vid;
298 for (i = 0; i < sizeof(dat->vid); i++) {300 for (i = 0; i < sizeof(dat->vid); i++) {
299 hash += key[i];301 hash += key[i];
300 hash += (hash << 10);302 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
9177 9177
9178void netdev_update_lockdep_key(struct net_device *dev)9178void netdev_update_lockdep_key(struct net_device *dev)
9179{9179{
9180 struct netdev_queue *queue;
9181 int i;
9182
9183 lockdep_unregister_key(&dev->qdisc_xmit_lock_key);
9184 lockdep_unregister_key(&dev->addr_list_lock_key);9180 lockdep_unregister_key(&dev->addr_list_lock_key);
9185
9186 lockdep_register_key(&dev->qdisc_xmit_lock_key);
9187 lockdep_register_key(&dev->addr_list_lock_key);9181 lockdep_register_key(&dev->addr_list_lock_key);
9188 9182
9189 lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key);9183 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 }
9196}9184}
9197EXPORT_SYMBOL(netdev_update_lockdep_key);9185EXPORT_SYMBOL(netdev_update_lockdep_key);
9198 9186
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
6406 devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA;6406 devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA;
6407}6407}
6408 6408
6409#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30)6409#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600)
6410 6410
6411static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port)6411static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port)
6412{6412{
@@ -7563,7 +7563,7 @@ void devlink_region_destroy(struct devlink_region *region) · 1150 unmodified lines
7563EXPORT_SYMBOL_GPL(devlink_region_destroy);7563EXPORT_SYMBOL_GPL(devlink_region_destroy);
7564 7564
7565/**7565/**
7566 * devlink_region_shapshot_id_get - get snapshot ID7566 * devlink_region_snapshot_id_get - get snapshot ID
7567 *7567 *
7568 * This callback should be called when adding a new snapshot,7568 * This callback should be called when adding a new snapshot,
7569 * Driver should use the same id for multiple snapshots taken7569 * Driver should use the same id for multiple snapshots taken
@@ -7571,7 +7571,7 @@ EXPORT_SYMBOL_GPL(devlink_region_destroy); · 1 unmodified line
7571 *7571 *
7572 * @devlink: devlink7572 * @devlink: devlink
7573 */7573 */
7574u32 devlink_region_shapshot_id_get(struct devlink *devlink)7574u32 devlink_region_snapshot_id_get(struct devlink *devlink)
7575{7575{
7576 u32 id;7576 u32 id;
7577 7577
@@ -7581,7 +7581,7 @@ u32 devlink_region_shapshot_id_get(struct devlink *devlink) · 3 unmodified lines
7581 7581
7582 return id;7582 return id;
7583}7583}
7584EXPORT_SYMBOL_GPL(devlink_region_shapshot_id_get);7584EXPORT_SYMBOL_GPL(devlink_region_snapshot_id_get);
7585 7585
7586/**7586/**
7587 * devlink_region_snapshot_create - create a new snapshot7587 * 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
2231 /* First find the starting scatterlist element */2231 /* First find the starting scatterlist element */
2232 i = msg->sg.start;2232 i = msg->sg.start;
2233 do {2233 do {
2234 offset += len;
2234 len = sk_msg_elem(msg, i)->length;2235 len = sk_msg_elem(msg, i)->length;
2235 if (start < offset + len)2236 if (start < offset + len)
2236 break;2237 break;
2237 offset += len;
2238 sk_msg_iter_var_next(i);2238 sk_msg_iter_var_next(i);
2239 } while (i != msg->sg.end);2239 } while (i != msg->sg.end);
2240 2240
@@ -2346,7 +2346,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 105 unmodified lines
2346 u32, len, u64, flags)2346 u32, len, u64, flags)
2347{2347{
2348 struct scatterlist sge, nsge, nnsge, rsge = {0}, *psge;2348 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;
2350 u8 *raw, *to, *from;2350 u8 *raw, *to, *from;
2351 struct page *page;2351 struct page *page;
2352 2352
@@ -2356,11 +2356,11 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines
2356 /* First find the starting scatterlist element */2356 /* First find the starting scatterlist element */
2357 i = msg->sg.start;2357 i = msg->sg.start;
2358 do {2358 do {
2359 offset += l;
2359 l = sk_msg_elem(msg, i)->length;2360 l = sk_msg_elem(msg, i)->length;
2360 2361
2361 if (start < offset + l)2362 if (start < offset + l)
2362 break;2363 break;
2363 offset += l;
2364 sk_msg_iter_var_next(i);2364 sk_msg_iter_var_next(i);
2365 } while (i != msg->sg.end);2365 } while (i != msg->sg.end);
2366 2366
@@ -2415,6 +2415,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 48 unmodified lines
2415 2415
2416 sk_msg_iter_var_next(i);2416 sk_msg_iter_var_next(i);
2417 sg_unmark_end(psge);2417 sg_unmark_end(psge);
2418 sg_unmark_end(&rsge);
2418 sk_msg_iter_next(msg, end);2419 sk_msg_iter_next(msg, end);
2419 }2420 }
2420 2421
@@ -2506,7 +2507,7 @@ static void sk_msg_shift_right(struct sk_msg *msg, int i) · 85 unmodified lines
2506BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,2507BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,
2507 u32, len, u64, flags)2508 u32, len, u64, flags)
2508{2509{
2509 u32 i = 0, l, space, offset = 0;2510 u32 i = 0, l = 0, space, offset = 0;
2510 u64 last = start + len;2511 u64 last = start + len;
2511 int pop;2512 int pop;
2512 2513
@@ -2516,11 +2517,11 @@ BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines
2516 /* First find the starting scatterlist element */2517 /* First find the starting scatterlist element */
2517 i = msg->sg.start;2518 i = msg->sg.start;
2518 do {2519 do {
2520 offset += l;
2519 l = sk_msg_elem(msg, i)->length;2521 l = sk_msg_elem(msg, i)->length;
2520 2522
2521 if (start < offset + l)2523 if (start < offset + l)
2522 break;2524 break;
2523 offset += l;
2524 sk_msg_iter_var_next(i);2525 sk_msg_iter_var_next(i);
2525 } while (i != msg->sg.end);2526 } while (i != msg->sg.end);
2526 2527
@@ -5318,8 +5319,7 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 2791 unmodified lines
5318 if (sk) {5319 if (sk) {
5319 sk = sk_to_full_sk(sk);5320 sk = sk_to_full_sk(sk);
5320 if (!sk_fullsock(sk)) {5321 if (!sk_fullsock(sk)) {
5321 if (!sock_flag(sk, SOCK_RCU_FREE))5322 sock_gen_put(sk);
5322 sock_gen_put(sk);
5323 return NULL;5323 return NULL;
5324 }5324 }
5325 }5325 }
@@ -5356,8 +5356,7 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 30 unmodified lines
5356 if (sk) {5356 if (sk) {
5357 sk = sk_to_full_sk(sk);5357 sk = sk_to_full_sk(sk);
5358 if (!sk_fullsock(sk)) {5358 if (!sk_fullsock(sk)) {
5359 if (!sock_flag(sk, SOCK_RCU_FREE))5359 sock_gen_put(sk);
5360 sock_gen_put(sk);
5361 return NULL;5360 return NULL;
5362 }5361 }
5363 }5362 }
@@ -5424,7 +5423,8 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { · 60 unmodified lines
5424 5423
5425BPF_CALL_1(bpf_sk_release, struct sock *, sk)5424BPF_CALL_1(bpf_sk_release, struct sock *, sk)
5426{5425{
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))
5428 sock_gen_put(sk);5428 sock_gen_put(sk);
5429 return 0;5429 return 0;
5430}5430}
net/core/skmsg.c+2−0
@@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(sk_psock_destroy); · 593 unmodified lines
594 594
595void sk_psock_drop(struct sock *sk, struct sk_psock *psock)595void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
596{596{
597 sock_owned_by_me(sk);
598
597 sk_psock_cork_free(psock);599 sk_psock_cork_free(psock);
598 sk_psock_zap_ingress(psock);600 sk_psock_zap_ingress(psock);
599 601
net/core/sock_map.c+6−1
@@ -241,8 +241,11 @@ static void sock_map_free(struct bpf_map *map) · 240 unmodified lines
241 struct sock *sk;241 struct sock *sk;
242 242
243 sk = xchg(psk, NULL);243 sk = xchg(psk, NULL);
244 if (sk)244 if (sk) {
245 lock_sock(sk);
245 sock_map_unref(sk, psk);246 sock_map_unref(sk, psk);
247 release_sock(sk);
248 }
246 }249 }
247 raw_spin_unlock_bh(&stab->lock);250 raw_spin_unlock_bh(&stab->lock);
248 rcu_read_unlock();251 rcu_read_unlock();
@@ -862,7 +865,9 @@ static void sock_hash_free(struct bpf_map *map) · 613 unmodified lines
862 raw_spin_lock_bh(&bucket->lock);865 raw_spin_lock_bh(&bucket->lock);
863 hlist_for_each_entry_safe(elem, node, &bucket->head, node) {866 hlist_for_each_entry_safe(elem, node, &bucket->head, node) {
864 hlist_del_rcu(&elem->node);867 hlist_del_rcu(&elem->node);
868 lock_sock(elem->sk);
865 sock_map_unref(elem->sk, elem);869 sock_map_unref(elem->sk, elem);
870 release_sock(elem->sk);
866 }871 }
867 raw_spin_unlock_bh(&bucket->lock);872 raw_spin_unlock_bh(&bucket->lock);
868 }873 }
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
104}104}
105 105
106static const struct dsa_device_ops gswip_netdev_ops = {106static const struct dsa_device_ops gswip_netdev_ops = {
107 .name = "gwsip",107 .name = "gswip",
108 .proto = DSA_TAG_PROTO_GSWIP,108 .proto = DSA_TAG_PROTO_GSWIP,
109 .xmit = gswip_tag_xmit,109 .xmit = gswip_tag_xmit,
110 .rcv = gswip_tag_rcv,110 .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
33 struct dsa_port *dp = dsa_slave_to_port(dev);33 struct dsa_port *dp = dsa_slave_to_port(dev);
34 u16 *phdr, hdr;34 u16 *phdr, hdr;
35 35
36 dev->stats.tx_packets++;
37 dev->stats.tx_bytes += skb->len;
38
39 if (skb_cow_head(skb, 0) < 0)36 if (skb_cow_head(skb, 0) < 0)
40 return NULL;37 return NULL;
41 38
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
2193 int count = cb->args[2];2193 int count = cb->args[2];
2194 t_key key = cb->args[3];2194 t_key key = cb->args[3];
2195 2195
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
2196 while ((l = leaf_walk_rcu(&tp, key)) != NULL) {2202 while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
2197 int err;2203 int err;
2198 2204
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
496 return 0;496 return 0;
497}497}
498 498
499static inline void cleanup_entry(struct arpt_entry *e)499static void cleanup_entry(struct arpt_entry *e, struct net *net)
500{500{
501 struct xt_tgdtor_param par;501 struct xt_tgdtor_param par;
502 struct xt_entry_target *t;502 struct xt_entry_target *t;
503 503
504 t = arpt_get_target(e);504 t = arpt_get_target(e);
505 par.net = net;
505 par.target = t->u.kernel.target;506 par.target = t->u.kernel.target;
506 par.targinfo = t->data;507 par.targinfo = t->data;
507 par.family = NFPROTO_ARP;508 par.family = NFPROTO_ARP;
@@ -584,7 +585,7 @@ static int translate_table(struct net *net, · 76 unmodified lines
584 xt_entry_foreach(iter, entry0, newinfo->size) {585 xt_entry_foreach(iter, entry0, newinfo->size) {
585 if (i-- == 0)586 if (i-- == 0)
586 break;587 break;
587 cleanup_entry(iter);588 cleanup_entry(iter, net);
588 }589 }
589 return ret;590 return ret;
590 }591 }
@@ -927,7 +928,7 @@ static int __do_replace(struct net *net, const char *name, · 336 unmodified lines
927 /* Decrease module usage counts and free resource */928 /* Decrease module usage counts and free resource */
928 loc_cpu_old_entry = oldinfo->entries;929 loc_cpu_old_entry = oldinfo->entries;
929 xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size)930 xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size)
930 cleanup_entry(iter);931 cleanup_entry(iter, net);
931 932
932 xt_free_table_info(oldinfo);933 xt_free_table_info(oldinfo);
933 if (copy_to_user(counters_ptr, counters,934 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
990 991
991 free_newinfo_untrans:992 free_newinfo_untrans:
992 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)993 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
993 cleanup_entry(iter);994 cleanup_entry(iter, net);
994 free_newinfo:995 free_newinfo:
995 xt_free_table_info(newinfo);996 xt_free_table_info(newinfo);
996 return ret;997 return ret;
@@ -1287,7 +1288,7 @@ static int compat_do_replace(struct net *net, void __user *user, · 290 unmodified lines
1287 1288
1288 free_newinfo_untrans:1289 free_newinfo_untrans:
1289 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)1290 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
1290 cleanup_entry(iter);1291 cleanup_entry(iter, net);
1291 free_newinfo:1292 free_newinfo:
1292 xt_free_table_info(newinfo);1293 xt_free_table_info(newinfo);
1293 return ret;1294 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
1514 return ret;1515 return ret;
1515}1516}
1516 1517
1517static void __arpt_unregister_table(struct xt_table *table)1518static void __arpt_unregister_table(struct net *net, struct xt_table *table)
1518{1519{
1519 struct xt_table_info *private;1520 struct xt_table_info *private;
1520 void *loc_cpu_entry;1521 void *loc_cpu_entry;
@@ -1526,7 +1527,7 @@ static void __arpt_unregister_table(struct xt_table *table) · 5 unmodified lines
1526 /* Decrease module usage counts and free resources */1527 /* Decrease module usage counts and free resources */
1527 loc_cpu_entry = private->entries;1528 loc_cpu_entry = private->entries;
1528 xt_entry_foreach(iter, loc_cpu_entry, private->size)1529 xt_entry_foreach(iter, loc_cpu_entry, private->size)
1529 cleanup_entry(iter);1530 cleanup_entry(iter, net);
1530 if (private->number > private->initial_entries)1531 if (private->number > private->initial_entries)
1531 module_put(table_owner);1532 module_put(table_owner);
1532 xt_free_table_info(private);1533 xt_free_table_info(private);
@@ -1566,7 +1567,7 @@ int arpt_register_table(struct net *net, · 33 unmodified lines
1566 1567
1567 ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));1568 ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));
1568 if (ret != 0) {1569 if (ret != 0) {
1569 __arpt_unregister_table(new_table);1570 __arpt_unregister_table(net, new_table);
1570 *res = NULL;1571 *res = NULL;
1571 }1572 }
1572 1573
@@ -1581,7 +1582,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table, · 8 unmodified lines
1581 const struct nf_hook_ops *ops)1582 const struct nf_hook_ops *ops)
1582{1583{
1583 nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));1584 nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
1584 __arpt_unregister_table(table);1585 __arpt_unregister_table(net, table);
1585}1586}
1586 1587
1587/* The built-in targets: standard (NULL) and error. */1588/* 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
121 struct sk_psock *psock;121 struct sk_psock *psock;
122 int copied, ret;122 int copied, ret;
123 123
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
129 psock = sk_psock_get(sk);124 psock = sk_psock_get(sk);
130 if (unlikely(!psock))125 if (unlikely(!psock))
131 return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);126 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);
132 lock_sock(sk);132 lock_sock(sk);
133msg_bytes_ready:133msg_bytes_ready:
134 copied = __tcp_bpf_recvmsg(sk, psock, msg, len, flags);134 copied = __tcp_bpf_recvmsg(sk, psock, msg, len, flags);
@@ -139,7 +139,7 @@ msg_bytes_ready: · 4 unmodified lines
139 timeo = sock_rcvtimeo(sk, nonblock);139 timeo = sock_rcvtimeo(sk, nonblock);
140 data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err);140 data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err);
141 if (data) {141 if (data) {
142 if (skb_queue_empty(&sk->sk_receive_queue))142 if (!sk_psock_queue_empty(psock))
143 goto msg_bytes_ready;143 goto msg_bytes_ready;
144 release_sock(sk);144 release_sock(sk);
145 sk_psock_put(sk, psock);145 sk_psock_put(sk, psock);
@@ -315,10 +315,7 @@ more_data: · 169 unmodified lines
315 */315 */
316 delta = msg->sg.size;316 delta = msg->sg.size;
317 psock->eval = sk_psock_msg_verdict(sk, psock, msg);317 psock->eval = sk_psock_msg_verdict(sk, psock, msg);
318 if (msg->sg.size < delta)318 delta -= msg->sg.size;
319 delta -= msg->sg.size;
320 else
321 delta = 0;
322 }319 }
323 320
324 if (msg->cork_bytes &&321 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
915/* This must be called before lost_out is incremented */915/* This must be called before lost_out is incremented */
916static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)916static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)
917{917{
918 if (!tp->retransmit_skb_hint ||918 if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) ||
919 before(TCP_SKB_CB(skb)->seq,919 (tp->retransmit_skb_hint &&
920 TCP_SKB_CB(tp->retransmit_skb_hint)->seq))920 before(TCP_SKB_CB(skb)->seq,
921 TCP_SKB_CB(tp->retransmit_skb_hint)->seq)))
921 tp->retransmit_skb_hint = skb;922 tp->retransmit_skb_hint = skb;
922}923}
923 924
net/ipv4/tcp_ulp.c+4−2
@@ -99,17 +99,19 @@ void tcp_get_available_ulp(char *buf, size_t maxlen) · 98 unmodified lines
99 rcu_read_unlock();99 rcu_read_unlock();
100}100}
101 101
102void tcp_update_ulp(struct sock *sk, struct proto *proto)102void tcp_update_ulp(struct sock *sk, struct proto *proto,
103 void (*write_space)(struct sock *sk))
103{104{
104 struct inet_connection_sock *icsk = inet_csk(sk);105 struct inet_connection_sock *icsk = inet_csk(sk);
105 106
106 if (!icsk->icsk_ulp_ops) {107 if (!icsk->icsk_ulp_ops) {
108 sk->sk_write_space = write_space;
107 sk->sk_prot = proto;109 sk->sk_prot = proto;
108 return;110 return;
109 }111 }
110 112
111 if (icsk->icsk_ulp_ops->update)113 if (icsk->icsk_ulp_ops->update)
112 icsk->icsk_ulp_ops->update(sk, proto);114 icsk->icsk_ulp_ops->update(sk, proto, write_space);
113}115}
114 116
115void tcp_cleanup_ulp(struct sock *sk)117void 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
2954 return err;2954 return err;
2955}2955}
2956 2956
2957static 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
2957static struct cfg80211_beacon_data *2979static struct cfg80211_beacon_data *
2958cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)2980cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
2959{2981{
@@ -4023,6 +4045,7 @@ const struct cfg80211_ops mac80211_config_ops = { · 1063 unmodified lines
4023#endif4045#endif
4024 .get_channel = ieee80211_cfg_get_channel,4046 .get_channel = ieee80211_cfg_get_channel,
4025 .start_radar_detection = ieee80211_start_radar_detection,4047 .start_radar_detection = ieee80211_start_radar_detection,
4048 .end_cac = ieee80211_end_cac,
4026 .channel_switch = ieee80211_channel_switch,4049 .channel_switch = ieee80211_channel_switch,
4027 .set_qos_map = ieee80211_set_qos_map,4050 .set_qos_map = ieee80211_set_qos_map,
4028 .set_ap_chanwidth = ieee80211_set_ap_chanwidth,4051 .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
328 unsigned long fail_avg =328 unsigned long fail_avg =
329 ewma_mesh_fail_avg_read(&sta->mesh->fail_avg);329 ewma_mesh_fail_avg_read(&sta->mesh->fail_avg);
330 330
331 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
332 return MAX_METRIC;
333
331 /* Try to get rate based on HW/SW RC algorithm.334 /* Try to get rate based on HW/SW RC algorithm.
332 * Rate is returned in units of Kbps, correct this335 * Rate is returned in units of Kbps, correct this
333 * to comply with airtime calculation units336 * 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
263 if ((keyid >> 6) != key->conf.keyidx)263 if ((keyid >> 6) != key->conf.keyidx)
264 return TKIP_DECRYPT_INVALID_KEYIDX;264 return TKIP_DECRYPT_INVALID_KEYIDX;
265 265
266 if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT &&266 /* Reject replays if the received TSC is smaller than or equal to the
267 (iv32 < rx_ctx->iv32 ||267 * last received value in a valid message, but with an exception for
268 (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16)))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)))))
269 return TKIP_DECRYPT_REPLAY;281 return TKIP_DECRYPT_REPLAY;
270 282
271 if (only_iv) {283 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
60 if (SET_WITH_TIMEOUT(set))60 if (SET_WITH_TIMEOUT(set))
61 del_timer_sync(&map->gc);61 del_timer_sync(&map->gc);
62 62
63 ip_set_free(map->members);
64 if (set->dsize && set->extensions & IPSET_EXT_DESTROY)63 if (set->dsize && set->extensions & IPSET_EXT_DESTROY)
65 mtype_ext_cleanup(set);64 mtype_ext_cleanup(set);
65 ip_set_free(map->members);
66 ip_set_free(map);66 ip_set_free(map);
67 67
68 set->data = NULL;68 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
233 return false;233 return false;
234 234
235 hdr = (struct icmphdr *)(skb->data + hdroff);235 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 }
236 inet_proto_csum_replace2(&hdr->checksum, skb,249 inet_proto_csum_replace2(&hdr->checksum, skb,
237 hdr->un.echo.id, tuple->src.u.icmp.id, false);250 hdr->un.echo.id, tuple->src.u.icmp.id, false);
238 hdr->un.echo.id = tuple->src.u.icmp.id;251 hdr->un.echo.id = tuple->src.u.icmp.id;
net/netfilter/nf_tables_api.c+26−13
@@ -22,6 +22,8 @@ · 21 unmodified lines
22#include <net/net_namespace.h>22#include <net/net_namespace.h>
23#include <net/sock.h>23#include <net/sock.h>
24 24
25#define NFT_MODULE_AUTOLOAD_LIMIT (MODULE_NAME_LEN - sizeof("nft-expr-255-"))
26
25static LIST_HEAD(nf_tables_expressions);27static LIST_HEAD(nf_tables_expressions);
26static LIST_HEAD(nf_tables_objects);28static LIST_HEAD(nf_tables_objects);
27static LIST_HEAD(nf_tables_flowtables);29static LIST_HEAD(nf_tables_flowtables);
@@ -564,33 +566,34 @@ __nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family) · 536 unmodified lines
564}566}
565 567
566/*568/*
567 * Loading a module requires dropping mutex that guards the569 * Loading a module requires dropping mutex that guards the transaction.
568 * transaction.570 * A different client might race to start a new transaction meanwhile. Zap the
569 * We first need to abort any pending transactions as once571 * list of pending transaction and then restore it once the mutex is grabbed
570 * mutex is unlocked a different client could start a new572 * again. Users of this function return EAGAIN which implicitly triggers the
571 * transaction. It must not see any 'future generation'573 * transaction abort path to clean up the list of pending transactions.
572 * changes * as these changes will never happen.
573 */574 */
574#ifdef CONFIG_MODULES575#ifdef CONFIG_MODULES
575static int __nf_tables_abort(struct net *net);
576
577static void nft_request_module(struct net *net, const char *fmt, ...)576static void nft_request_module(struct net *net, const char *fmt, ...)
578{577{
579 char module_name[MODULE_NAME_LEN];578 char module_name[MODULE_NAME_LEN];
579 LIST_HEAD(commit_list);
580 va_list args;580 va_list args;
581 int ret;581 int ret;
582 582
583 __nf_tables_abort(net);583 list_splice_init(&net->nft.commit_list, &commit_list);
584 584
585 va_start(args, fmt);585 va_start(args, fmt);
586 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);586 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
587 va_end(args);587 va_end(args);
588 if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret))588 if (ret >= MODULE_NAME_LEN)
589 return;589 return;
590 590
591 mutex_unlock(&net->nft.commit_mutex);591 mutex_unlock(&net->nft.commit_mutex);
592 request_module("%s", module_name);592 request_module("%s", module_name);
593 mutex_lock(&net->nft.commit_mutex);593 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);
594}597}
595#endif598#endif
596 599
@@ -1045,12 +1048,18 @@ static int nft_flush_table(struct nft_ctx *ctx) · 448 unmodified lines
1045 }1048 }
1046 1049
1047 list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) {1050 list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) {
1051 if (!nft_is_active_next(ctx->net, flowtable))
1052 continue;
1053
1048 err = nft_delflowtable(ctx, flowtable);1054 err = nft_delflowtable(ctx, flowtable);
1049 if (err < 0)1055 if (err < 0)
1050 goto out;1056 goto out;
1051 }1057 }
1052 1058
1053 list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) {1059 list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) {
1060 if (!nft_is_active_next(ctx->net, obj))
1061 continue;
1062
1054 err = nft_delobj(ctx, obj);1063 err = nft_delobj(ctx, obj);
1055 if (err < 0)1064 if (err < 0)
1056 goto out;1065 goto out;
@@ -1241,7 +1250,8 @@ static const struct nla_policy nft_chain_policy[NFTA_CHAIN_MAX + 1] = { · 184 unmodified lines
1241 .len = NFT_CHAIN_MAXNAMELEN - 1 },1250 .len = NFT_CHAIN_MAXNAMELEN - 1 },
1242 [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED },1251 [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED },
1243 [NFTA_CHAIN_POLICY] = { .type = NLA_U32 },1252 [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 },
1245 [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED },1255 [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED },
1246 [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 },1256 [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 },
1247};1257};
@@ -1676,6 +1686,7 @@ static int nf_tables_parse_netdev_hooks(struct net *net, · 428 unmodified lines
1676 goto err_hook;1686 goto err_hook;
1677 }1687 }
1678 if (nft_hook_list_find(hook_list, hook)) {1688 if (nft_hook_list_find(hook_list, hook)) {
1689 kfree(hook);
1679 err = -EEXIST;1690 err = -EEXIST;
1680 goto err_hook;1691 goto err_hook;
1681 }1692 }
@@ -2355,7 +2366,8 @@ static const struct nft_expr_type *nft_expr_type_get(struct net *net, · 673 unmodified lines
2355}2366}
2356 2367
2357static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = {2368static 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 },
2359 [NFTA_EXPR_DATA] = { .type = NLA_NESTED },2371 [NFTA_EXPR_DATA] = { .type = NLA_NESTED },
2360};2372};
2361 2373
@@ -4198,7 +4210,8 @@ static const struct nla_policy nft_set_elem_policy[NFTA_SET_ELEM_MAX + 1] = { · 1836 unmodified lines
4198 [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY,4210 [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY,
4199 .len = NFT_USERDATA_MAXLEN },4211 .len = NFT_USERDATA_MAXLEN },
4200 [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED },4212 [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 },
4202};4215};
4203 4216
4204static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {4217static 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
76 struct nft_tunnel *priv = nft_expr_priv(expr);76 struct nft_tunnel *priv = nft_expr_priv(expr);
77 u32 len;77 u32 len;
78 78
79 if (!tb[NFTA_TUNNEL_KEY] &&79 if (!tb[NFTA_TUNNEL_KEY] ||
80 !tb[NFTA_TUNNEL_DREG])80 !tb[NFTA_TUNNEL_DREG])
81 return -EINVAL;81 return -EINVAL;
82 82
@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr, · 183 unmodified lines
266 if (err < 0)266 if (err < 0)
267 return err;267 return err;
268 268
269 if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
270 return -EINVAL;
271
269 version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));272 version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
270 switch (version) {273 switch (version) {
271 case ERSPAN_VERSION:274 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
360 return tcf_idr_search(tn, a, index);360 return tcf_idr_search(tn, a, index);
361}361}
362 362
363static 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
363static struct tc_action_ops act_ctinfo_ops = {373static struct tc_action_ops act_ctinfo_ops = {
364 .kind = "ctinfo",374 .kind = "ctinfo",
365 .id = TCA_ID_CTINFO,375 .id = TCA_ID_CTINFO,
@@ -367,6 +377,7 @@ static struct tc_action_ops act_ctinfo_ops = { · 1 unmodified line
367 .act = tcf_ctinfo_act,377 .act = tcf_ctinfo_act,
368 .dump = tcf_ctinfo_dump,378 .dump = tcf_ctinfo_dump,
369 .init = tcf_ctinfo_init,379 .init = tcf_ctinfo_init,
380 .cleanup= tcf_ctinfo_cleanup,
370 .walk = tcf_ctinfo_walker,381 .walk = tcf_ctinfo_walker,
371 .lookup = tcf_ctinfo_search,382 .lookup = tcf_ctinfo_search,
372 .size = sizeof(struct tcf_ctinfo),383 .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
537 }537 }
538 538
539 ife = to_ife(*a);539 ife = to_ife(*a);
540 if (ret == ACT_P_CREATED)
541 INIT_LIST_HEAD(&ife->metalist);
542
540 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);543 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
541 if (err < 0)544 if (err < 0)
542 goto release_idr;545 goto release_idr;
@@ -566,10 +569,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 23 unmodified lines
566 p->eth_type = ife_type;569 p->eth_type = ife_type;
567 }570 }
568 571
569
570 if (ret == ACT_P_CREATED)
571 INIT_LIST_HEAD(&ife->metalist);
572
573 if (tb[TCA_IFE_METALST]) {572 if (tb[TCA_IFE_METALST]) {
574 err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,573 err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
575 tb[TCA_IFE_METALST], NULL,574 tb[TCA_IFE_METALST], NULL,
net/sunrpc/xprtrdma/verbs.c+22−7
@@ -77,7 +77,7 @@ · 76 unmodified lines
77static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt,77static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt,
78 struct rpcrdma_sendctx *sc);78 struct rpcrdma_sendctx *sc);
79static void rpcrdma_reqs_reset(struct rpcrdma_xprt *r_xprt);79static void rpcrdma_reqs_reset(struct rpcrdma_xprt *r_xprt);
80static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf);80static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt);
81static void rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt);81static void rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt);
82static void rpcrdma_mrs_destroy(struct rpcrdma_xprt *r_xprt);82static void rpcrdma_mrs_destroy(struct rpcrdma_xprt *r_xprt);
83static struct rpcrdma_regbuf *83static struct rpcrdma_regbuf *
@@ -244,6 +244,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) · 160 unmodified lines
244 ia->ri_id->device->name,244 ia->ri_id->device->name,
245 rpcrdma_addrstr(r_xprt), rpcrdma_portstr(r_xprt));245 rpcrdma_addrstr(r_xprt), rpcrdma_portstr(r_xprt));
246#endif246#endif
247 init_completion(&ia->ri_remove_done);
247 set_bit(RPCRDMA_IAF_REMOVING, &ia->ri_flags);248 set_bit(RPCRDMA_IAF_REMOVING, &ia->ri_flags);
248 ep->rep_connected = -ENODEV;249 ep->rep_connected = -ENODEV;
249 xprt_force_disconnect(xprt);250 xprt_force_disconnect(xprt);
@@ -297,7 +298,6 @@ rpcrdma_create_id(struct rpcrdma_xprt *xprt, struct rpcrdma_ia *ia) · 47 unmodified lines
297 int rc;298 int rc;
298 299
299 init_completion(&ia->ri_done);300 init_completion(&ia->ri_done);
300 init_completion(&ia->ri_remove_done);
301 301
302 id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler,302 id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler,
303 xprt, RDMA_PS_TCP, IB_QPT_RC);303 xprt, RDMA_PS_TCP, IB_QPT_RC);
@@ -421,7 +421,7 @@ rpcrdma_ia_remove(struct rpcrdma_ia *ia) · 117 unmodified lines
421 /* The ULP is responsible for ensuring all DMA421 /* The ULP is responsible for ensuring all DMA
422 * mappings and MRs are gone.422 * mappings and MRs are gone.
423 */423 */
424 rpcrdma_reps_destroy(buf);424 rpcrdma_reps_unmap(r_xprt);
425 list_for_each_entry(req, &buf->rb_allreqs, rl_all) {425 list_for_each_entry(req, &buf->rb_allreqs, rl_all) {
426 rpcrdma_regbuf_dma_unmap(req->rl_rdmabuf);426 rpcrdma_regbuf_dma_unmap(req->rl_rdmabuf);
427 rpcrdma_regbuf_dma_unmap(req->rl_sendbuf);427 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
599 struct ib_qp_init_attr *qp_init_attr)599 struct ib_qp_init_attr *qp_init_attr)
600{600{
601 struct rpcrdma_ia *ia = &r_xprt->rx_ia;601 struct rpcrdma_ia *ia = &r_xprt->rx_ia;
602 struct rpcrdma_ep *ep = &r_xprt->rx_ep;
602 int rc, err;603 int rc, err;
603 604
604 trace_xprtrdma_reinsert(r_xprt);605 trace_xprtrdma_reinsert(r_xprt);
@@ -613,6 +614,7 @@ static int rpcrdma_ep_recreate_xprt(struct rpcrdma_xprt *r_xprt, · 8 unmodified lines
613 pr_err("rpcrdma: rpcrdma_ep_create returned %d\n", err);614 pr_err("rpcrdma: rpcrdma_ep_create returned %d\n", err);
614 goto out2;615 goto out2;
615 }616 }
617 memcpy(qp_init_attr, &ep->rep_attr, sizeof(*qp_init_attr));
616 618
617 rc = -ENETUNREACH;619 rc = -ENETUNREACH;
618 err = rdma_create_qp(ia->ri_id, ia->ri_pd, qp_init_attr);620 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
1090 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;1092 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;
1091 rep->rr_recv_wr.num_sge = 1;1093 rep->rr_recv_wr.num_sge = 1;
1092 rep->rr_temp = temp;1094 rep->rr_temp = temp;
1095 list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps);
1093 return rep;1096 return rep;
1094 1097
1095out_free:1098out_free:
@@ -1100,6 +1103,7 @@ out: · 4 unmodified lines
1100 1103
1101static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep)1104static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep)
1102{1105{
1106 list_del(&rep->rr_all);
1103 rpcrdma_regbuf_free(rep->rr_rdmabuf);1107 rpcrdma_regbuf_free(rep->rr_rdmabuf);
1104 kfree(rep);1108 kfree(rep);
1105}1109}
@@ -1118,10 +1122,16 @@ static struct rpcrdma_rep *rpcrdma_rep_get_locked(struct rpcrdma_buffer *buf) · 12 unmodified lines
1118static void rpcrdma_rep_put(struct rpcrdma_buffer *buf,1122static void rpcrdma_rep_put(struct rpcrdma_buffer *buf,
1119 struct rpcrdma_rep *rep)1123 struct rpcrdma_rep *rep)
1120{1124{
1121 if (!rep->rr_temp)1125 llist_add(&rep->rr_node, &buf->rb_free_reps);
1122 llist_add(&rep->rr_node, &buf->rb_free_reps);1126}
1123 else1127
1124 rpcrdma_rep_destroy(rep);1128static 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);
1125}1135}
1126 1136
1127static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf)1137static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf)
@@ -1152,6 +1162,7 @@ int rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt) · 24 unmodified lines
1152 1162
1153 INIT_LIST_HEAD(&buf->rb_send_bufs);1163 INIT_LIST_HEAD(&buf->rb_send_bufs);
1154 INIT_LIST_HEAD(&buf->rb_allreqs);1164 INIT_LIST_HEAD(&buf->rb_allreqs);
1165 INIT_LIST_HEAD(&buf->rb_all_reps);
1155 1166
1156 rc = -ENOMEM;1167 rc = -ENOMEM;
1157 for (i = 0; i < buf->rb_max_requests; i++) {1168 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
1504 wr = NULL;1515 wr = NULL;
1505 while (needed) {1516 while (needed) {
1506 rep = rpcrdma_rep_get_locked(buf);1517 rep = rpcrdma_rep_get_locked(buf);
1518 if (rep && rep->rr_temp) {
1519 rpcrdma_rep_destroy(rep);
1520 continue;
1521 }
1507 if (!rep)1522 if (!rep)
1508 rep = rpcrdma_rep_create(r_xprt, temp);1523 rep = rpcrdma_rep_create(r_xprt, temp);
1509 if (!rep)1524 if (!rep)
net/sunrpc/xprtrdma/xprt_rdma.h+2−0
@@ -203,6 +203,7 @@ struct rpcrdma_rep { · 202 unmodified lines
203 struct xdr_stream rr_stream;203 struct xdr_stream rr_stream;
204 struct llist_node rr_node;204 struct llist_node rr_node;
205 struct ib_recv_wr rr_recv_wr;205 struct ib_recv_wr rr_recv_wr;
206 struct list_head rr_all;
206};207};
207 208
208/* To reduce the rate at which a transport invokes ib_post_recv209/* To reduce the rate at which a transport invokes ib_post_recv
@@ -368,6 +369,7 @@ struct rpcrdma_buffer { · 159 unmodified lines
368 369
369 struct list_head rb_allreqs;370 struct list_head rb_allreqs;
370 struct list_head rb_all_mrs;371 struct list_head rb_all_mrs;
372 struct list_head rb_all_reps;
371 373
372 struct llist_head rb_free_reps;374 struct llist_head rb_free_reps;
373 375
net/tls/tls_main.c+7−3
@@ -732,15 +732,19 @@ out: · 731 unmodified lines
732 return rc;732 return rc;
733}733}
734 734
735static void tls_update(struct sock *sk, struct proto *p)735static void tls_update(struct sock *sk, struct proto *p,
736 void (*write_space)(struct sock *sk))
736{737{
737 struct tls_context *ctx;738 struct tls_context *ctx;
738 739
739 ctx = tls_get_ctx(sk);740 ctx = tls_get_ctx(sk);
740 if (likely(ctx))741 if (likely(ctx)) {
742 ctx->sk_write_space = write_space;
741 ctx->sk_proto = p;743 ctx->sk_proto = p;
742 else744 } else {
743 sk->sk_prot = p;745 sk->sk_prot = p;
746 sk->sk_write_space = write_space;
747 }
744}748}
745 749
746static int tls_get_info(const struct sock *sk, struct sk_buff *skb)750static 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
256 return ret;256 return ret;
257 257
258 ret = crypto_wait_req(ret, &ctx->async_wait);258 ret = crypto_wait_req(ret, &ctx->async_wait);
259 } else if (ret == -EBADMSG) {
260 TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
261 }259 }
262 260
263 if (async)261 if (async)
@@ -682,12 +680,32 @@ static int tls_push_record(struct sock *sk, int flags, · 418 unmodified lines
682 680
683 split_point = msg_pl->apply_bytes;681 split_point = msg_pl->apply_bytes;
684 split = split_point && split_point < msg_pl->sg.size;682 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 }
685 if (split) {692 if (split) {
686 rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en,693 rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en,
687 split_point, prot->overhead_size,694 split_point, prot->overhead_size,
688 &orig_end);695 &orig_end);
689 if (rc < 0)696 if (rc < 0)
690 return rc;697 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 }
691 sk_msg_trim(sk, msg_en, msg_pl->sg.size +709 sk_msg_trim(sk, msg_en, msg_pl->sg.size +
692 prot->overhead_size);710 prot->overhead_size);
693 }711 }
@@ -709,6 +727,12 @@ static int tls_push_record(struct sock *sk, int flags, · 15 unmodified lines
709 sg_mark_end(sk_msg_elem(msg_pl, i));727 sg_mark_end(sk_msg_elem(msg_pl, i));
710 }728 }
711 729
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
712 i = msg_pl->sg.start;736 i = msg_pl->sg.start;
713 sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]);737 sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]);
714 738
@@ -772,7 +796,7 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk, · 57 unmodified lines
772 psock = sk_psock_get(sk);796 psock = sk_psock_get(sk);
773 if (!psock || !policy) {797 if (!psock || !policy) {
774 err = tls_push_record(sk, flags, record_type);798 err = tls_push_record(sk, flags, record_type);
775 if (err) {799 if (err && err != -EINPROGRESS) {
776 *copied -= sk_msg_free(sk, msg);800 *copied -= sk_msg_free(sk, msg);
777 tls_free_open_rec(sk);801 tls_free_open_rec(sk);
778 }802 }
@@ -783,10 +807,7 @@ more_data: · 4 unmodified lines
783 if (psock->eval == __SK_NONE) {807 if (psock->eval == __SK_NONE) {
784 delta = msg->sg.size;808 delta = msg->sg.size;
785 psock->eval = sk_psock_msg_verdict(sk, psock, msg);809 psock->eval = sk_psock_msg_verdict(sk, psock, msg);
786 if (delta < msg->sg.size)810 delta -= msg->sg.size;
787 delta -= msg->sg.size;
788 else
789 delta = 0;
790 }811 }
791 if (msg->cork_bytes && msg->cork_bytes > msg->sg.size &&812 if (msg->cork_bytes && msg->cork_bytes > msg->sg.size &&
792 !enospc && !full_record) {813 !enospc && !full_record) {
@@ -801,7 +822,7 @@ more_data: · 8 unmodified lines
801 switch (psock->eval) {822 switch (psock->eval) {
802 case __SK_PASS:823 case __SK_PASS:
803 err = tls_push_record(sk, flags, record_type);824 err = tls_push_record(sk, flags, record_type);
804 if (err < 0) {825 if (err && err != -EINPROGRESS) {
805 *copied -= sk_msg_free(sk, msg);826 *copied -= sk_msg_free(sk, msg);
806 tls_free_open_rec(sk);827 tls_free_open_rec(sk);
807 goto out_err;828 goto out_err;
@@ -1515,7 +1536,9 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb, · 707 unmodified lines
1515 if (err == -EINPROGRESS)1536 if (err == -EINPROGRESS)
1516 tls_advance_record_sn(sk, prot,1537 tls_advance_record_sn(sk, prot,
1517 &tls_ctx->rx);1538 &tls_ctx->rx);
1518 1539 else if (err == -EBADMSG)
1540 TLS_INC_STATS(sock_net(sk),
1541 LINUX_MIB_TLSDECRYPTERROR);
1519 return err;1542 return err;
1520 }1543 }
1521 } else {1544 } else {
net/vmw_vsock/hyperv_transport.c+6−59
@@ -138,28 +138,15 @@ struct hvsock { · 137 unmodified lines
138 ****************************************************************************138 ****************************************************************************
139 * The only valid Service GUIDs, from the perspectives of both the host and *139 * The only valid Service GUIDs, from the perspectives of both the host and *
140 * Linux VM, that can be connected by the other end, must conform to this *140 * 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 *141 * format: <port>-facb-11e6-bd58-64006a7986d3. *
142 * this range [0, 0x7FFFFFFF]. *
143 ****************************************************************************142 ****************************************************************************
144 *143 *
145 * When we write apps on the host to connect(), the GUID ServiceID is used.144 * When we write apps on the host to connect(), the GUID ServiceID is used.
146 * When we write apps in Linux VM to connect(), we only need to specify the145 * When we write apps in Linux VM to connect(), we only need to specify the
147 * port and the driver will form the GUID and use that to request the host.146 * port and the driver will form the GUID and use that to request the host.
148 *147 *
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).
156 */148 */
157 149
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
163/* 00000000-facb-11e6-bd58-64006a7986d3 */150/* 00000000-facb-11e6-bd58-64006a7986d3 */
164static const guid_t srv_id_template =151static const guid_t srv_id_template =
165 GUID_INIT(0x00000000, 0xfacb, 0x11e6, 0xbd, 0x58,152 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
184 vsock_addr_init(addr, VMADDR_CID_ANY, port);171 vsock_addr_init(addr, VMADDR_CID_ANY, port);
185}172}
186 173
187static 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
215static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan)174static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan)
216{175{
217 set_channel_pending_send_size(chan,176 set_channel_pending_send_size(chan,
@@ -341,12 +300,7 @@ static void hvs_open_connection(struct vmbus_channel *chan) · 123 unmodified lines
341 if_type = &chan->offermsg.offer.if_type;300 if_type = &chan->offermsg.offer.if_type;
342 if_instance = &chan->offermsg.offer.if_instance;301 if_instance = &chan->offermsg.offer.if_instance;
343 conn_from_host = chan->offermsg.offer.u.pipe.user_def[0];302 conn_from_host = chan->offermsg.offer.u.pipe.user_def[0];
344 303 if (!is_valid_srv_id(if_type))
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)
350 return;304 return;
351 305
352 hvs_addr_init(&addr, conn_from_host ? if_type : if_instance);306 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
371 vnew = vsock_sk(new);325 vnew = vsock_sk(new);
372 326
373 hvs_addr_init(&vnew->local_addr, if_type);327 hvs_addr_init(&vnew->local_addr, if_type);
374 hvs_remote_addr_init(&vnew->remote_addr, &vnew->local_addr);
375 328
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);
376 ret = vsock_assign_transport(vnew, vsock_sk(sk));333 ret = vsock_assign_transport(vnew, vsock_sk(sk));
377 /* Transport assigned (looking at remote_addr) must be the334 /* Transport assigned (looking at remote_addr) must be the
378 * same where we received the request.335 * same where we received the request.
@@ -766,16 +723,6 @@ static bool hvs_stream_is_active(struct vsock_sock *vsk) · 387 unmodified lines
766 723
767static bool hvs_stream_allow(u32 cid, u32 port)724static bool hvs_stream_allow(u32 cid, u32 port)
768{725{
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
779 if (cid == VMADDR_CID_HOST)726 if (cid == VMADDR_CID_HOST)
780 return true;727 return true;
781 728
net/wireless/nl80211.c+3−0
@@ -10843,6 +10843,7 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev, · 10842 unmodified lines
10843 if (err)10843 if (err)
10844 return err;10844 return err;
10845 10845
10846 cfg80211_sinfo_release_content(&sinfo);
10846 if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))10847 if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))
10847 wdev->cqm_config->last_rssi_event_value =10848 wdev->cqm_config->last_rssi_event_value =
10848 (s8) sinfo.rx_beacon_signal_avg;10849 (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
13796 if (err)13797 if (err)
13797 return err;13798 return err;
13798 13799
13800 cfg80211_sinfo_release_content(&sinfo);
13801
13799 return rdev_probe_mesh_link(rdev, dev, dest, buf, len);13802 return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
13800}13803}
13801 13804
net/wireless/rdev-ops.h+14−0
@@ -538,6 +538,10 @@ static inline int · 537 unmodified lines
538rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)538rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
539{539{
540 int ret;540 int ret;
541
542 if (!rdev->ops->set_wiphy_params)
543 return -EOPNOTSUPP;
544
541 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);545 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
542 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);546 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
543 trace_rdev_return_int(&rdev->wiphy, ret);547 trace_rdev_return_int(&rdev->wiphy, ret);
@@ -1167,6 +1171,16 @@ rdev_start_radar_detection(struct cfg80211_registered_device *rdev, · 623 unmodified lines
1167 return ret;1171 return ret;
1168}1172}
1169 1173
1174static inline void
1175rdev_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
1170static inline int1184static inline int
1171rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,1185rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1172 struct net_device *dev,1186 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
2261 2261
2262static void handle_channel_custom(struct wiphy *wiphy,2262static void handle_channel_custom(struct wiphy *wiphy,
2263 struct ieee80211_channel *chan,2263 struct ieee80211_channel *chan,
2264 const struct ieee80211_regdomain *regd)2264 const struct ieee80211_regdomain *regd,
2265 u32 min_bw)
2265{2266{
2266 u32 bw_flags = 0;2267 u32 bw_flags = 0;
2267 const struct ieee80211_reg_rule *reg_rule = NULL;2268 const struct ieee80211_reg_rule *reg_rule = NULL;
2268 const struct ieee80211_power_rule *power_rule = NULL;2269 const struct ieee80211_power_rule *power_rule = NULL;
2269 u32 bw;2270 u32 bw;
2270 2271
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) {
2272 reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq),2273 reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq),
2273 regd, bw);2274 regd, bw);
2274 if (!IS_ERR(reg_rule))2275 if (!IS_ERR(reg_rule))
@@ -2324,8 +2325,14 @@ static void handle_band_custom(struct wiphy *wiphy, · 49 unmodified lines
2324 if (!sband)2325 if (!sband)
2325 return;2326 return;
2326 2327
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 */
2327 for (i = 0; i < sband->n_channels; i++)2333 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));
2329}2336}
2330 2337
2331/* Used by drivers prior to wiphy registration */2338/* Used by drivers prior to wiphy registration */
@@ -3885,6 +3892,25 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy) · 1553 unmodified lines
3885}3892}
3886EXPORT_SYMBOL(regulatory_pre_cac_allowed);3893EXPORT_SYMBOL(regulatory_pre_cac_allowed);
3887 3894
3895static 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
3888void regulatory_propagate_dfs_state(struct wiphy *wiphy,3914void regulatory_propagate_dfs_state(struct wiphy *wiphy,
3889 struct cfg80211_chan_def *chandef,3915 struct cfg80211_chan_def *chandef,
3890 enum nl80211_dfs_state dfs_state,3916 enum nl80211_dfs_state dfs_state,
@@ -3911,8 +3937,10 @@ void regulatory_propagate_dfs_state(struct wiphy *wiphy, · 20 unmodified lines
3911 cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state);3937 cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state);
3912 3938
3913 if (event == NL80211_RADAR_DETECTED ||3939 if (event == NL80211_RADAR_DETECTED ||
3914 event == NL80211_RADAR_CAC_FINISHED)3940 event == NL80211_RADAR_CAC_FINISHED) {
3915 cfg80211_sched_dfs_chan_update(rdev);3941 cfg80211_sched_dfs_chan_update(rdev);
3942 cfg80211_check_and_end_cac(rdev);
3943 }
3916 3944
3917 nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL);3945 nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL);
3918 }3946 }
net/wireless/sme.c+3−3
@@ -1307,14 +1307,14 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) · 1306 unmodified lines
1307 if (wdev->conn_owner_nlportid) {1307 if (wdev->conn_owner_nlportid) {
1308 switch (wdev->iftype) {1308 switch (wdev->iftype) {
1309 case NL80211_IFTYPE_ADHOC:1309 case NL80211_IFTYPE_ADHOC:
1310 cfg80211_leave_ibss(rdev, wdev->netdev, false);1310 __cfg80211_leave_ibss(rdev, wdev->netdev, false);
1311 break;1311 break;
1312 case NL80211_IFTYPE_AP:1312 case NL80211_IFTYPE_AP:
1313 case NL80211_IFTYPE_P2P_GO:1313 case NL80211_IFTYPE_P2P_GO:
1314 cfg80211_stop_ap(rdev, wdev->netdev, false);1314 __cfg80211_stop_ap(rdev, wdev->netdev, false);
1315 break;1315 break;
1316 case NL80211_IFTYPE_MESH_POINT:1316 case NL80211_IFTYPE_MESH_POINT:
1317 cfg80211_leave_mesh(rdev, wdev->netdev);1317 __cfg80211_leave_mesh(rdev, wdev->netdev);
1318 break;1318 break;
1319 case NL80211_IFTYPE_STATION:1319 case NL80211_IFTYPE_STATION:
1320 case NL80211_IFTYPE_P2P_CLIENT:1320 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
646 TP_ARGS(wiphy, netdev)646 TP_ARGS(wiphy, netdev)
647);647);
648 648
649DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac,
650 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
651 TP_ARGS(wiphy, netdev)
652);
653
649DECLARE_EVENT_CLASS(station_add_change,654DECLARE_EVENT_CLASS(station_add_change,
650 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,655 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
651 struct station_parameters *params),656 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
564 struct skb_shared_info *sh = skb_shinfo(skb);564 struct skb_shared_info *sh = skb_shinfo(skb);
565 int page_offset;565 int page_offset;
566 566
567 page_ref_inc(page);567 get_page(page);
568 page_offset = ptr - page_address(page);568 page_offset = ptr - page_address(page);
569 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);569 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
570}570}
net/wireless/wext-core.c+2−1
@@ -657,7 +657,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) · 656 unmodified lines
657 return NULL;657 return NULL;
658}658}
659 659
660static int iw_handler_get_iwstats(struct net_device * dev,660/* noinline to avoid a bogus warning with -O3 */
661static noinline int iw_handler_get_iwstats(struct net_device * dev,
661 struct iw_request_info * info,662 struct iw_request_info * info,
662 union iwreq_data * wrqu,663 union iwreq_data * wrqu,
663 char * extra)664 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
766 if (sk->sk_state == TCP_ESTABLISHED)766 if (sk->sk_state == TCP_ESTABLISHED)
767 goto out;767 goto out;
768 768
769 rc = -EALREADY; /* Do nothing if call is already in progress */
770 if (sk->sk_state == TCP_SYN_SENT)
771 goto out;
772
769 sk->sk_state = TCP_CLOSE;773 sk->sk_state = TCP_CLOSE;
770 sock->state = SS_UNCONNECTED;774 sock->state = SS_UNCONNECTED;
771 775
@@ -812,7 +816,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, · 40 unmodified lines
812 /* Now the loop */816 /* Now the loop */
813 rc = -EINPROGRESS;817 rc = -EINPROGRESS;
814 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK))818 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK))
815 goto out_put_neigh;819 goto out;
816 820
817 rc = x25_wait_for_connection_establishment(sk);821 rc = x25_wait_for_connection_establishment(sk);
818 if (rc)822 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
471 q = queueptr(idx);471 q = queueptr(idx);
472 if (q == NULL)472 if (q == NULL)
473 continue;473 continue;
474 if ((tmr = q->timer) == NULL ||474 mutex_lock(&q->timer_mutex);
475 (ti = tmr->timeri) == NULL) {475 tmr = q->timer;
476 queuefree(q);476 if (!tmr)
477 continue;477 goto unlock;
478 }478 ti = tmr->timeri;
479 if (!ti)
480 goto unlock;
479 snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);481 snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);
480 resolution = snd_timer_resolution(ti) * tmr->ticks;482 resolution = snd_timer_resolution(ti) * tmr->ticks;
481 snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);483 snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);
482 snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);484 snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);
485unlock:
486 mutex_unlock(&q->timer_mutex);
483 queuefree(q);487 queuefree(q);
484 }488 }
485}489}
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
159 int j;159 int j;
160 160
161 for (j = i + 1; j < 9; ++j) {161 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;
163 goto end;165 goto end;
166 }
164 }167 }
165 }168 }
166 169
sound/firewire/tascam/amdtp-tascam.c+3−2
@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s, · 156 unmodified lines
157 if ((before ^ after) & mask) {157 if ((before ^ after) & mask) {
158 struct snd_firewire_tascam_change *entry =158 struct snd_firewire_tascam_change *entry =
159 &tscm->queue[tscm->push_pos];159 &tscm->queue[tscm->push_pos];
160 unsigned long flag;
160 161
161 spin_lock_irq(&tscm->lock);162 spin_lock_irqsave(&tscm->lock, flag);
162 entry->index = index;163 entry->index = index;
163 entry->before = before;164 entry->before = before;
164 entry->after = after;165 entry->after = after;
165 if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)166 if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
166 tscm->push_pos = 0;167 tscm->push_pos = 0;
167 spin_unlock_irq(&tscm->lock);168 spin_unlock_irqrestore(&tscm->lock, flag);
168 169
169 wake_up(&tscm->hwdep_wait);170 wake_up(&tscm->hwdep_wait);
170 }171 }
sound/pci/hda/hda_intel.c+8−5
@@ -125,7 +125,7 @@ static char *patch[SNDRV_CARDS]; · 124 unmodified lines
125static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =125static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =
126 CONFIG_SND_HDA_INPUT_BEEP_MODE};126 CONFIG_SND_HDA_INPUT_BEEP_MODE};
127#endif127#endif
128static bool dsp_driver = 1;128static bool dmic_detect = 1;
129 129
130module_param_array(index, int, NULL, 0444);130module_param_array(index, int, NULL, 0444);
131MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");131MODULE_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
160MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "160MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
161 "(0=off, 1=on) (default=1).");161 "(0=off, 1=on) (default=1).");
162#endif162#endif
163module_param(dsp_driver, bool, 0444);163module_param(dmic_detect, bool, 0444);
164MODULE_PARM_DESC(dsp_driver, "Allow DSP driver selection (bypass this driver) "164MODULE_PARM_DESC(dmic_detect, "Allow DSP driver selection (bypass this driver) "
165 "(0=off, 1=on) (default=1)");165 "(0=off, 1=on) (default=1); "
166 "deprecated, use snd-intel-dspcfg.dsp_driver option instead");
166 167
167#ifdef CONFIG_PM168#ifdef CONFIG_PM
168static int param_set_xint(const char *val, const struct kernel_param *kp);169static 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
2099 /*2100 /*
2100 * stop probe if another Intel's DSP driver should be activated2101 * stop probe if another Intel's DSP driver should be activated
2101 */2102 */
2102 if (dsp_driver) {2103 if (dmic_detect) {
2103 err = snd_intel_dsp_driver_probe(pci);2104 err = snd_intel_dsp_driver_probe(pci);
2104 if (err != SND_INTEL_DSP_DRIVER_ANY &&2105 if (err != SND_INTEL_DSP_DRIVER_ANY &&
2105 err != SND_INTEL_DSP_DRIVER_LEGACY)2106 err != SND_INTEL_DSP_DRIVER_LEGACY)
2106 return -ENODEV;2107 return -ENODEV;
2108 } else {
2109 dev_warn(&pci->dev, "dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead\n");
2107 }2110 }
2108 2111
2109 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,2112 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
10 10
11#include <crypto/hash.h>11#include <crypto/hash.h>
12#include <crypto/sha.h>12#include <crypto/sha.h>
13#include <linux/acpi.h>
13#include <linux/delay.h>14#include <linux/delay.h>
14#include <linux/device.h>15#include <linux/device.h>
15#include <linux/io.h>16#include <linux/io.h>
@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = { · 1031 unmodified lines
1047MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);1048MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
1048#endif1049#endif
1049 1050
1051static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
1052 { "GOOG0013", 0 },
1053 { }
1054};
1055MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
1056
1050static struct platform_driver cros_ec_codec_platform_driver = {1057static struct platform_driver cros_ec_codec_platform_driver = {
1051 .driver = {1058 .driver = {
1052 .name = "cros-ec-codec",1059 .name = "cros-ec-codec",
1053 .of_match_table = of_match_ptr(cros_ec_codec_of_match),1060 .of_match_table = of_match_ptr(cros_ec_codec_of_match),
1061 .acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id),
1054 },1062 },
1055 .probe = cros_ec_codec_platform_probe,1063 .probe = cros_ec_codec_platform_probe,
1056};1064};
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
588 struct hdac_hda_priv *hda_pvt;588 struct hdac_hda_priv *hda_pvt;
589 589
590 hda_pvt = dev_get_drvdata(&hdev->dev);590 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
592 return 0;594 return 0;
593}595}
594 596
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
396 396
397 switch (event) {397 switch (event) {
398 case SND_SOC_DAPM_PRE_PMU:398 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);
402 snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);399 snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
403 snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,400 snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
404 MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,401 MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct · 43 unmodified lines
448 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);445 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
449 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);446 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
450 447
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
451 return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,456 return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
452 wcd->micbias1_cap_mode);457 wcd->micbias1_cap_mode);
453}458}
@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct · 104 unmodified lines
558 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);563 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
559 564
560 switch (event) {565 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;
561 case SND_SOC_DAPM_POST_PMU:571 case SND_SOC_DAPM_POST_PMU:
562 pm8916_mbhc_configure_bias(wcd, true);572 pm8916_mbhc_configure_bias(wcd, true);
563 break;573 break;
@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { · 374 unmodified lines
938 948
939 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,949 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
940 pm8916_wcd_analog_enable_micbias_ext1,950 pm8916_wcd_analog_enable_micbias_ext1,
941 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),951 SND_SOC_DAPM_POST_PMU),
942 SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,952 SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
943 pm8916_wcd_analog_enable_micbias_ext2,953 pm8916_wcd_analog_enable_micbias_ext2,
944 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),954 SND_SOC_DAPM_POST_PMU),
945 955
946 SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,956 SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
947 pm8916_wcd_analog_enable_adc,957 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
586 snd_soc_component_write(component, rx_gain_reg[w->shift],586 snd_soc_component_write(component, rx_gain_reg[w->shift],
587 snd_soc_component_read32(component, rx_gain_reg[w->shift]));587 snd_soc_component_read32(component, rx_gain_reg[w->shift]));
588 break;588 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;
589 }595 }
590 return 0;596 return 0;
591}597}
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
2432{2432{
2433 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);2433 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
2434 2434
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
2435 disable_irq(rt5640->irq);2442 disable_irq(rt5640->irq);
2436 rt5640_cancel_work(rt5640);2443 rt5640_cancel_work(rt5640);
2437 2444
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
442 DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),442 DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
443 DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),443 DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),
444 },444 },
445 .driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP445 .driver_data = (void *)(BYT_CHT_ES8316_SSP0
446 | BYT_CHT_ES8316_INTMIC_IN2_MAP
446 | BYT_CHT_ES8316_JD_INVERTED),447 | BYT_CHT_ES8316_JD_INVERTED),
447 },448 },
448 { /* Teclast X98 Plus II */449 { /* 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
539 struct snd_soc_rtdcom_list *rtdcom;539 struct snd_soc_rtdcom_list *rtdcom;
540 struct snd_soc_component *component;540 struct snd_soc_component *component;
541 541
542 if (!rtd->pcm)
543 return;
544
542 for_each_rtd_components(rtd, rtdcom, component)545 for_each_rtd_components(rtd, rtdcom, component)
543 if (component->driver->pcm_destruct)546 if (component->driver->pcm_destruct)
544 component->driver->pcm_destruct(component, rtd->pcm);547 component->driver->pcm_destruct(component, rtd->pcm);
sound/soc/sof/intel/hda-codec.c+12−7
@@ -24,19 +24,18 @@ · 23 unmodified lines
24#define IDISP_VID_INTEL 0x8086000024#define IDISP_VID_INTEL 0x80860000
25 25
26/* load the legacy HDA codec driver */26/* load the legacy HDA codec driver */
27#ifdef MODULE27static int hda_codec_load_module(struct hda_codec *codec)
28static void hda_codec_load_module(struct hda_codec *codec)
29{28{
29#ifdef MODULE
30 char alias[MODULE_NAME_LEN];30 char alias[MODULE_NAME_LEN];
31 const char *module = alias;31 const char *module = alias;
32 32
33 snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));33 snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));
34 dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);34 dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);
35 request_module(module);35 request_module(module);
36}
37#else
38static void hda_codec_load_module(struct hda_codec *codec) {}
39#endif36#endif
37 return device_attach(hda_codec_dev(codec));
38}
40 39
41/* enable controller wake up event for all codecs with jack connectors */40/* enable controller wake up event for all codecs with jack connectors */
42void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev)41void 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
129 if ((mach_params && mach_params->common_hdmi_codec_drv) ||128 if ((mach_params && mach_params->common_hdmi_codec_drv) ||
130 (resp & 0xFFFF0000) != IDISP_VID_INTEL) {129 (resp & 0xFFFF0000) != IDISP_VID_INTEL) {
131 hdev->type = HDA_DEV_LEGACY;130 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;
133 }138 }
134 139
135 return 0;140 return ret;
136#else141#else
137 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);142 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
138 if (!hdev)143 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
329 if (!ret)329 if (!ret)
330 break;330 break;
331 331
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",
333 snd_sof_dsp_read(sdev, HDA_DSP_BAR,335 snd_sof_dsp_read(sdev, HDA_DSP_BAR,
334 HDA_DSP_SRAM_REG_ROM_ERROR),336 HDA_DSP_SRAM_REG_ROM_ERROR),
335 snd_sof_dsp_read(sdev, HDA_DSP_BAR,337 snd_sof_dsp_read(sdev, HDA_DSP_BAR,
336 HDA_DSP_SRAM_REG_ROM_STATUS));338 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);
339 }339 }
340 340
341 if (i == HDA_FW_BOOT_ATTEMPTS) {341 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
226 * sampling frequency. If no sample rate is already specified, then226 * sampling frequency. If no sample rate is already specified, then
227 * set one.227 * set one.
228 */228 */
229 mutex_lock(&player->ctrl_lock);
230 if (runtime) {229 if (runtime) {
231 switch (runtime->rate) {230 switch (runtime->rate) {
232 case 22050:231 case 22050:
@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player, · 70 unmodified lines
303 player->stream_settings.iec958.status[3 + (n * 4)] << 24;302 player->stream_settings.iec958.status[3 + (n * 4)] << 24;
304 SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status);303 SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status);
305 }304 }
306 mutex_unlock(&player->ctrl_lock);
307 305
308 /* Update the channel status */306 /* Update the channel status */
309 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)307 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
365 363
366 SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player);364 SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player);
367 365
366 mutex_lock(&player->ctrl_lock);
368 /* Update the channel status */367 /* Update the channel status */
369 uni_player_set_channel_status(player, runtime);368 uni_player_set_channel_status(player, runtime);
369 mutex_unlock(&player->ctrl_lock);
370 370
371 /* Clear the user validity user bits */371 /* Clear the user validity user bits */
372 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0);372 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
598 iec958->status[1] = ucontrol->value.iec958.status[1];598 iec958->status[1] = ucontrol->value.iec958.status[1];
599 iec958->status[2] = ucontrol->value.iec958.status[2];599 iec958->status[2] = ucontrol->value.iec958.status[2];
600 iec958->status[3] = ucontrol->value.iec958.status[3];600 iec958->status[3] = ucontrol->value.iec958.status[3];
601 mutex_unlock(&player->ctrl_lock);
602 601
603 spin_lock_irqsave(&player->irq_lock, flags);602 spin_lock_irqsave(&player->irq_lock, flags);
604 if (player->substream && player->substream->runtime)603 if (player->substream && player->substream->runtime)
@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, · 3 unmodified lines
608 uni_player_set_channel_status(player, NULL);607 uni_player_set_channel_status(player, NULL);
609 608
610 spin_unlock_irqrestore(&player->irq_lock, flags);609 spin_unlock_irqrestore(&player->irq_lock, flags);
610 mutex_unlock(&player->ctrl_lock);
611
611 return 0;612 return 0;
612}613}
613 614
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
153 .name = "stm32_dfsdm_audio",153 .name = "stm32_dfsdm_audio",
154};154};
155 155
156static void memcpy_32to16(void *dest, const void *src, size_t n)156static void stm32_memcpy_32to16(void *dest, const void *src, size_t n)
157{157{
158 unsigned int i = 0;158 unsigned int i = 0;
159 u16 *d = (u16 *)dest, *s = (u16 *)src;159 u16 *d = (u16 *)dest, *s = (u16 *)src;
160 160
161 s++;161 s++;
162 for (i = n; i > 0; i--) {162 for (i = n >> 1; i > 0; i--) {
163 *d++ = *s++;163 *d++ = *s++;
164 s++;164 s++;
165 }165 }
@@ -186,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) · 20 unmodified lines
186 186
187 if ((priv->pos + src_size) > buff_size) {187 if ((priv->pos + src_size) > buff_size) {
188 if (format == SNDRV_PCM_FORMAT_S16_LE)188 if (format == SNDRV_PCM_FORMAT_S16_LE)
189 memcpy_32to16(&pcm_buff[priv->pos], src_buff,189 stm32_memcpy_32to16(&pcm_buff[priv->pos], src_buff,
190 buff_size - priv->pos);190 buff_size - priv->pos);
191 else191 else
192 memcpy(&pcm_buff[priv->pos], src_buff,192 memcpy(&pcm_buff[priv->pos], src_buff,
193 buff_size - priv->pos);193 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
196 }196 }
197 197
198 if (format == SNDRV_PCM_FORMAT_S16_LE)198 if (format == SNDRV_PCM_FORMAT_S16_LE)
199 memcpy_32to16(&pcm_buff[priv->pos],199 stm32_memcpy_32to16(&pcm_buff[priv->pos],
200 &src_buff[src_size - cur_size], cur_size);200 &src_buff[src_size - cur_size], cur_size);
201 else201 else
202 memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size],202 memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size],
203 cur_size);203 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
184 }184 }
185}185}
186 186
187static 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
204static 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
221static 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
187static const struct regmap_config stm32_sai_sub_regmap_config_f4 = {237static const struct regmap_config stm32_sai_sub_regmap_config_f4 = {
188 .reg_bits = 32,238 .reg_bits = 32,
189 .reg_stride = 4,239 .reg_stride = 4,
@@ -295,7 +345,7 @@ static int stm32_sai_set_clk_div(struct stm32_sai_sub_data *sai, · 105 unmodified lines
295 345
296 mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version));346 mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version));
297 cr1 = SAI_XCR1_MCKDIV_SET(div);347 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);
299 if (ret < 0)349 if (ret < 0)
300 dev_err(&sai->pdev->dev, "Failed to update CR1 register\n");350 dev_err(&sai->pdev->dev, "Failed to update CR1 register\n");
301 351
@@ -372,8 +422,8 @@ static int stm32_sai_mclk_enable(struct clk_hw *hw) · 70 unmodified lines
372 422
373 dev_dbg(&sai->pdev->dev, "Enable master clock\n");423 dev_dbg(&sai->pdev->dev, "Enable master clock\n");
374 424
375 return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,425 return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
376 SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);426 SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
377}427}
378 428
379static void stm32_sai_mclk_disable(struct clk_hw *hw)429static 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
383 433
384 dev_dbg(&sai->pdev->dev, "Disable master clock\n");434 dev_dbg(&sai->pdev->dev, "Disable master clock\n");
385 435
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);
387}437}
388 438
389static const struct clk_ops mclk_ops = {439static const struct clk_ops mclk_ops = {
@@ -446,15 +496,15 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid) · 56 unmodified lines
446 unsigned int sr, imr, flags;496 unsigned int sr, imr, flags;
447 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING;497 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING;
448 498
449 regmap_read(sai->regmap, STM_SAI_IMR_REGX, &imr);499 stm32_sai_sub_reg_rd(sai, STM_SAI_IMR_REGX, &imr);
450 regmap_read(sai->regmap, STM_SAI_SR_REGX, &sr);500 stm32_sai_sub_reg_rd(sai, STM_SAI_SR_REGX, &sr);
451 501
452 flags = sr & imr;502 flags = sr & imr;
453 if (!flags)503 if (!flags)
454 return IRQ_NONE;504 return IRQ_NONE;
455 505
456 regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,506 stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
457 SAI_XCLRFR_MASK);507 SAI_XCLRFR_MASK);
458 508
459 if (!sai->substream) {509 if (!sai->substream) {
460 dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr);510 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
503 int ret;553 int ret;
504 554
505 if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) {555 if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) {
506 ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,556 ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
507 SAI_XCR1_NODIV,557 SAI_XCR1_NODIV,
508 freq ? 0 : SAI_XCR1_NODIV);558 freq ? 0 : SAI_XCR1_NODIV);
509 if (ret < 0)559 if (ret < 0)
510 return ret;560 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
583 633
584 slotr_mask |= SAI_XSLOTR_SLOTEN_MASK;634 slotr_mask |= SAI_XSLOTR_SLOTEN_MASK;
585 635
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);
587 637
588 sai->slot_width = slot_width;638 sai->slot_width = slot_width;
589 sai->slots = slots;639 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
665 cr1_mask |= SAI_XCR1_CKSTR;715 cr1_mask |= SAI_XCR1_CKSTR;
666 frcr_mask |= SAI_XFRCR_FSPOL;716 frcr_mask |= SAI_XFRCR_FSPOL;
667 717
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);
669 719
670 /* DAI clock master masks */720 /* DAI clock master masks */
671 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {721 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
693 cr1_mask |= SAI_XCR1_SLAVE;743 cr1_mask |= SAI_XCR1_SLAVE;
694 744
695conf_update:745conf_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);
697 if (ret < 0) {747 if (ret < 0) {
698 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");748 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
699 return ret;749 return ret;
@@ -730,12 +780,12 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 30 unmodified lines
730 }780 }
731 781
732 /* Enable ITs */782 /* Enable ITs */
733 regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX,783 stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX,
734 SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);784 SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);
735 785
736 imr = SAI_XIMR_OVRUDRIE;786 imr = SAI_XIMR_OVRUDRIE;
737 if (STM_SAI_IS_CAPTURE(sai)) {787 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);
739 if (cr2 & SAI_XCR2_MUTECNT_MASK)789 if (cr2 & SAI_XCR2_MUTECNT_MASK)
740 imr |= SAI_XIMR_MUTEDETIE;790 imr |= SAI_XIMR_MUTEDETIE;
741 }791 }
@@ -745,8 +795,8 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 3 unmodified lines
745 else795 else
746 imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE;796 imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE;
747 797
748 regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,798 stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
749 SAI_XIMR_MASK, imr);799 SAI_XIMR_MASK, imr);
750 800
751 return 0;801 return 0;
752}802}
@@ -763,10 +813,10 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, · 10 unmodified lines
763 * SAI fifo threshold is set to half fifo, to keep enough space813 * SAI fifo threshold is set to half fifo, to keep enough space
764 * for DMA incoming bursts.814 * for DMA incoming bursts.
765 */815 */
766 regmap_write_bits(sai->regmap, STM_SAI_CR2_REGX,816 stm32_sai_sub_reg_wr(sai, STM_SAI_CR2_REGX,
767 SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,817 SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
768 SAI_XCR2_FFLUSH |818 SAI_XCR2_FFLUSH |
769 SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));819 SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
770 820
771 /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/821 /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/
772 if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {822 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
795 if ((sai->slots == 2) && (params_channels(params) == 1))845 if ((sai->slots == 2) && (params_channels(params) == 1))
796 cr1 |= SAI_XCR1_MONO;846 cr1 |= SAI_XCR1_MONO;
797 847
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);
799 if (ret < 0) {849 if (ret < 0) {
800 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");850 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
801 return ret;851 return ret;
@@ -809,7 +859,7 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai) · 7 unmodified lines
809 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);859 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
810 int slotr, slot_sz;860 int slotr, slot_sz;
811 861
812 regmap_read(sai->regmap, STM_SAI_SLOTR_REGX, &slotr);862 stm32_sai_sub_reg_rd(sai, STM_SAI_SLOTR_REGX, &slotr);
813 863
814 /*864 /*
815 * If SLOTSZ is set to auto in SLOTR, align slot width on data size865 * 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
831 sai->slots = 2;881 sai->slots = 2;
832 882
833 /* The number of slots in the audio frame is equal to NBSLOT[3:0] + 1*/883 /* 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,884 stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
835 SAI_XSLOTR_NBSLOT_MASK,885 SAI_XSLOTR_NBSLOT_MASK,
836 SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));886 SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));
837 887
838 /* Set default slots mask if not already set from DT */888 /* Set default slots mask if not already set from DT */
839 if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) {889 if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) {
840 sai->slot_mask = (1 << sai->slots) - 1;890 sai->slot_mask = (1 << sai->slots) - 1;
841 regmap_update_bits(sai->regmap,891 stm32_sai_sub_reg_up(sai,
842 STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,892 STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,
843 SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));893 SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));
844 }894 }
845 895
846 dev_dbg(cpu_dai->dev, "Slots %d, slot width %d\n",896 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
870 dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n",920 dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n",
871 sai->fs_length, fs_active);921 sai->fs_length, fs_active);
872 922
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);
874 924
875 if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) {925 if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) {
876 offset = sai->slot_width - sai->data_size;926 offset = sai->slot_width - sai->data_size;
877 927
878 regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX,928 stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
879 SAI_XSLOTR_FBOFF_MASK,929 SAI_XSLOTR_FBOFF_MASK,
880 SAI_XSLOTR_FBOFF_SET(offset));930 SAI_XSLOTR_FBOFF_SET(offset));
881 }931 }
882}932}
883 933
@@ -994,9 +1044,9 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai, · 110 unmodified lines
994 return -EINVAL;1044 return -EINVAL;
995 }1045 }
996 1046
997 regmap_update_bits(sai->regmap,1047 stm32_sai_sub_reg_up(sai,
998 STM_SAI_CR1_REGX,1048 STM_SAI_CR1_REGX,
999 SAI_XCR1_OSR, cr1);1049 SAI_XCR1_OSR, cr1);
1000 1050
1001 div = stm32_sai_get_clk_div(sai, sai_clk_rate,1051 div = stm32_sai_get_clk_div(sai, sai_clk_rate,
1002 sai->mclk_rate);1052 sai->mclk_rate);
@@ -1058,12 +1108,12 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 55 unmodified lines
1058 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:1108 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
1059 dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n");1109 dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n");
1060 1110
1061 regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,1111 stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1062 SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);1112 SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);
1063 1113
1064 /* Enable SAI */1114 /* Enable SAI */
1065 ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,1115 ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1066 SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);1116 SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);
1067 if (ret < 0)1117 if (ret < 0)
1068 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");1118 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
1069 break;1119 break;
@@ -1072,16 +1122,16 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 2 unmodified lines
1072 case SNDRV_PCM_TRIGGER_STOP:1122 case SNDRV_PCM_TRIGGER_STOP:
1073 dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n");1123 dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n");
1074 1124
1075 regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,1125 stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
1076 SAI_XIMR_MASK, 0);1126 SAI_XIMR_MASK, 0);
1077 1127
1078 regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,1128 stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1079 SAI_XCR1_SAIEN,1129 SAI_XCR1_SAIEN,
1080 (unsigned int)~SAI_XCR1_SAIEN);1130 (unsigned int)~SAI_XCR1_SAIEN);
1081 1131
1082 ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,1132 ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1083 SAI_XCR1_DMAEN,1133 SAI_XCR1_DMAEN,
1084 (unsigned int)~SAI_XCR1_DMAEN);1134 (unsigned int)~SAI_XCR1_DMAEN);
1085 if (ret < 0)1135 if (ret < 0)
1086 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");1136 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
1087 1137
@@ -1101,7 +1151,7 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream, · 13 unmodified lines
1101 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);1151 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
1102 unsigned long flags;1152 unsigned long flags;
1103 1153
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);
1105 1155
1106 clk_disable_unprepare(sai->sai_ck);1156 clk_disable_unprepare(sai->sai_ck);
1107 1157
@@ -1169,7 +1219,7 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai) · 61 unmodified lines
1169 cr1_mask |= SAI_XCR1_SYNCEN_MASK;1219 cr1_mask |= SAI_XCR1_SYNCEN_MASK;
1170 cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync);1220 cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync);
1171 1221
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);
1173}1223}
1174 1224
1175static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops = {1225static 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
1322 if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai))1372 if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai))
1323 sai->regmap_config = &stm32_sai_sub_regmap_config_h7;1373 sai->regmap_config = &stm32_sai_sub_regmap_config_h7;
1324 1374
1325 sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "sai_ck",1375 /*
1326 base, sai->regmap_config);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);
1327 if (IS_ERR(sai->regmap)) {1382 if (IS_ERR(sai->regmap)) {
1328 dev_err(&pdev->dev, "Failed to initialize MMIO\n");1383 dev_err(&pdev->dev, "Failed to initialize MMIO\n");
1329 return PTR_ERR(sai->regmap);1384 return PTR_ERR(sai->regmap);
@@ -1420,6 +1475,10 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, · 90 unmodified lines
1420 return PTR_ERR(sai->sai_ck);1475 return PTR_ERR(sai->sai_ck);
1421 }1476 }
1422 1477
1478 ret = clk_prepare(sai->pdata->pclk);
1479 if (ret < 0)
1480 return ret;
1481
1423 if (STM_SAI_IS_F4(sai->pdata))1482 if (STM_SAI_IS_F4(sai->pdata))
1424 return 0;1483 return 0;
1425 1484
@@ -1501,22 +1560,48 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) · 75 unmodified lines
1501 return 0;1560 return 0;
1502}1561}
1503 1562
1563static 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
1504#ifdef CONFIG_PM_SLEEP1572#ifdef CONFIG_PM_SLEEP
1505static int stm32_sai_sub_suspend(struct device *dev)1573static int stm32_sai_sub_suspend(struct device *dev)
1506{1574{
1507 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);1575 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;
1508 1581
1509 regcache_cache_only(sai->regmap, true);1582 regcache_cache_only(sai->regmap, true);
1510 regcache_mark_dirty(sai->regmap);1583 regcache_mark_dirty(sai->regmap);
1584
1585 clk_disable(sai->pdata->pclk);
1586
1511 return 0;1587 return 0;
1512}1588}
1513 1589
1514static int stm32_sai_sub_resume(struct device *dev)1590static int stm32_sai_sub_resume(struct device *dev)
1515{1591{
1516 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);1592 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;
1517 1598
1518 regcache_cache_only(sai->regmap, false);1599 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;
1520}1605}
1521#endif /* CONFIG_PM_SLEEP */1606#endif /* CONFIG_PM_SLEEP */
1522 1607
@@ -1531,6 +1616,7 @@ static struct platform_driver stm32_sai_sub_driver = { · 8 unmodified lines
1531 .pm = &stm32_sai_sub_pm_ops,1616 .pm = &stm32_sai_sub_pm_ops,
1532 },1617 },
1533 .probe = stm32_sai_sub_probe,1618 .probe = stm32_sai_sub_probe,
1619 .remove = stm32_sai_sub_remove,
1534};1620};
1535 1621
1536module_platform_driver(stm32_sai_sub_driver);1622module_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
370add_sync_ep_from_ifnum:370add_sync_ep_from_ifnum:
371 iface = usb_ifnum_to_if(dev, ifnum);371 iface = usb_ifnum_to_if(dev, ifnum);
372 372
373 if (!iface || iface->num_altsetting == 0)373 if (!iface || iface->num_altsetting < 2)
374 return -EINVAL;374 return -EINVAL;
375 375
376 alts = &iface->altsetting[1];376 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
26 bool is_plain_text)26 bool is_plain_text)
27{27{
28 if (is_plain_text)28 if (is_plain_text)
29 jsonw_printf(jw, "%p", data);29 jsonw_printf(jw, "%p", *(void **)data);
30 else30 else
31 jsonw_printf(jw, "%lu", *(unsigned long *)data);31 jsonw_printf(jw, "%lu", *(unsigned long *)data);
32}32}
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
1228 }1228 }
1229 1229
1230 filter_type = add_filter_type(filter, event->id);1230 filter_type = add_filter_type(filter, event->id);
1231 if (filter_type == NULL)1231 if (filter_type == NULL) {
1232 free_arg(arg);
1232 return TEP_ERRNO__MEM_ALLOC_FAILED;1233 return TEP_ERRNO__MEM_ALLOC_FAILED;
1234 }
1233 1235
1234 if (filter_type->filter)1236 if (filter_type->filter)
1235 free_arg(filter_type->filter);1237 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
1076 struct stat st;1076 struct stat st;
1077 bool has_br_stack = false;1077 bool has_br_stack = false;
1078 int branch_mode = -1;1078 int branch_mode = -1;
1079 int last_key = 0;
1079 bool branch_call_mode = false;1080 bool branch_call_mode = false;
1080#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"1081#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"
1081 static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"1082 static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
@@ -1450,7 +1451,8 @@ repeat: · 368 unmodified lines
1450 sort_order = sort_tmp;1451 sort_order = sort_tmp;
1451 }1452 }
1452 1453
1453 if (setup_sorting(session->evlist) < 0) {1454 if ((last_key != K_SWITCH_INPUT_DATA) &&
1455 (setup_sorting(session->evlist) < 0)) {
1454 if (sort_order)1456 if (sort_order)
1455 parse_options_usage(report_usage, options, "s", 1);1457 parse_options_usage(report_usage, options, "s", 1);
1456 if (field_order)1458 if (field_order)
@@ -1530,6 +1532,7 @@ repeat: · 73 unmodified lines
1530 ret = __cmd_report(&report);1532 ret = __cmd_report(&report);
1531 if (ret == K_SWITCH_INPUT_DATA) {1533 if (ret == K_SWITCH_INPUT_DATA) {
1532 perf_session__delete(session);1534 perf_session__delete(session);
1535 last_key = K_SWITCH_INPUT_DATA;
1533 goto repeat;1536 goto repeat;
1534 } else1537 } else
1535 ret = 0;1538 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
339 list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)339 list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
340 340
341#define hists__for_each_format(hists, format) \341#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)
343 343
344#define hists__for_each_sort_list(hists, format) \344#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)
346 346
347extern struct perf_hpp_fmt perf_hpp__format[];347extern struct perf_hpp_fmt perf_hpp__format[];
348 348
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
920 if (curr_map == NULL)920 if (curr_map == NULL)
921 return -1;921 return -1;
922 922
923 if (curr_dso->kernel)
924 map__kmap(curr_map)->kmaps = kmaps;
925
923 if (adjust_kernel_syms) {926 if (adjust_kernel_syms) {
924 curr_map->start = shdr->sh_addr + ref_reloc(kmap);927 curr_map->start = shdr->sh_addr + ref_reloc(kmap);
925 curr_map->end = curr_map->start + shdr->sh_size;928 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
232 stop_traffic232 stop_traffic
233 local ucth1=${uc_rate[1]}233 local ucth1=${uc_rate[1]}
234 234
235 start_traffic $h1 own bc bc235 start_traffic $h1 192.0.2.65 bc bc
236 236
237 local d0=$(date +%s)237 local d0=$(date +%s)
238 local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)238 local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)
@@ -254,7 +254,11 @@ test_mc_aware() · 15 unmodified lines
254 ret = 100 * ($ucth1 - $ucth2) / $ucth1254 ret = 100 * ($ucth1 - $ucth2) / $ucth1
255 if (ret > 0) { ret } else { 0 }255 if (ret > 0) { ret } else { 0 }
256 ")256 ")
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"
258 262
259 local interval=$((d1 - d0))263 local interval=$((d1 - d0))
260 local mc_ir=$(rate $u0 $u1 $interval)264 local mc_ir=$(rate $u0 $u1 $interval)