History

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

Cross-merge networking fixes after downstream PR. Conflicts: drivers/net/phy/aquantia/aquantia.h 219343755eae ("net: phy: aquantia: add missing include guards") 61578f679378 ("net: phy: aquantia: add support for PHY LEDs") drivers/net/ethernet/wangxun/libwx/wx_hw.c bd07a9817846 ("net: txgbe: remove separate irq request for MSI and INTx") b501d261a5b3 ("net: txgbe: add FDIR ATR support") https://lore.kernel.org/all/20240703112936.483c1975@canb.auug.org.au/ include/linux/mlx5/mlx5_ifc.h 048a403648fc ("net/mlx5: IFC updates for changing max EQs") 99be56171fa9 ("net/mlx5e: SHAMPO, Re-enable HW-GRO") https://lore.kernel.org/all/20240701133951.6926b2e3@canb.auug.org.au/ Adjacent changes: drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c 4130c67cd123 ("wifi: iwlwifi: mvm: check vif for NULL/ERR_PTR before dereference") 3f3126515fbe ("wifi: iwlwifi: mvm: add mvm-specific guard") include/net/mac80211.h 816c6bec09ed ("wifi: mac80211: fix BSS_CHANGED_UNSOL_BCAST_PROBE_RESP") 5a009b42e041 ("wifi: mac80211: track changes in AP's TPE")

Jakub Kicinski committed 2 years ago

Commit 76ed6262 parents 7829b37 033771c348 files · +3062 −2231Browse files

Unified · Split

348 files
  1. Documentation/admin-guide/kernel-parameters.txt +0 −19
  2. Documentation/driver-api/cxl/memory-devices.rst +15 −0
  3. Documentation/kbuild/modules.rst +4 −4
  4. Documentation/userspace-api/ioctl/ioctl-number.rst +1 −0
  5. MAINTAINERS +5 −5
  6. Makefile +1 −1
  7. arch/arm/boot/dts/rockchip/rk3066a.dtsi +1 −0
  8. arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts +13 −5
  9. arch/arm64/boot/dts/rockchip/rk3308.dtsi +1 −1
  10. arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts +2 −2
  11. arch/arm64/boot/dts/rockchip/rk3368.dtsi +3 −0
  12. arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +1 −1
  13. arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts +1 −1
  14. arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts +1 −0
  15. arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts +1 −0
  16. arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +1 −0
  17. arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi +5 −0
  18. arch/arm64/boot/dts/rockchip/rk3588s-coolpi-4b.dts +2 −2
  19. arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +2 −0
  20. arch/arm64/include/asm/pgtable-hwdef.h +1 −0
  21. arch/arm64/include/asm/unistd32.h +1 −1
  22. arch/arm64/kernel/pi/map_kernel.c +1 −1
  23. arch/arm64/kernel/syscall.c +7 −9
  24. arch/arm64/mm/mmu.c +2 −1
  25. arch/csky/include/uapi/asm/unistd.h +1 −0
  26. arch/csky/kernel/syscall.c +1 −1
  27. arch/hexagon/include/asm/syscalls.h +6 −0
  28. arch/hexagon/include/uapi/asm/unistd.h +1 −0
  29. arch/hexagon/kernel/syscalltab.c +7 −0
  30. arch/loongarch/kernel/syscall.c +1 −1
  31. arch/microblaze/kernel/sys_microblaze.c +1 −1
  32. arch/mips/kernel/syscalls/syscall_n32.tbl +1 −1
  33. arch/mips/kernel/syscalls/syscall_o32.tbl +1 −1
  34. arch/parisc/Kconfig +1 −0
  35. arch/parisc/kernel/sys_parisc32.c +0 −9
  36. arch/parisc/kernel/syscalls/syscall.tbl +3 −3
  37. arch/powerpc/kernel/syscalls/syscall.tbl +5 −1
  38. arch/riscv/boot/dts/canaan/canaan_kd233.dts +6 −1
  39. arch/riscv/boot/dts/canaan/k210.dtsi +16 −7
  40. arch/riscv/boot/dts/canaan/k210_generic.dts +4 −1
  41. arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts +8 −1
  42. arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts +6 −1
  43. arch/riscv/boot/dts/canaan/sipeed_maix_go.dts +8 −1
  44. arch/riscv/boot/dts/canaan/sipeed_maixduino.dts +8 −2
  45. arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1 −1
  46. arch/riscv/include/asm/insn.h +1 −1
  47. arch/riscv/kernel/ftrace.c +2 −5
  48. arch/riscv/kernel/patch.c +18 −8
  49. arch/riscv/kernel/stacktrace.c +1 −1
  50. arch/riscv/kernel/sys_riscv.c +2 −2
  51. arch/s390/boot/startup.c +7 −4
  52. arch/s390/configs/debug_defconfig +2 −3
  53. arch/s390/configs/defconfig +2 −3
  54. arch/s390/include/asm/entry-common.h +1 −1
  55. arch/s390/kernel/syscall.c +0 −27
  56. arch/s390/kernel/syscalls/syscall.tbl +1 −1
  57. arch/s390/pci/pci_irq.c +1 −1
  58. arch/sh/kernel/sys_sh32.c +11 −0
  59. arch/sh/kernel/syscalls/syscall.tbl +2 −1
  60. arch/sparc/kernel/sys32.S +0 −221
  61. arch/sparc/kernel/syscalls/syscall.tbl +4 −4
  62. arch/x86/entry/syscalls/syscall_32.tbl +1 −1
  63. arch/x86/include/asm/cmpxchg_32.h +5 −7
  64. arch/x86/include/asm/entry-common.h +6 −9
  65. arch/x86/kernel/time.c +1 −19
  66. drivers/ata/ahci.c +12 −5
  67. drivers/ata/libata-core.c +19 −13
  68. drivers/bluetooth/btintel_pcie.c +1 −1
  69. drivers/bluetooth/btnxpuart.c +1 −1
  70. drivers/bluetooth/hci_bcm4377.c +9 −1
  71. drivers/bluetooth/hci_qca.c +15 −3
  72. drivers/counter/ti-eqep.c +6 −0
  73. drivers/cpufreq/intel_pstate.c +6 −7
  74. drivers/crypto/intel/qat/qat_common/Makefile +3 −2
  75. drivers/cxl/core/hdm.c +13 −0
  76. drivers/cxl/core/pmem.c +11 −5
  77. drivers/cxl/core/region.c +98 −5
  78. drivers/cxl/cxl.h +4 −2
  79. drivers/cxl/cxlmem.h +16 −5
  80. drivers/cxl/mem.c +9 −8
  81. drivers/gpio/gpio-davinci.c +5 −0
  82. drivers/gpio/gpio-graniterapids.c +2 −0
  83. drivers/gpio/gpio-pca953x.c +2 −0
  84. drivers/gpio/gpiolib-cdev.c +17 −11
  85. drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +1 −1
  86. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 −2
  87. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +21 −4
  88. drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +16 −2
  89. drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h +3 −2
  90. drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +9 −1
  91. drivers/gpu/drm/amd/display/include/dpcd_defs.h +5 −0
  92. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +13 −0
  93. drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +5 −0
  94. drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v14_0_0_ppsmc.h +2 −2
  95. drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +3 −1
  96. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +73 −0
  97. drivers/gpu/drm/drm_fb_helper.c +3 −3
  98. drivers/gpu/drm/drm_fbdev_dma.c +4 −1
  99. drivers/gpu/drm/drm_file.c +3 −5
  100. drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c +1 −0
  101. drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +6 −0
  102. drivers/gpu/drm/panel/panel-simple.c +1 −0
  103. drivers/i2c/busses/Makefile +2 −4
  104. drivers/i2c/busses/i2c-viai2c-common.c +9 −62
  105. drivers/i2c/busses/i2c-viai2c-common.h +1 −1
  106. drivers/i2c/busses/i2c-viai2c-wmt.c +36 −0
  107. drivers/i2c/busses/i2c-viai2c-zhaoxin.c +91 −22
  108. drivers/i2c/i2c-slave-testunit.c +4 −1
  109. drivers/iio/accel/Kconfig +2 −0
  110. drivers/iio/adc/ad7266.c +2 −0
  111. drivers/iio/adc/xilinx-ams.c +6 −2
  112. drivers/iio/chemical/bme680.h +2 −0
  113. drivers/iio/chemical/bme680_core.c +54 −8
  114. drivers/iio/dac/Kconfig +1 −1
  115. drivers/iio/humidity/hdc3020.c +249 −76
  116. drivers/iommu/amd/init.c +1 −0
  117. drivers/iommu/amd/iommu.c +6 −6
  118. drivers/iommu/intel/iommu.c +10 −10
  119. drivers/irqchip/irq-loongson-eiointc.c +3 −2
  120. drivers/irqchip/irq-loongson-liointc.c +2 −2
  121. drivers/media/pci/intel/ipu6/ipu6-isys-video.c +1 −1
  122. drivers/media/pci/intel/ipu6/ipu6-isys.c +1 −1
  123. drivers/media/pci/intel/ivsc/Kconfig +1 −0
  124. drivers/mmc/host/moxart-mmc.c +43 −35
  125. drivers/mmc/host/sdhci-brcmstb.c +4 −0
  126. drivers/mmc/host/sdhci-pci-core.c +7 −4
  127. drivers/mmc/host/sdhci-pci-o2micro.c +22 −19
  128. drivers/mmc/host/sdhci.c +14 −11
  129. drivers/mtd/nand/raw/nand_base.c +40 −26
  130. drivers/mtd/nand/raw/rockchip-nand-controller.c +3 −3
  131. drivers/net/bonding/bond_options.c +3 −3
  132. drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +1 −0
  133. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 −1
  134. drivers/net/ethernet/broadcom/bnxt/bnxt.c +5 −1
  135. drivers/net/ethernet/intel/e1000e/netdev.c +66 −66
  136. drivers/net/ethernet/intel/ice/ice_hwmon.c +1 −1
  137. drivers/net/ethernet/intel/ice/ice_ptp.c +101 −30
  138. drivers/net/ethernet/intel/ice/ice_ptp.h +9 −0
  139. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +35 −13
  140. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +5 −0
  141. drivers/net/ethernet/mellanox/mlx5/core/eq.c +1 −3
  142. drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c +29 −8
  143. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +17 −5
  144. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +10 −0
  145. drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +1 −3
  146. drivers/net/ethernet/mellanox/mlxsw/core_linecards.c +1 −0
  147. drivers/net/ethernet/renesas/rswitch.c +2 −2
  148. drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +1 −1
  149. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 −3
  150. drivers/net/ethernet/wangxun/libwx/wx_hw.c +1 −0
  151. drivers/net/ethernet/wangxun/libwx/wx_lib.c +7 −3
  152. drivers/net/ethernet/wangxun/libwx/wx_type.h +1 −0
  153. drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +2 −0
  154. drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c +47 −77
  155. drivers/net/ethernet/wangxun/txgbe/txgbe_irq.h +1 −1
  156. drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +5 −4
  157. drivers/net/ntb_netdev.c +1 −1
  158. drivers/net/phy/aquantia/aquantia.h +4 −0
  159. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +7 −7
  160. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +3 −5
  161. drivers/net/wireless/intel/iwlwifi/mvm/rx.c +7 −8
  162. drivers/net/wireless/microchip/wilc1000/hif.c +2 −1
  163. drivers/nvme/host/apple.c +1 −0
  164. drivers/nvme/host/nvme.h +1 −1
  165. drivers/nvme/target/configfs.c +31 −10
  166. drivers/nvme/target/fc.c +1 −1
  167. drivers/pci/msi/msi.c +8 −2
  168. drivers/platform/mellanox/nvsw-sn2201.c +4 −1
  169. drivers/platform/x86/amilo-rfkill.c +1 −0
  170. drivers/platform/x86/firmware_attributes_class.c +1 −0
  171. drivers/platform/x86/ibm_rtl.c +1 −0
  172. drivers/platform/x86/intel/hid.c +1 −0
  173. drivers/platform/x86/intel/pmc/pltdrv.c +1 −0
  174. drivers/platform/x86/intel/rst.c +1 −0
  175. drivers/platform/x86/intel/smartconnect.c +1 −0
  176. drivers/platform/x86/intel/vbtn.c +1 −0
  177. drivers/platform/x86/lg-laptop.c +34 −55
  178. drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c +1 −0
  179. drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c +1 −0
  180. drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c +1 −0
  181. drivers/platform/x86/siemens/simatic-ipc-batt.c +1 −0
  182. drivers/platform/x86/siemens/simatic-ipc.c +1 −0
  183. drivers/platform/x86/toshiba_acpi.c +18 −13
  184. drivers/platform/x86/uv_sysfs.c +1 −0
  185. drivers/platform/x86/wireless-hotkey.c +3 −0
  186. drivers/platform/x86/xo1-rfkill.c +1 −0
  187. drivers/reset/Kconfig +1 −0
  188. drivers/reset/hisilicon/hi6220_reset.c +1 −0
  189. drivers/s390/block/dasd_eckd.c +2 −2
  190. drivers/s390/block/dasd_fba.c +1 −1
  191. drivers/s390/char/sclp.c +1 −0
  192. drivers/s390/cio/vfio_ccw_cp.c +5 −4
  193. drivers/s390/virtio/virtio_ccw.c +3 −1
  194. drivers/scsi/libsas/sas_ata.c +3 −3
  195. drivers/scsi/libsas/sas_discover.c +1 −1
  196. drivers/scsi/libsas/sas_internal.h +14 −0
  197. drivers/scsi/scsi_debug.c +5 −1
  198. drivers/soc/litex/Kconfig +1 −1
  199. drivers/soc/litex/litex_soc_ctrl.c +1 −3
  200. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +2 −2
  201. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +5 −0
  202. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c +1 −1
  203. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c +6 −1
  204. drivers/tee/optee/ffa_abi.c +9 −3
  205. drivers/thermal/gov_step_wise.c +5 −18
  206. drivers/tty/mxser.c +1 −1
  207. drivers/tty/serial/8250/8250_core.c +0 −5
  208. drivers/tty/serial/8250/8250_omap.c +20 −5
  209. drivers/tty/serial/8250/8250_pci.c +12 −1
  210. drivers/tty/serial/bcm63xx_uart.c +5 −2
  211. drivers/tty/serial/imx.c +3 −1
  212. drivers/tty/serial/mcf.c +1 −1
  213. drivers/tty/serial/serial_base.h +0 −30
  214. drivers/tty/serial/serial_base_bus.c +0 −129
  215. drivers/tty/serial/serial_core.c +0 −4
  216. drivers/usb/atm/cxacru.c +14 −0
  217. drivers/usb/dwc3/core.c +19 −7
  218. drivers/usb/gadget/function/f_printer.c +30 −10
  219. drivers/usb/gadget/function/u_ether.c +1 −3
  220. drivers/usb/gadget/udc/aspeed_udc.c +2 −2
  221. drivers/usb/musb/da8xx.c +6 −2
  222. drivers/usb/typec/ucsi/ucsi_acpi.c +61 −0
  223. drivers/usb/typec/ucsi/ucsi_glink.c +4 −1
  224. drivers/usb/typec/ucsi/ucsi_stm32g0.c +15 −4
  225. drivers/watchdog/Kconfig +1 −0
  226. drivers/watchdog/menz69_wdt.c +1 −0
  227. drivers/watchdog/omap_wdt.c +1 −0
  228. drivers/watchdog/simatic-ipc-wdt.c +1 −0
  229. drivers/watchdog/ts4800_wdt.c +1 −0
  230. drivers/watchdog/twl4030_wdt.c +1 −0
  231. fs/afs/inode.c +2 −2
  232. fs/bcachefs/alloc_background.c +139 −124
  233. fs/bcachefs/alloc_background.h +5 −1
  234. fs/bcachefs/alloc_foreground.c +2 −2
  235. fs/bcachefs/bcachefs.h +11 −5
  236. fs/bcachefs/btree_iter.c +6 −13
  237. fs/bcachefs/chardev.c +6 −3
  238. fs/bcachefs/debug.c +69 −40
  239. fs/bcachefs/journal.c +5 −0
  240. fs/bcachefs/journal_io.c +7 −0
  241. fs/bcachefs/journal_seq_blacklist.c +1 −1
  242. fs/bcachefs/sb-errors.c +10 −4
  243. fs/bcachefs/seqmutex.h +4 −7
  244. fs/bcachefs/snapshot.c +3 −0
  245. fs/bcachefs/super.c +5 −1
  246. fs/btrfs/block-group.c +11 −2
  247. fs/btrfs/free-space-cache.c +1 −1
  248. fs/btrfs/qgroup.c +2 −2
  249. fs/btrfs/scrub.c +14 −10
  250. fs/btrfs/tree-log.c +28 −15
  251. fs/dcache.c +14 −17
  252. fs/erofs/super.c +1 −1
  253. fs/erofs/zmap.c +2 −0
  254. fs/erofs/zutil.c +4 −4
  255. fs/locks.c +4 −5
  256. fs/namei.c +8 −2
  257. fs/netfs/buffered_write.c +9 −3
  258. fs/netfs/direct_write.c +2 −1
  259. fs/netfs/internal.h +0 −9
  260. fs/netfs/misc.c +0 −81
  261. fs/netfs/write_issue.c +1 −1
  262. fs/nfsd/nfsctl.c +2 −0
  263. fs/nfsd/nfssvc.c +0 −1
  264. fs/nilfs2/alloc.c +15 −4
  265. fs/nilfs2/alloc.h +2 −2
  266. fs/nilfs2/dat.c +1 −1
  267. fs/nilfs2/dir.c +6 −0
  268. fs/nilfs2/ifile.c +2 −5
  269. fs/nilfs2/nilfs.h +8 −2
  270. fs/nilfs2/the_nilfs.c +6 −0
  271. fs/nilfs2/the_nilfs.h +1 −1
  272. fs/open.c +17 −9
  273. fs/super.c +10 −1
  274. fs/xfs/libxfs/xfs_bmap.c +27 −4
  275. fs/xfs/libxfs/xfs_fs.h +1 −1
  276. fs/xfs/libxfs/xfs_inode_buf.c +18 −5
  277. fs/xfs/xfs_bmap_util.c +22 −8
  278. fs/xfs/xfs_bmap_util.h +1 −1
  279. fs/xfs/xfs_icache.c +1 −1
  280. fs/xfs/xfs_inode.c +13 −11
  281. fs/xfs/xfs_iomap.c +12 −22
  282. include/asm-generic/syscalls.h +1 −1
  283. include/linux/closure.h +23 −0
  284. include/linux/compat.h +1 −1
  285. include/linux/filter.h +7 −7
  286. include/linux/fsnotify.h +7 −1
  287. include/linux/ftrace.h +3 −3
  288. include/linux/io_uring_types.h +0 −1
  289. include/linux/libata.h +1 −0
  290. include/linux/mlx5/mlx5_ifc.h +5 −1
  291. include/linux/module.h +7 −7
  292. include/linux/nvme.h +4 −2
  293. include/linux/phy.h +1 −1
  294. include/linux/printk.h +0 −3
  295. include/linux/serial_core.h +19 −2
  296. include/linux/syscalls.h +16 −10
  297. include/net/bluetooth/hci.h +11 −0
  298. include/net/bluetooth/hci_sync.h +2 −0
  299. include/net/mac80211.h +1 −1
  300. include/uapi/asm-generic/unistd.h +1 −1
  301. include/uapi/linux/trace_mmap.h +1 −1
  302. io_uring/io_uring.c +2 −2
  303. io_uring/net.c +6 −4
  304. kernel/bpf/core.c +3 −4
  305. kernel/cpu.c +7 −4
  306. kernel/exit.c +2 −0
  307. kernel/kallsyms.c +12 −11
  308. kernel/module/kallsyms.c +12 −13
  309. kernel/printk/Makefile +1 −1
  310. kernel/printk/conopt.c +0 −146
  311. kernel/printk/console_cmdline.h +0 −6
  312. kernel/printk/printk.c +4 −19
  313. kernel/sys_ni.c +1 −1
  314. kernel/time/hrtimer.c +2 −0
  315. kernel/trace/ftrace.c +5 −8
  316. lib/closure.c +46 −6
  317. lib/string_helpers_kunit.c +1 −0
  318. lib/string_kunit.c +1 −0
  319. mm/page-writeback.c +27 −5
  320. net/bluetooth/hci_conn.c +12 −3
  321. net/bluetooth/hci_core.c +22 −54
  322. net/bluetooth/hci_event.c +30 −3
  323. net/bluetooth/hci_sync.c +13 −0
  324. net/bluetooth/iso.c +1 −2
  325. net/bluetooth/l2cap_core.c +3 −0
  326. net/bluetooth/l2cap_sock.c +11 −3
  327. net/core/datagram.c +13 −6
  328. net/ipv4/inet_diag.c +2 −0
  329. net/ipv4/tcp_input.c +8 −1
  330. net/ipv4/tcp_metrics.c +1 −0
  331. net/mac802154/main.c +8 −6
  332. net/mac802154/tx.c +4 −4
  333. net/netfilter/nf_tables_api.c +1 −2
  334. net/sunrpc/svc.c +4 −1
  335. net/sunrpc/svc_xprt.c +3 −5
  336. net/unix/garbage.c +5 −4
  337. scripts/Makefile.dtbinst +1 −1
  338. scripts/Makefile.host +1 −1
  339. scripts/Makefile.package +1 −1
  340. scripts/gdb/linux/Makefile +1 −1
  341. scripts/package/kernel.spec +3 −5
  342. tools/power/x86/turbostat/Makefile +5 −1
  343. tools/power/x86/turbostat/turbostat.c +10 −10
  344. tools/testing/cxl/test/cxl.c +4 −0
  345. tools/testing/selftests/kselftest_harness.h +24 −19
  346. tools/testing/selftests/net/af_unix/scm_rights.c +23 −2
  347. tools/testing/selftests/net/msg_zerocopy.c +12 −2
  348. tools/testing/selftests/resctrl/cat_test.c +22 −10
Documentation/admin-guide/kernel-parameters.txt+0−19
@@ -788,25 +788,6 @@ · 787 unmodified lines
788788 Documentation/networking/netconsole.rst for an
789789 alternative.
790790
791− <DEVNAME>:<n>.<n>[,options]
792− Use the specified serial port on the serial core bus.
793− The addressing uses DEVNAME of the physical serial port
794− device, followed by the serial core controller instance,
795− and the serial port instance. The options are the same
796− as documented for the ttyS addressing above.
797−
798− The mapping of the serial ports to the tty instances
799− can be viewed with:
800−
801− $ ls -d /sys/bus/serial-base/devices/*:*.*/tty/*
802− /sys/bus/serial-base/devices/00:04:0.0/tty/ttyS0
803−
804− In the above example, the console can be addressed with
805− console=00:04:0.0. Note that a console addressed this
806− way will only get added when the related device driver
807− is ready. The use of an earlycon parameter in addition to
808− the console may be desired for console output early on.
809−
810791 uart[8250],io,<addr>[,options]
811792 uart[8250],mmio,<addr>[,options]
812793 uart[8250],mmio16,<addr>[,options]
Documentation/driver-api/cxl/memory-devices.rst+15−0
@@ -328,6 +328,12 @@ CXL Memory Device · 327 unmodified lines
328328 .. kernel-doc:: drivers/cxl/mem.c
329329 :doc: cxl mem
330330
331+.. kernel-doc:: drivers/cxl/cxlmem.h
332+ :internal:
333+
334+.. kernel-doc:: drivers/cxl/core/memdev.c
335+ :identifiers:
336+
331337 CXL Port
332338 --------
333339 .. kernel-doc:: drivers/cxl/port.c
@@ -341,6 +347,15 @@ CXL Core · 7 unmodified lines
341347 .. kernel-doc:: drivers/cxl/cxl.h
342348 :internal:
343349
350+.. kernel-doc:: drivers/cxl/core/hdm.c
351+ :doc: cxl core hdm
352+
353+.. kernel-doc:: drivers/cxl/core/hdm.c
354+ :identifiers:
355+
356+.. kernel-doc:: drivers/cxl/core/cdat.c
357+ :identifiers:
358+
344359 .. kernel-doc:: drivers/cxl/core/port.c
345360 :doc: cxl core
346361
Documentation/kbuild/modules.rst+4−4
@@ -128,7 +128,7 @@ executed to make module versioning work. · 127 unmodified lines
128128
129129 modules_install
130130 Install the external module(s). The default location is
131− /lib/modules/<kernel_release>/extra/, but a prefix may
131+ /lib/modules/<kernel_release>/updates/, but a prefix may
132132 be added with INSTALL_MOD_PATH (discussed in section 5).
133133
134134 clean
@@ -417,7 +417,7 @@ directory: · 282 unmodified lines
417417
418418 And external modules are installed in:
419419
420− /lib/modules/$(KERNELRELEASE)/extra/
420+ /lib/modules/$(KERNELRELEASE)/updates/
421421
422422 5.1 INSTALL_MOD_PATH
423423 --------------------
@@ -438,10 +438,10 @@ And external modules are installed in: · 14 unmodified lines
438438 -------------------
439439
440440 External modules are by default installed to a directory under
441− /lib/modules/$(KERNELRELEASE)/extra/, but you may wish to
441+ /lib/modules/$(KERNELRELEASE)/updates/, but you may wish to
442442 locate modules for a specific functionality in a separate
443443 directory. For this purpose, use INSTALL_MOD_DIR to specify an
444− alternative name to "extra."::
444+ alternative name to "updates."::
445445
446446 $ make INSTALL_MOD_DIR=gandalf -C $KDIR \
447447 M=$PWD modules_install
Documentation/userspace-api/ioctl/ioctl-number.rst+1−0
@@ -186,6 +186,7 @@ Code Seq# Include File Comments · 185 unmodified lines
186186 'Q' all linux/soundcard.h
187187 'R' 00-1F linux/random.h conflict!
188188 'R' 01 linux/rfkill.h conflict!
189+'R' 20-2F linux/trace_mmap.h
189190 'R' C0-DF net/bluetooth/rfcomm.h
190191 'R' E0 uapi/linux/fsl_mc.h
191192 'S' all linux/cdrom.h conflict!
MAINTAINERS+5−5
@@ -1044,7 +1044,7 @@ M: Joerg Roedel <joro@8bytes.org> · 1043 unmodified lines
10441044 R: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
10451045 L: iommu@lists.linux.dev
10461046 S: Maintained
1047−T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
1047+T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
10481048 F: drivers/iommu/amd/
10491049 F: include/linux/amd-iommu.h
10501050
@@ -11157,7 +11157,7 @@ M: David Woodhouse <dwmw2@infradead.org> · 10106 unmodified lines
1115711157 M: Lu Baolu <baolu.lu@linux.intel.com>
1115811158 L: iommu@lists.linux.dev
1115911159 S: Supported
11160−T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11160+T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1116111161 F: drivers/iommu/intel/
1116211162
1116311163 INTEL IPU3 CSI-2 CIO2 DRIVER
@@ -11530,7 +11530,7 @@ IOMMU DMA-API LAYER · 366 unmodified lines
1153011530 M: Robin Murphy <robin.murphy@arm.com>
1153111531 L: iommu@lists.linux.dev
1153211532 S: Maintained
11533−T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11533+T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1153411534 F: drivers/iommu/dma-iommu.c
1153511535 F: drivers/iommu/dma-iommu.h
1153611536 F: drivers/iommu/iova.c
@@ -11542,7 +11542,7 @@ M: Will Deacon <will@kernel.org> · 5 unmodified lines
1154211542 R: Robin Murphy <robin.murphy@arm.com>
1154311543 L: iommu@lists.linux.dev
1154411544 S: Maintained
11545−T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
11545+T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
1154611546 F: Documentation/devicetree/bindings/iommu/
1154711547 F: Documentation/userspace-api/iommu.rst
1154811548 F: drivers/iommu/
@@ -19324,7 +19324,7 @@ F: drivers/perf/riscv_pmu_legacy.c · 7775 unmodified lines
1932419324 F: drivers/perf/riscv_pmu_sbi.c
1932519325
1932619326 RISC-V THEAD SoC SUPPORT
19327−M: Jisheng Zhang <jszhang@kernel.org>
19327+M: Drew Fustini <drew@pdp7.com>
1932819328 M: Guo Ren <guoren@kernel.org>
1932919329 M: Fu Wei <wefu@redhat.com>
1933019330 L: linux-riscv@lists.infradead.org
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 10
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc5
5+EXTRAVERSION = -rc6
66 NAME = Baby Opossum Posse
77
88 # *DOCUMENTATION*
arch/arm/boot/dts/rockchip/rk3066a.dtsi+1−0
@@ -128,6 +128,7 @@ · 127 unmodified lines
128128 pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>;
129129 power-domains = <&power RK3066_PD_VIO>;
130130 rockchip,grf = <&grf>;
131+ #sound-dai-cells = <0>;
131132 status = "disabled";
132133
133134 ports {
arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts+13−5
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 */
66
77 /dts-v1/;
8+
9+#include <dt-bindings/leds/common.h>
810 #include "rk3308.dtsi"
911
1012 / {
@@ -24,17 +26,21 @@ · 13 unmodified lines
2426 leds {
2527 compatible = "gpio-leds";
2628 pinctrl-names = "default";
27− pinctrl-0 = <&green_led_gio>, <&heartbeat_led_gpio>;
29+ pinctrl-0 = <&green_led>, <&heartbeat_led>;
2830
2931 green-led {
32+ color = <LED_COLOR_ID_GREEN>;
3033 default-state = "on";
34+ function = LED_FUNCTION_POWER;
3135 gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
3236 label = "rockpis:green:power";
3337 linux,default-trigger = "default-on";
3438 };
3539
3640 blue-led {
41+ color = <LED_COLOR_ID_BLUE>;
3742 default-state = "on";
43+ function = LED_FUNCTION_HEARTBEAT;
3844 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
3945 label = "rockpis:blue:user";
4046 linux,default-trigger = "heartbeat";
@@ -126,10 +132,12 @@ · 85 unmodified lines
126132 };
127133
128134 &emmc {
129− bus-width = <4>;
130135 cap-mmc-highspeed;
131− mmc-hs200-1_8v;
136+ cap-sd-highspeed;
137+ no-sdio;
132138 non-removable;
139+ pinctrl-names = "default";
140+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>;
133141 vmmc-supply = <&vcc_io>;
134142 status = "okay";
135143 };
@@ -214,11 +222,11 @@ · 78 unmodified lines
214222 pinctrl-0 = <&rtc_32k>;
215223
216224 leds {
217− green_led_gio: green-led-gpio {
225+ green_led: green-led {
218226 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
219227 };
220228
221− heartbeat_led_gpio: heartbeat-led-gpio {
229+ heartbeat_led: heartbeat-led {
222230 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
223231 };
224232 };
arch/arm64/boot/dts/rockchip/rk3308.dtsi+1−1
@@ -811,7 +811,7 @@ · 810 unmodified lines
811811 clocks = <&cru SCLK_I2S2_8CH_TX_OUT>,
812812 <&cru SCLK_I2S2_8CH_RX_OUT>,
813813 <&cru PCLK_ACODEC>;
814− reset-names = "codec-reset";
814+ reset-names = "codec";
815815 resets = <&cru SRST_ACODEC_P>;
816816 #sound-dai-cells = <0>;
817817 status = "disabled";
arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts+2−2
@@ -241,8 +241,8 @@ · 240 unmodified lines
241241 rk805: pmic@18 {
242242 compatible = "rockchip,rk805";
243243 reg = <0x18>;
244− interrupt-parent = <&gpio2>;
245− interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
244+ interrupt-parent = <&gpio0>;
245+ interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
246246 #clock-cells = <1>;
247247 clock-output-names = "xin32k", "rk805-clkout2";
248248 gpio-controller;
arch/arm64/boot/dts/rockchip/rk3368.dtsi+3−0
@@ -793,6 +793,7 @@ · 792 unmodified lines
793793 dma-names = "tx";
794794 pinctrl-names = "default";
795795 pinctrl-0 = <&spdif_tx>;
796+ #sound-dai-cells = <0>;
796797 status = "disabled";
797798 };
798799
@@ -804,6 +805,7 @@ · 5 unmodified lines
804805 clocks = <&cru SCLK_I2S_2CH>, <&cru HCLK_I2S_2CH>;
805806 dmas = <&dmac_bus 6>, <&dmac_bus 7>;
806807 dma-names = "tx", "rx";
808+ #sound-dai-cells = <0>;
807809 status = "disabled";
808810 };
809811
@@ -817,6 +819,7 @@ · 7 unmodified lines
817819 dma-names = "tx", "rx";
818820 pinctrl-names = "default";
819821 pinctrl-0 = <&i2s_8ch_bus>;
822+ #sound-dai-cells = <0>;
820823 status = "disabled";
821824 };
822825
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi+1−1
@@ -450,7 +450,7 @@ ap_i2c_audio: &i2c8 { · 449 unmodified lines
450450 dlg,btn-cfg = <50>;
451451 dlg,mic-det-thr = <500>;
452452 dlg,jack-ins-deb = <20>;
453− dlg,jack-det-rate = "32ms_64ms";
453+ dlg,jack-det-rate = "32_64";
454454 dlg,jack-rem-deb = <1>;
455455
456456 dlg,a-d-btn-thr = <0xa>;
arch/arm64/boot/dts/rockchip/rk3566-quartz64-b.dts+1−1
@@ -289,7 +289,7 @@ · 288 unmodified lines
289289 regulator-name = "vdd_gpu";
290290 regulator-always-on;
291291 regulator-boot-on;
292− regulator-min-microvolt = <900000>;
292+ regulator-min-microvolt = <500000>;
293293 regulator-max-microvolt = <1350000>;
294294 regulator-ramp-delay = <6001>;
295295
arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts+1−0
@@ -444,6 +444,7 @@ · 443 unmodified lines
444444 &sdmmc {
445445 bus-width = <4>;
446446 cap-sd-highspeed;
447+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
447448 disable-wp;
448449 max-frequency = <150000000>;
449450 no-sdio;
arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts+1−0
@@ -435,6 +435,7 @@ · 434 unmodified lines
435435 &sdmmc {
436436 bus-width = <4>;
437437 cap-sd-highspeed;
438+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
438439 disable-wp;
439440 max-frequency = <150000000>;
440441 no-sdio;
arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts+1−0
@@ -383,6 +383,7 @@ · 382 unmodified lines
383383 bus-width = <4>;
384384 cap-mmc-highspeed;
385385 cap-sd-highspeed;
386+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
386387 disable-wp;
387388 sd-uhs-sdr104;
388389 vmmc-supply = <&vcc_3v3_s3>;
arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi+5−0
@@ -344,6 +344,11 @@ · 343 unmodified lines
344344 };
345345 };
346346
347+&pwm0 {
348+ pinctrl-0 = <&pwm0m1_pins>;
349+ pinctrl-names = "default";
350+};
351+
347352 &saradc {
348353 vref-supply = <&vcc_1v8_s0>;
349354 status = "okay";
arch/arm64/boot/dts/rockchip/rk3588s-coolpi-4b.dts+2−2
@@ -288,9 +288,9 @@ · 287 unmodified lines
288288 pinctrl-0 = <&i2c7m0_xfer>;
289289 status = "okay";
290290
291− es8316: audio-codec@11 {
291+ es8316: audio-codec@10 {
292292 compatible = "everest,es8316";
293− reg = <0x11>;
293+ reg = <0x10>;
294294 assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
295295 assigned-clock-rates = <12288000>;
296296 clocks = <&cru I2S0_8CH_MCLKOUT>;
arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts+2−0
@@ -366,6 +366,7 @@ · 365 unmodified lines
366366 bus-width = <4>;
367367 cap-mmc-highspeed;
368368 cap-sd-highspeed;
369+ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
369370 disable-wp;
370371 max-frequency = <150000000>;
371372 no-sdio;
@@ -393,6 +394,7 @@ · 21 unmodified lines
393394 pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
394395 <&rk806_dvs2_null>, <&rk806_dvs3_null>;
395396 spi-max-frequency = <1000000>;
397+ system-power-controller;
396398
397399 vcc1-supply = <&vcc5v0_sys>;
398400 vcc2-supply = <&vcc5v0_sys>;
arch/arm64/include/asm/pgtable-hwdef.h+1−0
@@ -170,6 +170,7 @@ · 169 unmodified lines
170170 #define PTE_CONT (_AT(pteval_t, 1) << 52) /* Contiguous range */
171171 #define PTE_PXN (_AT(pteval_t, 1) << 53) /* Privileged XN */
172172 #define PTE_UXN (_AT(pteval_t, 1) << 54) /* User XN */
173+#define PTE_SWBITS_MASK _AT(pteval_t, (BIT(63) | GENMASK(58, 55)))
173174
174175 #define PTE_ADDR_LOW (((_AT(pteval_t, 1) << (50 - PAGE_SHIFT)) - 1) << PAGE_SHIFT)
175176 #ifdef CONFIG_ARM64_PA_BITS_52
arch/arm64/include/asm/unistd32.h+1−1
@@ -840,7 +840,7 @@ __SYSCALL(__NR_pselect6_time64, compat_sys_pselect6_time64) · 839 unmodified lines
840840 #define __NR_ppoll_time64 414
841841 __SYSCALL(__NR_ppoll_time64, compat_sys_ppoll_time64)
842842 #define __NR_io_pgetevents_time64 416
843−__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
843+__SYSCALL(__NR_io_pgetevents_time64, compat_sys_io_pgetevents_time64)
844844 #define __NR_recvmmsg_time64 417
845845 __SYSCALL(__NR_recvmmsg_time64, compat_sys_recvmmsg_time64)
846846 #define __NR_mq_timedsend_time64 418
arch/arm64/kernel/pi/map_kernel.c+1−1
@@ -173,7 +173,7 @@ static void __init remap_idmap_for_lpa2(void) · 172 unmodified lines
173173 * Don't bother with the FDT, we no longer need it after this.
174174 */
175175 memset(init_idmap_pg_dir, 0,
176− (u64)init_idmap_pg_dir - (u64)init_idmap_pg_end);
176+ (u64)init_idmap_pg_end - (u64)init_idmap_pg_dir);
177177
178178 create_init_idmap(init_idmap_pg_dir, mask);
179179 dsb(ishst);
arch/arm64/kernel/syscall.c+7−9
@@ -53,17 +53,15 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, · 52 unmodified lines
5353 syscall_set_return_value(current, regs, 0, ret);
5454
5555 /*
56− * Ultimately, this value will get limited by KSTACK_OFFSET_MAX(),
57− * but not enough for arm64 stack utilization comfort. To keep
58− * reasonable stack head room, reduce the maximum offset to 9 bits.
56+ * This value will get limited by KSTACK_OFFSET_MAX(), which is 10
57+ * bits. The actual entropy will be further reduced by the compiler
58+ * when applying stack alignment constraints: the AAPCS mandates a
59+ * 16-byte aligned SP at function boundaries, which will remove the
60+ * 4 low bits from any entropy chosen here.
5961 *
60− * The actual entropy will be further reduced by the compiler when
61− * applying stack alignment constraints: the AAPCS mandates a
62− * 16-byte (i.e. 4-bit) aligned SP at function boundaries.
63− *
64− * The resulting 5 bits of entropy is seen in SP[8:4].
62+ * The resulting 6 bits of entropy is seen in SP[9:4].
6563 */
66− choose_random_kstack_offset(get_random_u16() & 0x1FF);
64+ choose_random_kstack_offset(get_random_u16());
6765 }
6866
6967 static inline bool has_syscall_work(unsigned long flags)
arch/arm64/mm/mmu.c+2−1
@@ -124,7 +124,8 @@ bool pgattr_change_is_safe(u64 old, u64 new) · 123 unmodified lines
124124 * The following mapping attributes may be updated in live
125125 * kernel mappings without the need for break-before-make.
126126 */
127− pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG;
127+ pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG |
128+ PTE_SWBITS_MASK;
128129
129130 /* creating or taking down mappings is always safe */
130131 if (!pte_valid(__pte(old)) || !pte_valid(__pte(new)))
arch/csky/include/uapi/asm/unistd.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #define __ARCH_WANT_SYS_CLONE3
77 #define __ARCH_WANT_SET_GET_RLIMIT
88 #define __ARCH_WANT_TIME32_SYSCALLS
9+#define __ARCH_WANT_SYNC_FILE_RANGE2
910 #include <asm-generic/unistd.h>
1011
1112 #define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
arch/csky/kernel/syscall.c+1−1
@@ -20,7 +20,7 @@ SYSCALL_DEFINE6(mmap2, · 19 unmodified lines
2020 unsigned long, prot,
2121 unsigned long, flags,
2222 unsigned long, fd,
23− off_t, offset)
23+ unsigned long, offset)
2424 {
2525 if (unlikely(offset & (~PAGE_MASK >> 12)))
2626 return -EINVAL;
arch/hexagon/include/asm/syscalls.h+6−0
@@ -0,0 +1,6 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#include <asm-generic/syscalls.h>
4+
5+asmlinkage long sys_hexagon_fadvise64_64(int fd, int advice,
6+ u32 a2, u32 a3, u32 a4, u32 a5);
arch/hexagon/include/uapi/asm/unistd.h+1−0
@@ -36,5 +36,6 @@ · 35 unmodified lines
3636 #define __ARCH_WANT_SYS_VFORK
3737 #define __ARCH_WANT_SYS_FORK
3838 #define __ARCH_WANT_TIME32_SYSCALLS
39+#define __ARCH_WANT_SYNC_FILE_RANGE2
3940
4041 #include <asm-generic/unistd.h>
arch/hexagon/kernel/syscalltab.c+7−0
@@ -14,6 +14,13 @@ · 13 unmodified lines
1414 #undef __SYSCALL
1515 #define __SYSCALL(nr, call) [nr] = (call),
1616
17+SYSCALL_DEFINE6(hexagon_fadvise64_64, int, fd, int, advice,
18+ SC_ARG64(offset), SC_ARG64(len))
19+{
20+ return ksys_fadvise64_64(fd, SC_VAL64(loff_t, offset), SC_VAL64(loff_t, len), advice);
21+}
22+#define sys_fadvise64_64 sys_hexagon_fadvise64_64
23+
1724 void *sys_call_table[__NR_syscalls] = {
1825 #include <asm/unistd.h>
1926 };
arch/loongarch/kernel/syscall.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #define __SYSCALL(nr, call) [nr] = (call),
2323
2424 SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long,
25− prot, unsigned long, flags, unsigned long, fd, off_t, offset)
25+ prot, unsigned long, flags, unsigned long, fd, unsigned long, offset)
2626 {
2727 if (offset & ~PAGE_MASK)
2828 return -EINVAL;
arch/microblaze/kernel/sys_microblaze.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535
3636 SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
3737 unsigned long, prot, unsigned long, flags, unsigned long, fd,
38− off_t, pgoff)
38+ unsigned long, pgoff)
3939 {
4040 if (pgoff & ~PAGE_MASK)
4141 return -EINVAL;
arch/mips/kernel/syscalls/syscall_n32.tbl+1−1
@@ -354,7 +354,7 @@ · 353 unmodified lines
354354 412 n32 utimensat_time64 sys_utimensat
355355 413 n32 pselect6_time64 compat_sys_pselect6_time64
356356 414 n32 ppoll_time64 compat_sys_ppoll_time64
357−416 n32 io_pgetevents_time64 sys_io_pgetevents
357+416 n32 io_pgetevents_time64 compat_sys_io_pgetevents_time64
358358 417 n32 recvmmsg_time64 compat_sys_recvmmsg_time64
359359 418 n32 mq_timedsend_time64 sys_mq_timedsend
360360 419 n32 mq_timedreceive_time64 sys_mq_timedreceive
arch/mips/kernel/syscalls/syscall_o32.tbl+1−1
@@ -403,7 +403,7 @@ · 402 unmodified lines
403403 412 o32 utimensat_time64 sys_utimensat sys_utimensat
404404 413 o32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64
405405 414 o32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64
406−416 o32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents
406+416 o32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64
407407 417 o32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64
408408 418 o32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend
409409 419 o32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive
arch/parisc/Kconfig+1−0
@@ -16,6 +16,7 @@ config PARISC · 15 unmodified lines
1616 select ARCH_HAS_UBSAN
1717 select ARCH_HAS_PTE_SPECIAL
1818 select ARCH_NO_SG_CHAIN
19+ select ARCH_SPLIT_ARG64 if !64BIT
1920 select ARCH_SUPPORTS_HUGETLBFS if PA20
2021 select ARCH_SUPPORTS_MEMORY_FAILURE
2122 select ARCH_STACKWALK
arch/parisc/kernel/sys_parisc32.c+0−9
@@ -23,12 +23,3 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, · 22 unmodified lines
2323 current->comm, current->pid, r20);
2424 return -ENOSYS;
2525 }
26−
27−asmlinkage long sys32_fanotify_mark(compat_int_t fanotify_fd, compat_uint_t flags,
28− compat_uint_t mask0, compat_uint_t mask1, compat_int_t dfd,
29− const char __user * pathname)
30−{
31− return sys_fanotify_mark(fanotify_fd, flags,
32− ((__u64)mask1 << 32) | mask0,
33− dfd, pathname);
34−}
arch/parisc/kernel/syscalls/syscall.tbl+3−3
@@ -108,7 +108,7 @@ · 107 unmodified lines
108108 95 common fchown sys_fchown
109109 96 common getpriority sys_getpriority
110110 97 common setpriority sys_setpriority
111−98 common recv sys_recv
111+98 common recv sys_recv compat_sys_recv
112112 99 common statfs sys_statfs compat_sys_statfs
113113 100 common fstatfs sys_fstatfs compat_sys_fstatfs
114114 101 common stat64 sys_stat64
@@ -135,7 +135,7 @@ · 20 unmodified lines
135135 120 common clone sys_clone_wrapper
136136 121 common setdomainname sys_setdomainname
137137 122 common sendfile sys_sendfile compat_sys_sendfile
138−123 common recvfrom sys_recvfrom
138+123 common recvfrom sys_recvfrom compat_sys_recvfrom
139139 124 32 adjtimex sys_adjtimex_time32
140140 124 64 adjtimex sys_adjtimex
141141 125 common mprotect sys_mprotect
@@ -364,7 +364,7 @@ · 222 unmodified lines
364364 320 common accept4 sys_accept4
365365 321 common prlimit64 sys_prlimit64
366366 322 common fanotify_init sys_fanotify_init
367−323 common fanotify_mark sys_fanotify_mark sys32_fanotify_mark
367+323 common fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark
368368 324 32 clock_adjtime sys_clock_adjtime32
369369 324 64 clock_adjtime sys_clock_adjtime
370370 325 common name_to_handle_at sys_name_to_handle_at
arch/powerpc/kernel/syscalls/syscall.tbl+5−1
@@ -230,8 +230,10 @@ · 229 unmodified lines
230230 178 nospu rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend
231231 179 32 pread64 sys_ppc_pread64 compat_sys_ppc_pread64
232232 179 64 pread64 sys_pread64
233+179 spu pread64 sys_pread64
233234 180 32 pwrite64 sys_ppc_pwrite64 compat_sys_ppc_pwrite64
234235 180 64 pwrite64 sys_pwrite64
236+180 spu pwrite64 sys_pwrite64
235237 181 common chown sys_chown
236238 182 common getcwd sys_getcwd
237239 183 common capget sys_capget
@@ -246,6 +248,7 @@ · 8 unmodified lines
246248 190 common ugetrlimit sys_getrlimit compat_sys_getrlimit
247249 191 32 readahead sys_ppc_readahead compat_sys_ppc_readahead
248250 191 64 readahead sys_readahead
251+191 spu readahead sys_readahead
249252 192 32 mmap2 sys_mmap2 compat_sys_mmap2
250253 193 32 truncate64 sys_ppc_truncate64 compat_sys_ppc_truncate64
251254 194 32 ftruncate64 sys_ppc_ftruncate64 compat_sys_ppc_ftruncate64
@@ -293,6 +296,7 @@ · 41 unmodified lines
293296 232 nospu set_tid_address sys_set_tid_address
294297 233 32 fadvise64 sys_ppc32_fadvise64 compat_sys_ppc32_fadvise64
295298 233 64 fadvise64 sys_fadvise64
299+233 spu fadvise64 sys_fadvise64
296300 234 nospu exit_group sys_exit_group
297301 235 nospu lookup_dcookie sys_ni_syscall
298302 236 common epoll_create sys_epoll_create
@@ -502,7 +506,7 @@ · 203 unmodified lines
502506 412 32 utimensat_time64 sys_utimensat sys_utimensat
503507 413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64
504508 414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64
505−416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents
509+416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64
506510 417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64
507511 418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend
508512 419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive
arch/riscv/boot/dts/canaan/canaan_kd233.dts+6−1
@@ -15,6 +15,10 @@ · 14 unmodified lines
1515 model = "Kendryte KD233";
1616 compatible = "canaan,kendryte-kd233", "canaan,kendryte-k210";
1717
18+ aliases {
19+ serial0 = &uarths0;
20+ };
21+
1822 chosen {
1923 bootargs = "earlycon console=ttySIF0";
2024 stdout-path = "serial0:115200n8";
@@ -46,7 +50,6 @@ · 25 unmodified lines
4650 &fpioa {
4751 pinctrl-0 = <&jtag_pinctrl>;
4852 pinctrl-names = "default";
49− status = "okay";
5053
5154 jtag_pinctrl: jtag-pinmux {
5255 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -118,6 +121,7 @@ · 65 unmodified lines
118121 #sound-dai-cells = <1>;
119122 pinctrl-0 = <&i2s0_pinctrl>;
120123 pinctrl-names = "default";
124+ status = "okay";
121125 };
122126
123127 &spi0 {
@@ -125,6 +129,7 @@ · 1 unmodified line
125129 pinctrl-names = "default";
126130 num-cs = <1>;
127131 cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
132+ status = "okay";
128133
129134 panel@0 {
130135 compatible = "canaan,kd233-tft", "ilitek,ili9341";
arch/riscv/boot/dts/canaan/k210.dtsi+16−7
@@ -16,13 +16,6 @@ · 15 unmodified lines
1616 #size-cells = <1>;
1717 compatible = "canaan,kendryte-k210";
1818
19− aliases {
20− serial0 = &uarths0;
21− serial1 = &uart1;
22− serial2 = &uart2;
23− serial3 = &uart3;
24− };
25−
2619 /*
2720 * The K210 has an sv39 MMU following the privileged specification v1.9.
2821 * Since this is a non-ratified draft specification, the kernel does not
@@ -137,6 +130,7 @@ · 108 unmodified lines
137130 reg = <0x38000000 0x1000>;
138131 interrupts = <33>;
139132 clocks = <&sysclk K210_CLK_CPU>;
133+ status = "disabled";
140134 };
141135
142136 gpio0: gpio-controller@38001000 {
@@ -152,6 +146,7 @@ · 9 unmodified lines
152146 <62>, <63>, <64>, <65>;
153147 gpio-controller;
154148 ngpios = <32>;
149+ status = "disabled";
155150 };
156151
157152 dmac0: dma-controller@50000000 {
@@ -187,6 +182,7 @@ · 29 unmodified lines
187182 <&sysclk K210_CLK_GPIO>;
188183 clock-names = "bus", "db";
189184 resets = <&sysrst K210_RST_GPIO>;
185+ status = "disabled";
190186
191187 gpio1_0: gpio-port@0 {
192188 #gpio-cells = <2>;
@@ -214,6 +210,7 @@ · 21 unmodified lines
214210 dsr-override;
215211 cts-override;
216212 ri-override;
213+ status = "disabled";
217214 };
218215
219216 uart2: serial@50220000 {
@@ -230,6 +227,7 @@ · 10 unmodified lines
230227 dsr-override;
231228 cts-override;
232229 ri-override;
230+ status = "disabled";
233231 };
234232
235233 uart3: serial@50230000 {
@@ -246,6 +244,7 @@ · 10 unmodified lines
246244 dsr-override;
247245 cts-override;
248246 ri-override;
247+ status = "disabled";
249248 };
250249
251250 spi2: spi@50240000 {
@@ -259,6 +258,7 @@ · 7 unmodified lines
259258 <&sysclk K210_CLK_APB0>;
260259 clock-names = "ssi_clk", "pclk";
261260 resets = <&sysrst K210_RST_SPI2>;
261+ status = "disabled";
262262 };
263263
264264 i2s0: i2s@50250000 {
@@ -268,6 +268,7 @@ · 3 unmodified lines
268268 clocks = <&sysclk K210_CLK_I2S0>;
269269 clock-names = "i2sclk";
270270 resets = <&sysrst K210_RST_I2S0>;
271+ status = "disabled";
271272 };
272273
273274 i2s1: i2s@50260000 {
@@ -277,6 +278,7 @@ · 3 unmodified lines
277278 clocks = <&sysclk K210_CLK_I2S1>;
278279 clock-names = "i2sclk";
279280 resets = <&sysrst K210_RST_I2S1>;
281+ status = "disabled";
280282 };
281283
282284 i2s2: i2s@50270000 {
@@ -286,6 +288,7 @@ · 3 unmodified lines
286288 clocks = <&sysclk K210_CLK_I2S2>;
287289 clock-names = "i2sclk";
288290 resets = <&sysrst K210_RST_I2S2>;
291+ status = "disabled";
289292 };
290293
291294 i2c0: i2c@50280000 {
@@ -296,6 +299,7 @@ · 4 unmodified lines
296299 <&sysclk K210_CLK_APB0>;
297300 clock-names = "ref", "pclk";
298301 resets = <&sysrst K210_RST_I2C0>;
302+ status = "disabled";
299303 };
300304
301305 i2c1: i2c@50290000 {
@@ -306,6 +310,7 @@ · 4 unmodified lines
306310 <&sysclk K210_CLK_APB0>;
307311 clock-names = "ref", "pclk";
308312 resets = <&sysrst K210_RST_I2C1>;
313+ status = "disabled";
309314 };
310315
311316 i2c2: i2c@502a0000 {
@@ -316,6 +321,7 @@ · 4 unmodified lines
316321 <&sysclk K210_CLK_APB0>;
317322 clock-names = "ref", "pclk";
318323 resets = <&sysrst K210_RST_I2C2>;
324+ status = "disabled";
319325 };
320326
321327 fpioa: pinmux@502b0000 {
@@ -464,6 +470,7 @@ · 142 unmodified lines
464470 reset-names = "spi";
465471 num-cs = <4>;
466472 reg-io-width = <4>;
473+ status = "disabled";
467474 };
468475
469476 spi1: spi@53000000 {
@@ -479,6 +486,7 @@ · 9 unmodified lines
479486 reset-names = "spi";
480487 num-cs = <4>;
481488 reg-io-width = <4>;
489+ status = "disabled";
482490 };
483491
484492 spi3: spi@54000000 {
@@ -495,6 +503,7 @@ · 10 unmodified lines
495503
496504 num-cs = <4>;
497505 reg-io-width = <4>;
506+ status = "disabled";
498507 };
499508 };
500509 };
arch/riscv/boot/dts/canaan/k210_generic.dts+4−1
@@ -15,6 +15,10 @@ · 14 unmodified lines
1515 model = "Kendryte K210 generic";
1616 compatible = "canaan,kendryte-k210";
1717
18+ aliases {
19+ serial0 = &uarths0;
20+ };
21+
1822 chosen {
1923 bootargs = "earlycon console=ttySIF0";
2024 stdout-path = "serial0:115200n8";
@@ -24,7 +28,6 @@ · 3 unmodified lines
2428 &fpioa {
2529 pinctrl-0 = <&jtag_pins>;
2630 pinctrl-names = "default";
27− status = "okay";
2831
2932 jtag_pins: jtag-pinmux {
3033 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts+8−1
@@ -17,6 +17,10 @@ · 16 unmodified lines
1717 compatible = "sipeed,maix-bit", "sipeed,maix-bitm",
1818 "canaan,kendryte-k210";
1919
20+ aliases {
21+ serial0 = &uarths0;
22+ };
23+
2024 chosen {
2125 bootargs = "earlycon console=ttySIF0";
2226 stdout-path = "serial0:115200n8";
@@ -58,7 +62,6 @@ · 35 unmodified lines
5862 &fpioa {
5963 pinctrl-names = "default";
6064 pinctrl-0 = <&jtag_pinctrl>;
61− status = "okay";
6265
6366 jtag_pinctrl: jtag-pinmux {
6467 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -156,6 +159,7 @@ · 91 unmodified lines
156159 #sound-dai-cells = <1>;
157160 pinctrl-0 = <&i2s0_pinctrl>;
158161 pinctrl-names = "default";
162+ status = "okay";
159163 };
160164
161165 &i2c1 {
@@ -170,6 +174,7 @@ · 8 unmodified lines
170174 pinctrl-names = "default";
171175 num-cs = <1>;
172176 cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
177+ status = "okay";
173178
174179 panel@0 {
175180 compatible = "sitronix,st7789v";
@@ -199,6 +204,8 @@ · 23 unmodified lines
199204 };
200205
201206 &spi3 {
207+ status = "okay";
208+
202209 flash@0 {
203210 compatible = "jedec,spi-nor";
204211 reg = <0>;
arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts+6−1
@@ -17,6 +17,10 @@ · 16 unmodified lines
1717 compatible = "sipeed,maix-dock-m1", "sipeed,maix-dock-m1w",
1818 "canaan,kendryte-k210";
1919
20+ aliases {
21+ serial0 = &uarths0;
22+ };
23+
2024 chosen {
2125 bootargs = "earlycon console=ttySIF0";
2226 stdout-path = "serial0:115200n8";
@@ -63,7 +67,6 @@ · 40 unmodified lines
6367 &fpioa {
6468 pinctrl-0 = <&jtag_pinctrl>;
6569 pinctrl-names = "default";
66− status = "okay";
6770
6871 jtag_pinctrl: jtag-pinmux {
6972 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -159,6 +162,7 @@ · 89 unmodified lines
159162 #sound-dai-cells = <1>;
160163 pinctrl-0 = <&i2s0_pinctrl>;
161164 pinctrl-names = "default";
165+ status = "okay";
162166 };
163167
164168 &i2c1 {
@@ -173,6 +177,7 @@ · 8 unmodified lines
173177 pinctrl-names = "default";
174178 num-cs = <1>;
175179 cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
180+ status = "okay";
176181
177182 panel@0 {
178183 compatible = "sitronix,st7789v";
arch/riscv/boot/dts/canaan/sipeed_maix_go.dts+8−1
@@ -16,6 +16,10 @@ · 15 unmodified lines
1616 model = "SiPeed MAIX GO";
1717 compatible = "sipeed,maix-go", "canaan,kendryte-k210";
1818
19+ aliases {
20+ serial0 = &uarths0;
21+ };
22+
1923 chosen {
2024 bootargs = "earlycon console=ttySIF0";
2125 stdout-path = "serial0:115200n8";
@@ -69,7 +73,6 @@ · 47 unmodified lines
6973 &fpioa {
7074 pinctrl-0 = <&jtag_pinctrl>;
7175 pinctrl-names = "default";
72− status = "okay";
7376
7477 jtag_pinctrl: jtag-pinmux {
7578 pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -167,6 +170,7 @@ · 91 unmodified lines
167170 #sound-dai-cells = <1>;
168171 pinctrl-0 = <&i2s0_pinctrl>;
169172 pinctrl-names = "default";
173+ status = "okay";
170174 };
171175
172176 &i2c1 {
@@ -181,6 +185,7 @@ · 8 unmodified lines
181185 pinctrl-names = "default";
182186 num-cs = <1>;
183187 cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
188+ status = "okay";
184189
185190 panel@0 {
186191 compatible = "sitronix,st7789v";
@@ -209,6 +214,8 @@ · 22 unmodified lines
209214 };
210215
211216 &spi3 {
217+ status = "okay";
218+
212219 flash@0 {
213220 compatible = "jedec,spi-nor";
214221 reg = <0>;
arch/riscv/boot/dts/canaan/sipeed_maixduino.dts+8−2
@@ -15,6 +15,10 @@ · 14 unmodified lines
1515 model = "SiPeed MAIXDUINO";
1616 compatible = "sipeed,maixduino", "canaan,kendryte-k210";
1717
18+ aliases {
19+ serial0 = &uarths0;
20+ };
21+
1822 chosen {
1923 bootargs = "earlycon console=ttySIF0";
2024 stdout-path = "serial0:115200n8";
@@ -39,8 +43,6 @@ · 18 unmodified lines
3943 };
4044
4145 &fpioa {
42− status = "okay";
43−
4446 uarths_pinctrl: uarths-pinmux {
4547 pinmux = <K210_FPIOA(4, K210_PCF_UARTHS_RX)>, /* Header "0" */
4648 <K210_FPIOA(5, K210_PCF_UARTHS_TX)>; /* Header "1" */
@@ -132,6 +134,7 @@ · 85 unmodified lines
132134 #sound-dai-cells = <1>;
133135 pinctrl-0 = <&i2s0_pinctrl>;
134136 pinctrl-names = "default";
137+ status = "okay";
135138 };
136139
137140 &i2c1 {
@@ -146,6 +149,7 @@ · 8 unmodified lines
146149 pinctrl-names = "default";
147150 num-cs = <1>;
148151 cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
152+ status = "okay";
149153
150154 panel@0 {
151155 compatible = "sitronix,st7789v";
@@ -174,6 +178,8 @@ · 22 unmodified lines
174178 };
175179
176180 &spi3 {
181+ status = "okay";
182+
177183 flash@0 {
178184 compatible = "jedec,spi-nor";
179185 reg = <0>;
arch/riscv/boot/dts/starfive/jh7110-common.dtsi+1−1
@@ -244,7 +244,7 @@ · 243 unmodified lines
244244 regulator-boot-on;
245245 regulator-always-on;
246246 regulator-min-microvolt = <1800000>;
247− regulator-max-microvolt = <1800000>;
247+ regulator-max-microvolt = <3300000>;
248248 regulator-name = "emmc_vdd";
249249 };
250250 };
arch/riscv/include/asm/insn.h+1−1
@@ -145,7 +145,7 @@ · 144 unmodified lines
145145
146146 /* parts of opcode for RVF, RVD and RVQ */
147147 #define RVFDQ_FL_FS_WIDTH_OFF 12
148−#define RVFDQ_FL_FS_WIDTH_MASK GENMASK(3, 0)
148+#define RVFDQ_FL_FS_WIDTH_MASK GENMASK(2, 0)
149149 #define RVFDQ_FL_FS_WIDTH_W 2
150150 #define RVFDQ_FL_FS_WIDTH_D 3
151151 #define RVFDQ_LS_FS_WIDTH_Q 4
arch/riscv/kernel/ftrace.c+2−5
@@ -120,9 +120,6 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec) · 119 unmodified lines
120120 out = ftrace_make_nop(mod, rec, MCOUNT_ADDR);
121121 mutex_unlock(&text_mutex);
122122
123− if (!mod)
124− local_flush_icache_range(rec->ip, rec->ip + MCOUNT_INSN_SIZE);
125−
126123 return out;
127124 }
128125
@@ -156,9 +153,9 @@ static int __ftrace_modify_code(void *data) · 27 unmodified lines
156153 } else {
157154 while (atomic_read(&param->cpu_count) <= num_online_cpus())
158155 cpu_relax();
159− }
160156
161− local_flush_icache_all();
157+ local_flush_icache_all();
158+ }
162159
163160 return 0;
164161 }
arch/riscv/kernel/patch.c+18−8
@@ -89,6 +89,14 @@ static int __patch_insn_set(void *addr, u8 c, size_t len) · 88 unmodified lines
8989
9090 memset(waddr, c, len);
9191
92+ /*
93+ * We could have just patched a function that is about to be
94+ * called so make sure we don't execute partially patched
95+ * instructions by flushing the icache as soon as possible.
96+ */
97+ local_flush_icache_range((unsigned long)waddr,
98+ (unsigned long)waddr + len);
99+
92100 patch_unmap(FIX_TEXT_POKE0);
93101
94102 if (across_pages)
@@ -135,6 +143,14 @@ static int __patch_insn_write(void *addr, const void *insn, size_t len) · 40 unmodified lines
135143
136144 ret = copy_to_kernel_nofault(waddr, insn, len);
137145
146+ /*
147+ * We could have just patched a function that is about to be
148+ * called so make sure we don't execute partially patched
149+ * instructions by flushing the icache as soon as possible.
150+ */
151+ local_flush_icache_range((unsigned long)waddr,
152+ (unsigned long)waddr + len);
153+
138154 patch_unmap(FIX_TEXT_POKE0);
139155
140156 if (across_pages)
@@ -189,9 +205,6 @@ int patch_text_set_nosync(void *addr, u8 c, size_t len) · 48 unmodified lines
189205
190206 ret = patch_insn_set(tp, c, len);
191207
192− if (!ret)
193− flush_icache_range((uintptr_t)tp, (uintptr_t)tp + len);
194−
195208 return ret;
196209 }
197210 NOKPROBE_SYMBOL(patch_text_set_nosync);
@@ -224,9 +237,6 @@ int patch_text_nosync(void *addr, const void *insns, size_t len) · 26 unmodified lines
224237
225238 ret = patch_insn_write(tp, insns, len);
226239
227− if (!ret)
228− flush_icache_range((uintptr_t) tp, (uintptr_t) tp + len);
229−
230240 return ret;
231241 }
232242 NOKPROBE_SYMBOL(patch_text_nosync);
@@ -253,9 +263,9 @@ static int patch_text_cb(void *data) · 20 unmodified lines
253263 } else {
254264 while (atomic_read(&patch->cpu_count) <= num_online_cpus())
255265 cpu_relax();
256− }
257266
258− local_flush_icache_all();
267+ local_flush_icache_all();
268+ }
259269
260270 return ret;
261271 }
arch/riscv/kernel/stacktrace.c+1−1
@@ -156,7 +156,7 @@ unsigned long __get_wchan(struct task_struct *task) · 155 unmodified lines
156156 return pc;
157157 }
158158
159−noinline void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
159+noinline noinstr void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
160160 struct task_struct *task, struct pt_regs *regs)
161161 {
162162 walk_stackframe(task, regs, consume_entry, cookie);
arch/riscv/kernel/sys_riscv.c+2−2
@@ -23,7 +23,7 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len, · 22 unmodified lines
2323 #ifdef CONFIG_64BIT
2424 SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
2525 unsigned long, prot, unsigned long, flags,
26− unsigned long, fd, off_t, offset)
26+ unsigned long, fd, unsigned long, offset)
2727 {
2828 return riscv_sys_mmap(addr, len, prot, flags, fd, offset, 0);
2929 }
@@ -32,7 +32,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, · 2 unmodified lines
3232 #if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
3333 SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
3434 unsigned long, prot, unsigned long, flags,
35− unsigned long, fd, off_t, offset)
35+ unsigned long, fd, unsigned long, offset)
3636 {
3737 /*
3838 * Note that the shift for mmap2 is constant (12),
arch/s390/boot/startup.c+7−4
@@ -170,11 +170,14 @@ static void kaslr_adjust_got(unsigned long offset) · 169 unmodified lines
170170 u64 *entry;
171171
172172 /*
173− * Even without -fPIE, Clang still uses a global offset table for some
174− * reason. Adjust the GOT entries.
173+ * Adjust GOT entries, except for ones for undefined weak symbols
174+ * that resolved to zero. This also skips the first three reserved
175+ * entries on s390x that are zero.
175176 */
176− for (entry = (u64 *)vmlinux.got_start; entry < (u64 *)vmlinux.got_end; entry++)
177− *entry += offset - __START_KERNEL;
177+ for (entry = (u64 *)vmlinux.got_start; entry < (u64 *)vmlinux.got_end; entry++) {
178+ if (*entry)
179+ *entry += offset - __START_KERNEL;
180+ }
178181 }
179182
180183 /*
arch/s390/configs/debug_defconfig+2−3
@@ -601,17 +601,16 @@ CONFIG_WATCHDOG=y · 600 unmodified lines
601601 CONFIG_WATCHDOG_NOWAYOUT=y
602602 CONFIG_SOFT_WATCHDOG=m
603603 CONFIG_DIAG288_WATCHDOG=m
604+CONFIG_DRM=m
605+CONFIG_DRM_VIRTIO_GPU=m
604606 CONFIG_FB=y
605607 # CONFIG_FB_DEVICE is not set
606−CONFIG_FRAMEBUFFER_CONSOLE=y
607−CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
608608 # CONFIG_HID_SUPPORT is not set
609609 # CONFIG_USB_SUPPORT is not set
610610 CONFIG_INFINIBAND=m
611611 CONFIG_INFINIBAND_USER_ACCESS=m
612612 CONFIG_MLX4_INFINIBAND=m
613613 CONFIG_MLX5_INFINIBAND=m
614−CONFIG_SYNC_FILE=y
615614 CONFIG_VFIO=m
616615 CONFIG_VFIO_PCI=m
617616 CONFIG_MLX5_VFIO_PCI=m
arch/s390/configs/defconfig+2−3
@@ -592,17 +592,16 @@ CONFIG_WATCHDOG_CORE=y · 591 unmodified lines
592592 CONFIG_WATCHDOG_NOWAYOUT=y
593593 CONFIG_SOFT_WATCHDOG=m
594594 CONFIG_DIAG288_WATCHDOG=m
595+CONFIG_DRM=m
596+CONFIG_DRM_VIRTIO_GPU=m
595597 CONFIG_FB=y
596598 # CONFIG_FB_DEVICE is not set
597−CONFIG_FRAMEBUFFER_CONSOLE=y
598−CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
599599 # CONFIG_HID_SUPPORT is not set
600600 # CONFIG_USB_SUPPORT is not set
601601 CONFIG_INFINIBAND=m
602602 CONFIG_INFINIBAND_USER_ACCESS=m
603603 CONFIG_MLX4_INFINIBAND=m
604604 CONFIG_MLX5_INFINIBAND=m
605−CONFIG_SYNC_FILE=y
606605 CONFIG_VFIO=m
607606 CONFIG_VFIO_PCI=m
608607 CONFIG_MLX5_VFIO_PCI=m
arch/s390/include/asm/entry-common.h+1−1
@@ -54,7 +54,7 @@ static __always_inline void arch_exit_to_user_mode(void) · 53 unmodified lines
5454 static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
5555 unsigned long ti_work)
5656 {
57− choose_random_kstack_offset(get_tod_clock_fast() & 0xff);
57+ choose_random_kstack_offset(get_tod_clock_fast());
5858 }
5959
6060 #define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
arch/s390/kernel/syscall.c+0−27
@@ -38,33 +38,6 @@ · 37 unmodified lines
3838
3939 #include "entry.h"
4040
41−/*
42− * Perform the mmap() system call. Linux for S/390 isn't able to handle more
43− * than 5 system call parameters, so this system call uses a memory block
44− * for parameter passing.
45− */
46−
47−struct s390_mmap_arg_struct {
48− unsigned long addr;
49− unsigned long len;
50− unsigned long prot;
51− unsigned long flags;
52− unsigned long fd;
53− unsigned long offset;
54−};
55−
56−SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg)
57−{
58− struct s390_mmap_arg_struct a;
59− int error = -EFAULT;
60−
61− if (copy_from_user(&a, arg, sizeof(a)))
62− goto out;
63− error = ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
64−out:
65− return error;
66−}
67−
6841 #ifdef CONFIG_SYSVIPC
6942 /*
7043 * sys_ipc() is the de-multiplexer for the SysV IPC calls.
arch/s390/kernel/syscalls/syscall.tbl+1−1
@@ -418,7 +418,7 @@ · 417 unmodified lines
418418 412 32 utimensat_time64 - sys_utimensat
419419 413 32 pselect6_time64 - compat_sys_pselect6_time64
420420 414 32 ppoll_time64 - compat_sys_ppoll_time64
421−416 32 io_pgetevents_time64 - sys_io_pgetevents
421+416 32 io_pgetevents_time64 - compat_sys_io_pgetevents_time64
422422 417 32 recvmmsg_time64 - compat_sys_recvmmsg_time64
423423 418 32 mq_timedsend_time64 - sys_mq_timedsend
424424 419 32 mq_timedreceive_time64 - sys_mq_timedreceive
arch/s390/pci/pci_irq.c+1−1
@@ -410,7 +410,7 @@ static void __init cpu_enable_directed_irq(void *unused) · 409 unmodified lines
410410 union zpci_sic_iib iib = {{0}};
411411 union zpci_sic_iib ziib = {{0}};
412412
413− iib.cdiib.dibv_addr = (u64) zpci_ibv[smp_processor_id()]->vector;
413+ iib.cdiib.dibv_addr = virt_to_phys(zpci_ibv[smp_processor_id()]->vector);
414414
415415 zpci_set_irq_ctrl(SIC_IRQ_MODE_SET_CPU, 0, &iib);
416416 zpci_set_irq_ctrl(SIC_IRQ_MODE_D_SINGLE, PCI_ISC, &ziib);
arch/sh/kernel/sys_sh32.c+11−0
@@ -59,3 +59,14 @@ asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, · 58 unmodified lines
5959 (u64)len0 << 32 | len1, advice);
6060 #endif
6161 }
62+
63+/*
64+ * swap the arguments the way that libc wants them instead of
65+ * moving flags ahead of the 64-bit nbytes argument
66+ */
67+SYSCALL_DEFINE6(sh_sync_file_range6, int, fd, SC_ARG64(offset),
68+ SC_ARG64(nbytes), unsigned int, flags)
69+{
70+ return ksys_sync_file_range(fd, SC_VAL64(loff_t, offset),
71+ SC_VAL64(loff_t, nbytes), flags);
72+}
arch/sh/kernel/syscalls/syscall.tbl+2−1
@@ -321,7 +321,7 @@ · 320 unmodified lines
321321 311 common set_robust_list sys_set_robust_list
322322 312 common get_robust_list sys_get_robust_list
323323 313 common splice sys_splice
324−314 common sync_file_range sys_sync_file_range
324+314 common sync_file_range sys_sh_sync_file_range6
325325 315 common tee sys_tee
326326 316 common vmsplice sys_vmsplice
327327 317 common move_pages sys_move_pages
@@ -395,6 +395,7 @@ · 67 unmodified lines
395395 385 common pkey_alloc sys_pkey_alloc
396396 386 common pkey_free sys_pkey_free
397397 387 common rseq sys_rseq
398+388 common sync_file_range2 sys_sync_file_range2
398399 # room for arch specific syscalls
399400 393 common semget sys_semget
400401 394 common semctl sys_semctl
arch/sparc/kernel/sys32.S+0−221
@@ -18,224 +18,3 @@ sys32_mmap2: · 17 unmodified lines
1818 sethi %hi(sys_mmap), %g1
1919 jmpl %g1 + %lo(sys_mmap), %g0
2020 sllx %o5, 12, %o5
21−
22− .align 32
23− .globl sys32_socketcall
24−sys32_socketcall: /* %o0=call, %o1=args */
25− cmp %o0, 1
26− bl,pn %xcc, do_einval
27− cmp %o0, 18
28− bg,pn %xcc, do_einval
29− sub %o0, 1, %o0
30− sllx %o0, 5, %o0
31− sethi %hi(__socketcall_table_begin), %g2
32− or %g2, %lo(__socketcall_table_begin), %g2
33− jmpl %g2 + %o0, %g0
34− nop
35−do_einval:
36− retl
37− mov -EINVAL, %o0
38−
39− .align 32
40−__socketcall_table_begin:
41−
42− /* Each entry is exactly 32 bytes. */
43−do_sys_socket: /* sys_socket(int, int, int) */
44−1: ldswa [%o1 + 0x0] %asi, %o0
45− sethi %hi(sys_socket), %g1
46−2: ldswa [%o1 + 0x8] %asi, %o2
47− jmpl %g1 + %lo(sys_socket), %g0
48−3: ldswa [%o1 + 0x4] %asi, %o1
49− nop
50− nop
51− nop
52−do_sys_bind: /* sys_bind(int fd, struct sockaddr *, int) */
53−4: ldswa [%o1 + 0x0] %asi, %o0
54− sethi %hi(sys_bind), %g1
55−5: ldswa [%o1 + 0x8] %asi, %o2
56− jmpl %g1 + %lo(sys_bind), %g0
57−6: lduwa [%o1 + 0x4] %asi, %o1
58− nop
59− nop
60− nop
61−do_sys_connect: /* sys_connect(int, struct sockaddr *, int) */
62−7: ldswa [%o1 + 0x0] %asi, %o0
63− sethi %hi(sys_connect), %g1
64−8: ldswa [%o1 + 0x8] %asi, %o2
65− jmpl %g1 + %lo(sys_connect), %g0
66−9: lduwa [%o1 + 0x4] %asi, %o1
67− nop
68− nop
69− nop
70−do_sys_listen: /* sys_listen(int, int) */
71−10: ldswa [%o1 + 0x0] %asi, %o0
72− sethi %hi(sys_listen), %g1
73− jmpl %g1 + %lo(sys_listen), %g0
74−11: ldswa [%o1 + 0x4] %asi, %o1
75− nop
76− nop
77− nop
78− nop
79−do_sys_accept: /* sys_accept(int, struct sockaddr *, int *) */
80−12: ldswa [%o1 + 0x0] %asi, %o0
81− sethi %hi(sys_accept), %g1
82−13: lduwa [%o1 + 0x8] %asi, %o2
83− jmpl %g1 + %lo(sys_accept), %g0
84−14: lduwa [%o1 + 0x4] %asi, %o1
85− nop
86− nop
87− nop
88−do_sys_getsockname: /* sys_getsockname(int, struct sockaddr *, int *) */
89−15: ldswa [%o1 + 0x0] %asi, %o0
90− sethi %hi(sys_getsockname), %g1
91−16: lduwa [%o1 + 0x8] %asi, %o2
92− jmpl %g1 + %lo(sys_getsockname), %g0
93−17: lduwa [%o1 + 0x4] %asi, %o1
94− nop
95− nop
96− nop
97−do_sys_getpeername: /* sys_getpeername(int, struct sockaddr *, int *) */
98−18: ldswa [%o1 + 0x0] %asi, %o0
99− sethi %hi(sys_getpeername), %g1
100−19: lduwa [%o1 + 0x8] %asi, %o2
101− jmpl %g1 + %lo(sys_getpeername), %g0
102−20: lduwa [%o1 + 0x4] %asi, %o1
103− nop
104− nop
105− nop
106−do_sys_socketpair: /* sys_socketpair(int, int, int, int *) */
107−21: ldswa [%o1 + 0x0] %asi, %o0
108− sethi %hi(sys_socketpair), %g1
109−22: ldswa [%o1 + 0x8] %asi, %o2
110−23: lduwa [%o1 + 0xc] %asi, %o3
111− jmpl %g1 + %lo(sys_socketpair), %g0
112−24: ldswa [%o1 + 0x4] %asi, %o1
113− nop
114− nop
115−do_sys_send: /* sys_send(int, void *, size_t, unsigned int) */
116−25: ldswa [%o1 + 0x0] %asi, %o0
117− sethi %hi(sys_send), %g1
118−26: lduwa [%o1 + 0x8] %asi, %o2
119−27: lduwa [%o1 + 0xc] %asi, %o3
120− jmpl %g1 + %lo(sys_send), %g0
121−28: lduwa [%o1 + 0x4] %asi, %o1
122− nop
123− nop
124−do_sys_recv: /* sys_recv(int, void *, size_t, unsigned int) */
125−29: ldswa [%o1 + 0x0] %asi, %o0
126− sethi %hi(sys_recv), %g1
127−30: lduwa [%o1 + 0x8] %asi, %o2
128−31: lduwa [%o1 + 0xc] %asi, %o3
129− jmpl %g1 + %lo(sys_recv), %g0
130−32: lduwa [%o1 + 0x4] %asi, %o1
131− nop
132− nop
133−do_sys_sendto: /* sys_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
134−33: ldswa [%o1 + 0x0] %asi, %o0
135− sethi %hi(sys_sendto), %g1
136−34: lduwa [%o1 + 0x8] %asi, %o2
137−35: lduwa [%o1 + 0xc] %asi, %o3
138−36: lduwa [%o1 + 0x10] %asi, %o4
139−37: ldswa [%o1 + 0x14] %asi, %o5
140− jmpl %g1 + %lo(sys_sendto), %g0
141−38: lduwa [%o1 + 0x4] %asi, %o1
142−do_sys_recvfrom: /* sys_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
143−39: ldswa [%o1 + 0x0] %asi, %o0
144− sethi %hi(sys_recvfrom), %g1
145−40: lduwa [%o1 + 0x8] %asi, %o2
146−41: lduwa [%o1 + 0xc] %asi, %o3
147−42: lduwa [%o1 + 0x10] %asi, %o4
148−43: lduwa [%o1 + 0x14] %asi, %o5
149− jmpl %g1 + %lo(sys_recvfrom), %g0
150−44: lduwa [%o1 + 0x4] %asi, %o1
151−do_sys_shutdown: /* sys_shutdown(int, int) */
152−45: ldswa [%o1 + 0x0] %asi, %o0
153− sethi %hi(sys_shutdown), %g1
154− jmpl %g1 + %lo(sys_shutdown), %g0
155−46: ldswa [%o1 + 0x4] %asi, %o1
156− nop
157− nop
158− nop
159− nop
160−do_sys_setsockopt: /* sys_setsockopt(int, int, int, char *, int) */
161−47: ldswa [%o1 + 0x0] %asi, %o0
162− sethi %hi(sys_setsockopt), %g1
163−48: ldswa [%o1 + 0x8] %asi, %o2
164−49: lduwa [%o1 + 0xc] %asi, %o3
165−50: ldswa [%o1 + 0x10] %asi, %o4
166− jmpl %g1 + %lo(sys_setsockopt), %g0
167−51: ldswa [%o1 + 0x4] %asi, %o1
168− nop
169−do_sys_getsockopt: /* sys_getsockopt(int, int, int, u32, u32) */
170−52: ldswa [%o1 + 0x0] %asi, %o0
171− sethi %hi(sys_getsockopt), %g1
172−53: ldswa [%o1 + 0x8] %asi, %o2
173−54: lduwa [%o1 + 0xc] %asi, %o3
174−55: lduwa [%o1 + 0x10] %asi, %o4
175− jmpl %g1 + %lo(sys_getsockopt), %g0
176−56: ldswa [%o1 + 0x4] %asi, %o1
177− nop
178−do_sys_sendmsg: /* compat_sys_sendmsg(int, struct compat_msghdr *, unsigned int) */
179−57: ldswa [%o1 + 0x0] %asi, %o0
180− sethi %hi(compat_sys_sendmsg), %g1
181−58: lduwa [%o1 + 0x8] %asi, %o2
182− jmpl %g1 + %lo(compat_sys_sendmsg), %g0
183−59: lduwa [%o1 + 0x4] %asi, %o1
184− nop
185− nop
186− nop
187−do_sys_recvmsg: /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) */
188−60: ldswa [%o1 + 0x0] %asi, %o0
189− sethi %hi(compat_sys_recvmsg), %g1
190−61: lduwa [%o1 + 0x8] %asi, %o2
191− jmpl %g1 + %lo(compat_sys_recvmsg), %g0
192−62: lduwa [%o1 + 0x4] %asi, %o1
193− nop
194− nop
195− nop
196−do_sys_accept4: /* sys_accept4(int, struct sockaddr *, int *, int) */
197−63: ldswa [%o1 + 0x0] %asi, %o0
198− sethi %hi(sys_accept4), %g1
199−64: lduwa [%o1 + 0x8] %asi, %o2
200−65: ldswa [%o1 + 0xc] %asi, %o3
201− jmpl %g1 + %lo(sys_accept4), %g0
202−66: lduwa [%o1 + 0x4] %asi, %o1
203− nop
204− nop
205−
206− .section __ex_table,"a"
207− .align 4
208− .word 1b, __retl_efault, 2b, __retl_efault
209− .word 3b, __retl_efault, 4b, __retl_efault
210− .word 5b, __retl_efault, 6b, __retl_efault
211− .word 7b, __retl_efault, 8b, __retl_efault
212− .word 9b, __retl_efault, 10b, __retl_efault
213− .word 11b, __retl_efault, 12b, __retl_efault
214− .word 13b, __retl_efault, 14b, __retl_efault
215− .word 15b, __retl_efault, 16b, __retl_efault
216− .word 17b, __retl_efault, 18b, __retl_efault
217− .word 19b, __retl_efault, 20b, __retl_efault
218− .word 21b, __retl_efault, 22b, __retl_efault
219− .word 23b, __retl_efault, 24b, __retl_efault
220− .word 25b, __retl_efault, 26b, __retl_efault
221− .word 27b, __retl_efault, 28b, __retl_efault
222− .word 29b, __retl_efault, 30b, __retl_efault
223− .word 31b, __retl_efault, 32b, __retl_efault
224− .word 33b, __retl_efault, 34b, __retl_efault
225− .word 35b, __retl_efault, 36b, __retl_efault
226− .word 37b, __retl_efault, 38b, __retl_efault
227− .word 39b, __retl_efault, 40b, __retl_efault
228− .word 41b, __retl_efault, 42b, __retl_efault
229− .word 43b, __retl_efault, 44b, __retl_efault
230− .word 45b, __retl_efault, 46b, __retl_efault
231− .word 47b, __retl_efault, 48b, __retl_efault
232− .word 49b, __retl_efault, 50b, __retl_efault
233− .word 51b, __retl_efault, 52b, __retl_efault
234− .word 53b, __retl_efault, 54b, __retl_efault
235− .word 55b, __retl_efault, 56b, __retl_efault
236− .word 57b, __retl_efault, 58b, __retl_efault
237− .word 59b, __retl_efault, 60b, __retl_efault
238− .word 61b, __retl_efault, 62b, __retl_efault
239− .word 63b, __retl_efault, 64b, __retl_efault
240− .word 65b, __retl_efault, 66b, __retl_efault
241− .previous
arch/sparc/kernel/syscalls/syscall.tbl+4−4
@@ -117,7 +117,7 @@ · 116 unmodified lines
117117 90 common dup2 sys_dup2
118118 91 32 setfsuid32 sys_setfsuid
119119 92 common fcntl sys_fcntl compat_sys_fcntl
120−93 common select sys_select
120+93 common select sys_select compat_sys_select
121121 94 32 setfsgid32 sys_setfsgid
122122 95 common fsync sys_fsync
123123 96 common setpriority sys_setpriority
@@ -155,7 +155,7 @@ · 31 unmodified lines
155155 123 32 fchown sys_fchown16
156156 123 64 fchown sys_fchown
157157 124 common fchmod sys_fchmod
158−125 common recvfrom sys_recvfrom
158+125 common recvfrom sys_recvfrom compat_sys_recvfrom
159159 126 32 setreuid sys_setreuid16
160160 126 64 setreuid sys_setreuid
161161 127 32 setregid sys_setregid16
@@ -247,7 +247,7 @@ · 85 unmodified lines
247247 204 32 readdir sys_old_readdir compat_sys_old_readdir
248248 204 64 readdir sys_nis_syscall
249249 205 common readahead sys_readahead compat_sys_readahead
250−206 common socketcall sys_socketcall sys32_socketcall
250+206 common socketcall sys_socketcall compat_sys_socketcall
251251 207 common syslog sys_syslog
252252 208 common lookup_dcookie sys_ni_syscall
253253 209 common fadvise64 sys_fadvise64 compat_sys_fadvise64
@@ -461,7 +461,7 @@ · 207 unmodified lines
461461 412 32 utimensat_time64 sys_utimensat sys_utimensat
462462 413 32 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64
463463 414 32 ppoll_time64 sys_ppoll compat_sys_ppoll_time64
464−416 32 io_pgetevents_time64 sys_io_pgetevents sys_io_pgetevents
464+416 32 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64
465465 417 32 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64
466466 418 32 mq_timedsend_time64 sys_mq_timedsend sys_mq_timedsend
467467 419 32 mq_timedreceive_time64 sys_mq_timedreceive sys_mq_timedreceive
arch/x86/entry/syscalls/syscall_32.tbl+1−1
@@ -420,7 +420,7 @@ · 419 unmodified lines
420420 412 i386 utimensat_time64 sys_utimensat
421421 413 i386 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64
422422 414 i386 ppoll_time64 sys_ppoll compat_sys_ppoll_time64
423−416 i386 io_pgetevents_time64 sys_io_pgetevents
423+416 i386 io_pgetevents_time64 sys_io_pgetevents compat_sys_io_pgetevents_time64
424424 417 i386 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64
425425 418 i386 mq_timedsend_time64 sys_mq_timedsend
426426 419 i386 mq_timedreceive_time64 sys_mq_timedreceive
arch/x86/include/asm/cmpxchg_32.h+5−7
@@ -93,10 +93,9 @@ static __always_inline bool __try_cmpxchg64_local(volatile u64 *ptr, u64 *oldp, · 92 unmodified lines
9393 \
9494 asm volatile(ALTERNATIVE(_lock_loc \
9595 "call cmpxchg8b_emu", \
96− _lock "cmpxchg8b %[ptr]", X86_FEATURE_CX8) \
97− : [ptr] "+m" (*(_ptr)), \
98− "+a" (o.low), "+d" (o.high) \
99− : "b" (n.low), "c" (n.high), "S" (_ptr) \
96+ _lock "cmpxchg8b %a[ptr]", X86_FEATURE_CX8) \
97+ : "+a" (o.low), "+d" (o.high) \
98+ : "b" (n.low), "c" (n.high), [ptr] "S" (_ptr) \
10099 : "memory"); \
101100 \
102101 o.full; \
@@ -122,12 +121,11 @@ static __always_inline u64 arch_cmpxchg64_local(volatile u64 *ptr, u64 old, u64 · 19 unmodified lines
122121 \
123122 asm volatile(ALTERNATIVE(_lock_loc \
124123 "call cmpxchg8b_emu", \
125− _lock "cmpxchg8b %[ptr]", X86_FEATURE_CX8) \
124+ _lock "cmpxchg8b %a[ptr]", X86_FEATURE_CX8) \
126125 CC_SET(e) \
127126 : CC_OUT(e) (ret), \
128− [ptr] "+m" (*(_ptr)), \
129127 "+a" (o.low), "+d" (o.high) \
130− : "b" (n.low), "c" (n.high), "S" (_ptr) \
128+ : "b" (n.low), "c" (n.high), [ptr] "S" (_ptr) \
131129 : "memory"); \
132130 \
133131 if (unlikely(!ret)) \
arch/x86/include/asm/entry-common.h+6−9
@@ -73,19 +73,16 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs, · 72 unmodified lines
7373 #endif
7474
7575 /*
76− * Ultimately, this value will get limited by KSTACK_OFFSET_MAX(),
77− * but not enough for x86 stack utilization comfort. To keep
78− * reasonable stack head room, reduce the maximum offset to 8 bits.
79− *
80− * The actual entropy will be further reduced by the compiler when
81− * applying stack alignment constraints (see cc_stack_align4/8 in
76+ * This value will get limited by KSTACK_OFFSET_MAX(), which is 10
77+ * bits. The actual entropy will be further reduced by the compiler
78+ * when applying stack alignment constraints (see cc_stack_align4/8 in
8279 * arch/x86/Makefile), which will remove the 3 (x86_64) or 2 (ia32)
8380 * low bits from any entropy chosen here.
8481 *
85− * Therefore, final stack offset entropy will be 5 (x86_64) or
86− * 6 (ia32) bits.
82+ * Therefore, final stack offset entropy will be 7 (x86_64) or
83+ * 8 (ia32) bits.
8784 */
88− choose_random_kstack_offset(rdtsc() & 0xFF);
85+ choose_random_kstack_offset(rdtsc());
8986 }
9087 #define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
9188
arch/x86/kernel/time.c+1−19
@@ -27,25 +27,7 @@ · 26 unmodified lines
2727
2828 unsigned long profile_pc(struct pt_regs *regs)
2929 {
30− unsigned long pc = instruction_pointer(regs);
31−
32− if (!user_mode(regs) && in_lock_functions(pc)) {
33−#ifdef CONFIG_FRAME_POINTER
34− return *(unsigned long *)(regs->bp + sizeof(long));
35−#else
36− unsigned long *sp = (unsigned long *)regs->sp;
37− /*
38− * Return address is either directly at stack pointer
39− * or above a saved flags. Eflags has bits 22-31 zero,
40− * kernel addresses don't.
41− */
42− if (sp[0] >> 22)
43− return sp[0];
44− if (sp[1] >> 22)
45− return sp[1];
46−#endif
47− }
48− return pc;
30+ return instruction_pointer(regs);
4931 }
5032 EXPORT_SYMBOL(profile_pc);
5133
drivers/ata/ahci.c+12−5
@@ -1975,8 +1975,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1974 unmodified lines
19751975 n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map));
19761976
19771977 host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
1978− if (!host)
1979− return -ENOMEM;
1978+ if (!host) {
1979+ rc = -ENOMEM;
1980+ goto err_rm_sysfs_file;
1981+ }
19801982 host->private_data = hpriv;
19811983
19821984 if (ahci_init_msi(pdev, n_ports, hpriv) < 0) {
@@ -2031,11 +2033,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 48 unmodified lines
20312033 /* initialize adapter */
20322034 rc = ahci_configure_dma_masks(pdev, hpriv);
20332035 if (rc)
2034− return rc;
2036+ goto err_rm_sysfs_file;
20352037
20362038 rc = ahci_pci_reset_controller(host);
20372039 if (rc)
2038− return rc;
2040+ goto err_rm_sysfs_file;
20392041
20402042 ahci_pci_init_controller(host);
20412043 ahci_pci_print_info(host);
@@ -2044,10 +2046,15 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 2 unmodified lines
20442046
20452047 rc = ahci_host_activate(host, &ahci_sht);
20462048 if (rc)
2047− return rc;
2049+ goto err_rm_sysfs_file;
20482050
20492051 pm_runtime_put_noidle(&pdev->dev);
20502052 return 0;
2053+
2054+err_rm_sysfs_file:
2055+ sysfs_remove_file_from_group(&pdev->dev.kobj,
2056+ &dev_attr_remapped_nvme.attr, NULL);
2057+ return rc;
20512058 }
20522059
20532060 static void ahci_shutdown_one(struct pci_dev *pdev)
drivers/ata/libata-core.c+19−13
@@ -4137,8 +4137,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 4136 unmodified lines
41374137 { "PIONEER BD-RW BDR-205", NULL, ATA_HORKAGE_NOLPM },
41384138
41394139 /* Crucial devices with broken LPM support */
4140− { "CT500BX100SSD1", NULL, ATA_HORKAGE_NOLPM },
4141− { "CT240BX500SSD1", NULL, ATA_HORKAGE_NOLPM },
4140+ { "CT*0BX*00SSD1", NULL, ATA_HORKAGE_NOLPM },
41424141
41434142 /* 512GB MX100 with MU01 firmware has both queued TRIM and LPM issues */
41444143 { "Crucial_CT512MX100*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
@@ -5490,6 +5489,18 @@ struct ata_port *ata_port_alloc(struct ata_host *host) · 1345 unmodified lines
54905489 return ap;
54915490 }
54925491
5492+void ata_port_free(struct ata_port *ap)
5493+{
5494+ if (!ap)
5495+ return;
5496+
5497+ kfree(ap->pmp_link);
5498+ kfree(ap->slave_link);
5499+ kfree(ap->ncq_sense_buf);
5500+ kfree(ap);
5501+}
5502+EXPORT_SYMBOL_GPL(ata_port_free);
5503+
54935504 static void ata_devres_release(struct device *gendev, void *res)
54945505 {
54955506 struct ata_host *host = dev_get_drvdata(gendev);
@@ -5516,12 +5527,7 @@ static void ata_host_release(struct kref *kref) · 20 unmodified lines
55165527 int i;
55175528
55185529 for (i = 0; i < host->n_ports; i++) {
5519− struct ata_port *ap = host->ports[i];
5520−
5521− kfree(ap->pmp_link);
5522− kfree(ap->slave_link);
5523− kfree(ap->ncq_sense_buf);
5524− kfree(ap);
5530+ ata_port_free(host->ports[i]);
55255531 host->ports[i] = NULL;
55265532 }
55275533 kfree(host);
@@ -5571,8 +5577,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports) · 43 unmodified lines
55715577 if (!host)
55725578 return NULL;
55735579
5574− if (!devres_open_group(dev, NULL, GFP_KERNEL))
5575− goto err_free;
5580+ if (!devres_open_group(dev, NULL, GFP_KERNEL)) {
5581+ kfree(host);
5582+ return NULL;
5583+ }
55765584
55775585 dr = devres_alloc(ata_devres_release, 0, GFP_KERNEL);
55785586 if (!dr)
@@ -5604,8 +5612,6 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports) · 25 unmodified lines
56045612
56055613 err_out:
56065614 devres_release_group(dev, NULL);
5607− err_free:
5608− kfree(host);
56095615 return NULL;
56105616 }
56115617 EXPORT_SYMBOL_GPL(ata_host_alloc);
@@ -5904,7 +5910,7 @@ int ata_host_register(struct ata_host *host, const struct scsi_host_template *sh · 292 unmodified lines
59045910 * allocation time.
59055911 */
59065912 for (i = host->n_ports; host->ports[i]; i++)
5907− kfree(host->ports[i]);
5913+ ata_port_free(host->ports[i]);
59085914
59095915 /* give ports names and add SCSI hosts */
59105916 for (i = 0; i < host->n_ports; i++) {
drivers/bluetooth/btintel_pcie.c+1−1
@@ -382,7 +382,7 @@ static int btintel_pcie_recv_frame(struct btintel_pcie_data *data, · 381 unmodified lines
382382
383383 /* The first 4 bytes indicates the Intel PCIe specific packet type */
384384 pdata = skb_pull_data(skb, BTINTEL_PCIE_HCI_TYPE_LEN);
385− if (!data) {
385+ if (!pdata) {
386386 bt_dev_err(hdev, "Corrupted packet received");
387387 ret = -EILSEQ;
388388 goto exit_error;
drivers/bluetooth/btnxpuart.c+1−1
@@ -281,7 +281,7 @@ static u8 crc8_table[CRC8_TABLE_SIZE]; · 280 unmodified lines
281281
282282 /* Default configurations */
283283 #define DEFAULT_H2C_WAKEUP_MODE WAKEUP_METHOD_BREAK
284−#define DEFAULT_PS_MODE PS_MODE_DISABLE
284+#define DEFAULT_PS_MODE PS_MODE_ENABLE
285285 #define FW_INIT_BAUDRATE HCI_NXP_PRI_BAUDRATE
286286
287287 static struct sk_buff *nxp_drv_send_cmd(struct hci_dev *hdev, u16 opcode,
drivers/bluetooth/hci_bcm4377.c+9−1
@@ -495,6 +495,10 @@ struct bcm4377_data; · 494 unmodified lines
495495 * extended scanning
496496 * broken_mws_transport_config: Set to true if the chip erroneously claims to
497497 * support MWS Transport Configuration
498+ * broken_le_ext_adv_report_phy: Set to true if this chip stuffs flags inside
499+ * reserved bits of Primary/Secondary_PHY inside
500+ * LE Extended Advertising Report events which
501+ * have to be ignored
498502 * send_calibration: Optional callback to send calibration data
499503 * send_ptb: Callback to send "PTB" regulatory/calibration data
500504 */
@@ -513,6 +517,7 @@ struct bcm4377_hw { · 12 unmodified lines
513517 unsigned long broken_ext_scan : 1;
514518 unsigned long broken_mws_transport_config : 1;
515519 unsigned long broken_le_coded : 1;
520+ unsigned long broken_le_ext_adv_report_phy : 1;
516521
517522 int (*send_calibration)(struct bcm4377_data *bcm4377);
518523 int (*send_ptb)(struct bcm4377_data *bcm4377,
@@ -716,7 +721,7 @@ static void bcm4377_handle_ack(struct bcm4377_data *bcm4377, · 197 unmodified lines
716721 ring->events[msgid] = NULL;
717722 }
718723
719− bitmap_release_region(ring->msgids, msgid, ring->n_entries);
724+ bitmap_release_region(ring->msgids, msgid, 0);
720725
721726 unlock:
722727 spin_unlock_irqrestore(&ring->lock, flags);
@@ -2373,6 +2378,8 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 1650 unmodified lines
23732378 set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks);
23742379 if (bcm4377->hw->broken_le_coded)
23752380 set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
2381+ if (bcm4377->hw->broken_le_ext_adv_report_phy)
2382+ set_bit(HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY, &hdev->quirks);
23762383
23772384 pci_set_drvdata(pdev, bcm4377);
23782385 hci_set_drvdata(hdev, bcm4377);
@@ -2477,6 +2484,7 @@ static const struct bcm4377_hw bcm4377_hw_variants[] = { · 98 unmodified lines
24772484 .clear_pciecfg_subsystem_ctrl_bit19 = true,
24782485 .broken_mws_transport_config = true,
24792486 .broken_le_coded = true,
2487+ .broken_le_ext_adv_report_phy = true,
24802488 .send_calibration = bcm4387_send_calibration,
24812489 .send_ptb = bcm4378_send_ptb,
24822490 },
drivers/bluetooth/hci_qca.c+15−3
@@ -2450,15 +2450,27 @@ static void qca_serdev_shutdown(struct device *dev) · 2449 unmodified lines
24502450 struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
24512451 struct hci_uart *hu = &qcadev->serdev_hu;
24522452 struct hci_dev *hdev = hu->hdev;
2453− struct qca_data *qca = hu->priv;
24542453 const u8 ibs_wake_cmd[] = { 0xFD };
24552454 const u8 edl_reset_soc_cmd[] = { 0x01, 0x00, 0xFC, 0x01, 0x05 };
24562455
24572456 if (qcadev->btsoc_type == QCA_QCA6390) {
2458− if (test_bit(QCA_BT_OFF, &qca->flags) ||
2459− !test_bit(HCI_RUNNING, &hdev->flags))
2457+ /* The purpose of sending the VSC is to reset SOC into a initial
2458+ * state and the state will ensure next hdev->setup() success.
2459+ * if HCI_QUIRK_NON_PERSISTENT_SETUP is set, it means that
2460+ * hdev->setup() can do its job regardless of SoC state, so
2461+ * don't need to send the VSC.
2462+ * if HCI_SETUP is set, it means that hdev->setup() was never
2463+ * invoked and the SOC is already in the initial state, so
2464+ * don't also need to send the VSC.
2465+ */
2466+ if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks) ||
2467+ hci_dev_test_flag(hdev, HCI_SETUP))
24602468 return;
24612469
2470+ /* The serdev must be in open state when conrol logic arrives
2471+ * here, so also fix the use-after-free issue caused by that
2472+ * the serdev is flushed or wrote after it is closed.
2473+ */
24622474 serdev_device_write_flush(serdev);
24632475 ret = serdev_device_write_buf(serdev, ibs_wake_cmd,
24642476 sizeof(ibs_wake_cmd));
drivers/counter/ti-eqep.c+6−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/bitops.h>
9+#include <linux/clk.h>
910 #include <linux/counter.h>
1011 #include <linux/kernel.h>
1112 #include <linux/mod_devicetable.h>
@@ -376,6 +377,7 @@ static int ti_eqep_probe(struct platform_device *pdev) · 364 unmodified lines
376377 struct counter_device *counter;
377378 struct ti_eqep_cnt *priv;
378379 void __iomem *base;
380+ struct clk *clk;
379381 int err;
380382
381383 counter = devm_counter_alloc(dev, sizeof(*priv));
@@ -415,6 +417,10 @@ static int ti_eqep_probe(struct platform_device *pdev) · 33 unmodified lines
415417 pm_runtime_enable(dev);
416418 pm_runtime_get_sync(dev);
417419
420+ clk = devm_clk_get_enabled(dev, NULL);
421+ if (IS_ERR(clk))
422+ return dev_err_probe(dev, PTR_ERR(clk), "failed to enable clock\n");
423+
418424 err = counter_add(counter);
419425 if (err < 0) {
420426 pm_runtime_put_sync(dev);
drivers/cpufreq/intel_pstate.c+6−7
@@ -355,15 +355,14 @@ static void intel_pstate_set_itmt_prio(int cpu) · 354 unmodified lines
355355 int ret;
356356
357357 ret = cppc_get_perf_caps(cpu, &cppc_perf);
358− if (ret)
359− return;
360−
361358 /*
362− * On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff.
363− * In this case we can't use CPPC.highest_perf to enable ITMT.
364− * In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide.
359+ * If CPPC is not available, fall back to MSR_HWP_CAPABILITIES bits [8:0].
360+ *
361+ * Also, on some systems with overclocking enabled, CPPC.highest_perf is
362+ * hardcoded to 0xff, so CPPC.highest_perf cannot be used to enable ITMT.
363+ * Fall back to MSR_HWP_CAPABILITIES then too.
365364 */
366− if (cppc_perf.highest_perf == CPPC_MAX_PERF)
365+ if (ret || cppc_perf.highest_perf == CPPC_MAX_PERF)
367366 cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached));
368367
369368 /*
drivers/crypto/intel/qat/qat_common/Makefile+3−2
@@ -39,7 +39,8 @@ intel_qat-objs := adf_cfg.o \ · 38 unmodified lines
3939 adf_sysfs_rl.o \
4040 qat_uclo.o \
4141 qat_hal.o \
42− qat_bl.o
42+ qat_bl.o \
43+ qat_mig_dev.o
4344
4445 intel_qat-$(CONFIG_DEBUG_FS) += adf_transport_debug.o \
4546 adf_fw_counters.o \
@@ -56,6 +57,6 @@ intel_qat-$(CONFIG_DEBUG_FS) += adf_transport_debug.o \ · 10 unmodified lines
5657 intel_qat-$(CONFIG_PCI_IOV) += adf_sriov.o adf_vf_isr.o adf_pfvf_utils.o \
5758 adf_pfvf_pf_msg.o adf_pfvf_pf_proto.o \
5859 adf_pfvf_vf_msg.o adf_pfvf_vf_proto.o \
59− adf_gen2_pfvf.o adf_gen4_pfvf.o qat_mig_dev.o
60+ adf_gen2_pfvf.o adf_gen4_pfvf.o
6061
6162 intel_qat-$(CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION) += adf_heartbeat_inject.o
drivers/cxl/core/hdm.c+13−0
@@ -52,6 +52,14 @@ int devm_cxl_add_passthrough_decoder(struct cxl_port *port) · 51 unmodified lines
5252 struct cxl_dport *dport = NULL;
5353 int single_port_map[1];
5454 unsigned long index;
55+ struct cxl_hdm *cxlhdm = dev_get_drvdata(&port->dev);
56+
57+ /*
58+ * Capability checks are moot for passthrough decoders, support
59+ * any and all possibilities.
60+ */
61+ cxlhdm->interleave_mask = ~0U;
62+ cxlhdm->iw_cap_mask = ~0UL;
5563
5664 cxlsd = cxl_switch_decoder_alloc(port, 1);
5765 if (IS_ERR(cxlsd))
@@ -79,6 +87,11 @@ static void parse_hdm_decoder_caps(struct cxl_hdm *cxlhdm) · 21 unmodified lines
7987 cxlhdm->interleave_mask |= GENMASK(11, 8);
8088 if (FIELD_GET(CXL_HDM_DECODER_INTERLEAVE_14_12, hdm_cap))
8189 cxlhdm->interleave_mask |= GENMASK(14, 12);
90+ cxlhdm->iw_cap_mask = BIT(1) | BIT(2) | BIT(4) | BIT(8);
91+ if (FIELD_GET(CXL_HDM_DECODER_INTERLEAVE_3_6_12_WAY, hdm_cap))
92+ cxlhdm->iw_cap_mask |= BIT(3) | BIT(6) | BIT(12);
93+ if (FIELD_GET(CXL_HDM_DECODER_INTERLEAVE_16_WAY, hdm_cap))
94+ cxlhdm->iw_cap_mask |= BIT(16);
8295 }
8396
8497 static bool should_emulate_decoders(struct cxl_endpoint_dvsec_info *info)
drivers/cxl/core/pmem.c+11−5
@@ -62,10 +62,14 @@ static int match_nvdimm_bridge(struct device *dev, void *data) · 61 unmodified lines
6262 return is_cxl_nvdimm_bridge(dev);
6363 }
6464
65−struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_memdev *cxlmd)
65+/**
66+ * cxl_find_nvdimm_bridge() - find a bridge device relative to a port
67+ * @port: any descendant port of an nvdimm-bridge associated
68+ * root-cxl-port
69+ */
70+struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_port *port)
6671 {
67− struct cxl_root *cxl_root __free(put_cxl_root) =
68− find_cxl_root(cxlmd->endpoint);
72+ struct cxl_root *cxl_root __free(put_cxl_root) = find_cxl_root(port);
6973 struct device *dev;
7074
7175 if (!cxl_root)
@@ -242,18 +246,20 @@ static void cxlmd_release_nvdimm(void *_cxlmd) · 170 unmodified lines
242246
243247 /**
244248 * devm_cxl_add_nvdimm() - add a bridge between a cxl_memdev and an nvdimm
249+ * @parent_port: parent port for the (to be added) @cxlmd endpoint port
245250 * @cxlmd: cxl_memdev instance that will perform LIBNVDIMM operations
246251 *
247252 * Return: 0 on success negative error code on failure.
248253 */
249−int devm_cxl_add_nvdimm(struct cxl_memdev *cxlmd)
254+int devm_cxl_add_nvdimm(struct cxl_port *parent_port,
255+ struct cxl_memdev *cxlmd)
250256 {
251257 struct cxl_nvdimm_bridge *cxl_nvb;
252258 struct cxl_nvdimm *cxl_nvd;
253259 struct device *dev;
254260 int rc;
255261
256− cxl_nvb = cxl_find_nvdimm_bridge(cxlmd);
262+ cxl_nvb = cxl_find_nvdimm_bridge(parent_port);
257263 if (!cxl_nvb)
258264 return -ENODEV;
259265
drivers/cxl/core/region.c+98−5
@@ -1101,6 +1101,26 @@ static int cxl_port_attach_region(struct cxl_port *port, · 1100 unmodified lines
11011101 }
11021102 cxld = cxl_rr->decoder;
11031103
1104+ /*
1105+ * the number of targets should not exceed the target_count
1106+ * of the decoder
1107+ */
1108+ if (is_switch_decoder(&cxld->dev)) {
1109+ struct cxl_switch_decoder *cxlsd;
1110+
1111+ cxlsd = to_cxl_switch_decoder(&cxld->dev);
1112+ if (cxl_rr->nr_targets > cxlsd->nr_targets) {
1113+ dev_dbg(&cxlr->dev,
1114+ "%s:%s %s add: %s:%s @ %d overflows targets: %d\n",
1115+ dev_name(port->uport_dev), dev_name(&port->dev),
1116+ dev_name(&cxld->dev), dev_name(&cxlmd->dev),
1117+ dev_name(&cxled->cxld.dev), pos,
1118+ cxlsd->nr_targets);
1119+ rc = -ENXIO;
1120+ goto out_erase;
1121+ }
1122+ }
1123+
11041124 rc = cxl_rr_ep_add(cxl_rr, cxled);
11051125 if (rc) {
11061126 dev_dbg(&cxlr->dev,
@@ -1210,6 +1230,50 @@ static int check_last_peer(struct cxl_endpoint_decoder *cxled, · 103 unmodified lines
12101230 return 0;
12111231 }
12121232
1233+static int check_interleave_cap(struct cxl_decoder *cxld, int iw, int ig)
1234+{
1235+ struct cxl_port *port = to_cxl_port(cxld->dev.parent);
1236+ struct cxl_hdm *cxlhdm = dev_get_drvdata(&port->dev);
1237+ unsigned int interleave_mask;
1238+ u8 eiw;
1239+ u16 eig;
1240+ int high_pos, low_pos;
1241+
1242+ if (!test_bit(iw, &cxlhdm->iw_cap_mask))
1243+ return -ENXIO;
1244+ /*
1245+ * Per CXL specification r3.1(8.2.4.20.13 Decoder Protection),
1246+ * if eiw < 8:
1247+ * DPAOFFSET[51: eig + 8] = HPAOFFSET[51: eig + 8 + eiw]
1248+ * DPAOFFSET[eig + 7: 0] = HPAOFFSET[eig + 7: 0]
1249+ *
1250+ * when the eiw is 0, all the bits of HPAOFFSET[51: 0] are used, the
1251+ * interleave bits are none.
1252+ *
1253+ * if eiw >= 8:
1254+ * DPAOFFSET[51: eig + 8] = HPAOFFSET[51: eig + eiw] / 3
1255+ * DPAOFFSET[eig + 7: 0] = HPAOFFSET[eig + 7: 0]
1256+ *
1257+ * when the eiw is 8, all the bits of HPAOFFSET[51: 0] are used, the
1258+ * interleave bits are none.
1259+ */
1260+ ways_to_eiw(iw, &eiw);
1261+ if (eiw == 0 || eiw == 8)
1262+ return 0;
1263+
1264+ granularity_to_eig(ig, &eig);
1265+ if (eiw > 8)
1266+ high_pos = eiw + eig - 1;
1267+ else
1268+ high_pos = eiw + eig + 7;
1269+ low_pos = eig + 8;
1270+ interleave_mask = GENMASK(high_pos, low_pos);
1271+ if (interleave_mask & ~cxlhdm->interleave_mask)
1272+ return -ENXIO;
1273+
1274+ return 0;
1275+}
1276+
12131277 static int cxl_port_setup_targets(struct cxl_port *port,
12141278 struct cxl_region *cxlr,
12151279 struct cxl_endpoint_decoder *cxled)
@@ -1360,6 +1424,15 @@ static int cxl_port_setup_targets(struct cxl_port *port, · 144 unmodified lines
13601424 return -ENXIO;
13611425 }
13621426 } else {
1427+ rc = check_interleave_cap(cxld, iw, ig);
1428+ if (rc) {
1429+ dev_dbg(&cxlr->dev,
1430+ "%s:%s iw: %d ig: %d is not supported\n",
1431+ dev_name(port->uport_dev),
1432+ dev_name(&port->dev), iw, ig);
1433+ return rc;
1434+ }
1435+
13631436 cxld->interleave_ways = iw;
13641437 cxld->interleave_granularity = ig;
13651438 cxld->hpa_range = (struct range) {
@@ -1796,6 +1869,15 @@ static int cxl_region_attach(struct cxl_region *cxlr, · 430 unmodified lines
17961869 struct cxl_dport *dport;
17971870 int rc = -ENXIO;
17981871
1872+ rc = check_interleave_cap(&cxled->cxld, p->interleave_ways,
1873+ p->interleave_granularity);
1874+ if (rc) {
1875+ dev_dbg(&cxlr->dev, "%s iw: %d ig: %d is not supported\n",
1876+ dev_name(&cxled->cxld.dev), p->interleave_ways,
1877+ p->interleave_granularity);
1878+ return rc;
1879+ }
1880+
17991881 if (cxled->mode != cxlr->mode) {
18001882 dev_dbg(&cxlr->dev, "%s region mode: %d mismatch: %d\n",
18011883 dev_name(&cxled->cxld.dev), cxlr->mode, cxled->mode);
@@ -2688,22 +2770,33 @@ static int __cxl_dpa_to_region(struct device *dev, void *arg) · 886 unmodified lines
26882770 {
26892771 struct cxl_dpa_to_region_context *ctx = arg;
26902772 struct cxl_endpoint_decoder *cxled;
2773+ struct cxl_region *cxlr;
26912774 u64 dpa = ctx->dpa;
26922775
26932776 if (!is_endpoint_decoder(dev))
26942777 return 0;
26952778
26962779 cxled = to_cxl_endpoint_decoder(dev);
2697− if (!cxled->dpa_res || !resource_size(cxled->dpa_res))
2780+ if (!cxled || !cxled->dpa_res || !resource_size(cxled->dpa_res))
26982781 return 0;
26992782
27002783 if (dpa > cxled->dpa_res->end || dpa < cxled->dpa_res->start)
27012784 return 0;
27022785
2703− dev_dbg(dev, "dpa:0x%llx mapped in region:%s\n", dpa,
2704− dev_name(&cxled->cxld.region->dev));
2786+ /*
2787+ * Stop the region search (return 1) when an endpoint mapping is
2788+ * found. The region may not be fully constructed so offering
2789+ * the cxlr in the context structure is not guaranteed.
2790+ */
2791+ cxlr = cxled->cxld.region;
2792+ if (cxlr)
2793+ dev_dbg(dev, "dpa:0x%llx mapped in region:%s\n", dpa,
2794+ dev_name(&cxlr->dev));
2795+ else
2796+ dev_dbg(dev, "dpa:0x%llx mapped in endpoint:%s\n", dpa,
2797+ dev_name(dev));
27052798
2706− ctx->cxlr = cxled->cxld.region;
2799+ ctx->cxlr = cxlr;
27072800
27082801 return 1;
27092802 }
@@ -2847,7 +2940,7 @@ static int cxl_pmem_region_alloc(struct cxl_region *cxlr) · 137 unmodified lines
28472940 * bridge for one device is the same for all.
28482941 */
28492942 if (i == 0) {
2850− cxl_nvb = cxl_find_nvdimm_bridge(cxlmd);
2943+ cxl_nvb = cxl_find_nvdimm_bridge(cxlmd->endpoint);
28512944 if (!cxl_nvb)
28522945 return -ENODEV;
28532946 cxlr->cxl_nvb = cxl_nvb;
drivers/cxl/cxl.h+4−2
@@ -47,6 +47,8 @@ extern const struct nvdimm_security_ops *cxl_security_ops; · 46 unmodified lines
4747 #define CXL_HDM_DECODER_TARGET_COUNT_MASK GENMASK(7, 4)
4848 #define CXL_HDM_DECODER_INTERLEAVE_11_8 BIT(8)
4949 #define CXL_HDM_DECODER_INTERLEAVE_14_12 BIT(9)
50+#define CXL_HDM_DECODER_INTERLEAVE_3_6_12_WAY BIT(11)
51+#define CXL_HDM_DECODER_INTERLEAVE_16_WAY BIT(12)
5052 #define CXL_HDM_DECODER_CTRL_OFFSET 0x4
5153 #define CXL_HDM_DECODER_ENABLE BIT(1)
5254 #define CXL_HDM_DECODER0_BASE_LOW_OFFSET(i) (0x20 * (i) + 0x10)
@@ -855,8 +857,8 @@ struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host, · 802 unmodified lines
855857 struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev);
856858 bool is_cxl_nvdimm(struct device *dev);
857859 bool is_cxl_nvdimm_bridge(struct device *dev);
858−int devm_cxl_add_nvdimm(struct cxl_memdev *cxlmd);
859−struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_memdev *cxlmd);
860+int devm_cxl_add_nvdimm(struct cxl_port *parent_port, struct cxl_memdev *cxlmd);
861+struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_port *port);
860862
861863 #ifdef CONFIG_CXL_REGION
862864 bool is_cxl_pmem_region(struct device *dev);
drivers/cxl/cxlmem.h+16−5
@@ -395,9 +395,9 @@ enum cxl_devtype { · 394 unmodified lines
395395
396396 /**
397397 * struct cxl_dpa_perf - DPA performance property entry
398− * @dpa_range - range for DPA address
399− * @coord - QoS performance data (i.e. latency, bandwidth)
400− * @qos_class - QoS Class cookies
398+ * @dpa_range: range for DPA address
399+ * @coord: QoS performance data (i.e. latency, bandwidth)
400+ * @qos_class: QoS Class cookies
401401 */
402402 struct cxl_dpa_perf {
403403 struct range dpa_range;
@@ -464,13 +464,14 @@ struct cxl_dev_state { · 60 unmodified lines
464464 * @active_persistent_bytes: sum of hard + soft persistent
465465 * @next_volatile_bytes: volatile capacity change pending device reset
466466 * @next_persistent_bytes: persistent capacity change pending device reset
467+ * @ram_perf: performance data entry matched to RAM partition
468+ * @pmem_perf: performance data entry matched to PMEM partition
467469 * @event: event log driver state
468470 * @poison: poison driver state info
469471 * @security: security driver state info
470472 * @fw: firmware upload / activation state
473+ * @mbox_wait: RCU wait for mbox send completely
471474 * @mbox_send: @dev specific transport for transmitting mailbox commands
472− * @ram_perf: performance data entry matched to RAM partition
473− * @pmem_perf: performance data entry matched to PMEM partition
474475 *
475476 * See CXL 3.0 8.2.9.8.2 Capacity Configuration and Label Storage for
476477 * details on capacity parameters.
@@ -851,11 +852,21 @@ static inline void cxl_mem_active_dec(void) · 374 unmodified lines
851852
852853 int cxl_mem_sanitize(struct cxl_memdev *cxlmd, u16 cmd);
853854
855+/**
856+ * struct cxl_hdm - HDM Decoder registers and cached / decoded capabilities
857+ * @regs: mapped registers, see devm_cxl_setup_hdm()
858+ * @decoder_count: number of decoders for this port
859+ * @target_count: for switch decoders, max downstream port targets
860+ * @interleave_mask: interleave granularity capability, see check_interleave_cap()
861+ * @iw_cap_mask: bitmask of supported interleave ways, see check_interleave_cap()
862+ * @port: mapped cxl_port, see devm_cxl_setup_hdm()
863+ */
854864 struct cxl_hdm {
855865 struct cxl_component_regs regs;
856866 unsigned int decoder_count;
857867 unsigned int target_count;
858868 unsigned int interleave_mask;
869+ unsigned long iw_cap_mask;
859870 struct cxl_port *port;
860871 };
861872
drivers/cxl/mem.c+9−8
@@ -152,6 +152,15 @@ static int cxl_mem_probe(struct device *dev) · 151 unmodified lines
152152 return -ENXIO;
153153 }
154154
155+ if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM)) {
156+ rc = devm_cxl_add_nvdimm(parent_port, cxlmd);
157+ if (rc) {
158+ if (rc == -ENODEV)
159+ dev_info(dev, "PMEM disabled by platform\n");
160+ return rc;
161+ }
162+ }
163+
155164 if (dport->rch)
156165 endpoint_parent = parent_port->uport_dev;
157166 else
@@ -174,14 +183,6 @@ unlock: · 16 unmodified lines
174183 if (rc)
175184 return rc;
176185
177− if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM)) {
178− rc = devm_cxl_add_nvdimm(cxlmd);
179− if (rc == -ENODEV)
180− dev_info(dev, "PMEM disabled by platform\n");
181− else
182− return rc;
183− }
184−
185186 /*
186187 * The kernel may be operating out of CXL memory on this device,
187188 * there is no spec defined way to determine whether this device
drivers/gpio/gpio-davinci.c+5−0
@@ -225,6 +225,11 @@ static int davinci_gpio_probe(struct platform_device *pdev) · 224 unmodified lines
225225 else
226226 nirq = DIV_ROUND_UP(ngpio, 16);
227227
228+ if (nirq > MAX_INT_PER_BANK) {
229+ dev_err(dev, "Too many IRQs!\n");
230+ return -EINVAL;
231+ }
232+
228233 chips = devm_kzalloc(dev, sizeof(*chips), GFP_KERNEL);
229234 if (!chips)
230235 return -ENOMEM;
drivers/gpio/gpio-graniterapids.c+2−0
@@ -296,6 +296,8 @@ static int gnr_gpio_probe(struct platform_device *pdev) · 295 unmodified lines
296296 if (!priv)
297297 return -ENOMEM;
298298
299+ raw_spin_lock_init(&priv->lock);
300+
299301 regs = devm_platform_ioremap_resource(pdev, 0);
300302 if (IS_ERR(regs))
301303 return PTR_ERR(regs);
drivers/gpio/gpio-pca953x.c+2−0
@@ -758,6 +758,8 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d) · 757 unmodified lines
758758 int level;
759759
760760 if (chip->driver_data & PCA_PCAL) {
761+ guard(mutex)(&chip->i2c_lock);
762+
761763 /* Enable latch on interrupt-enabled inputs */
762764 pca953x_write_regs(chip, PCAL953X_IN_LATCH, chip->irq_mask);
763765
drivers/gpio/gpiolib-cdev.c+17−11
@@ -89,6 +89,10 @@ struct linehandle_state { · 88 unmodified lines
8989 GPIOHANDLE_REQUEST_OPEN_DRAIN | \
9090 GPIOHANDLE_REQUEST_OPEN_SOURCE)
9191
92+#define GPIOHANDLE_REQUEST_DIRECTION_FLAGS \
93+ (GPIOHANDLE_REQUEST_INPUT | \
94+ GPIOHANDLE_REQUEST_OUTPUT)
95+
9296 static int linehandle_validate_flags(u32 flags)
9397 {
9498 /* Return an error if an unknown flag is set */
@@ -169,21 +173,21 @@ static long linehandle_set_config(struct linehandle_state *lh, · 74 unmodified lines
169173 if (ret)
170174 return ret;
171175
176+ /* Lines must be reconfigured explicitly as input or output. */
177+ if (!(lflags & GPIOHANDLE_REQUEST_DIRECTION_FLAGS))
178+ return -EINVAL;
179+
172180 for (i = 0; i < lh->num_descs; i++) {
173181 desc = lh->descs[i];
174− linehandle_flags_to_desc_flags(gcnf.flags, &desc->flags);
182+ linehandle_flags_to_desc_flags(lflags, &desc->flags);
175183
176− /*
177− * Lines have to be requested explicitly for input
178− * or output, else the line will be treated "as is".
179− */
180184 if (lflags & GPIOHANDLE_REQUEST_OUTPUT) {
181185 int val = !!gcnf.default_values[i];
182186
183187 ret = gpiod_direction_output(desc, val);
184188 if (ret)
185189 return ret;
186− } else if (lflags & GPIOHANDLE_REQUEST_INPUT) {
190+ } else {
187191 ret = gpiod_direction_input(desc);
188192 if (ret)
189193 return ret;
@@ -1530,12 +1534,14 @@ static long linereq_set_config(struct linereq *lr, void __user *ip) · 1340 unmodified lines
15301534 line = &lr->lines[i];
15311535 desc = lr->lines[i].desc;
15321536 flags = gpio_v2_line_config_flags(&lc, i);
1533− gpio_v2_line_config_flags_to_desc_flags(flags, &desc->flags);
1534− edflags = flags & GPIO_V2_LINE_EDGE_DETECTOR_FLAGS;
15351537 /*
1536− * Lines have to be requested explicitly for input
1537− * or output, else the line will be treated "as is".
1538+ * Lines not explicitly reconfigured as input or output
1539+ * are left unchanged.
15381540 */
1541+ if (!(flags & GPIO_V2_LINE_DIRECTION_FLAGS))
1542+ continue;
1543+ gpio_v2_line_config_flags_to_desc_flags(flags, &desc->flags);
1544+ edflags = flags & GPIO_V2_LINE_EDGE_DETECTOR_FLAGS;
15391545 if (flags & GPIO_V2_LINE_FLAG_OUTPUT) {
15401546 int val = gpio_v2_line_config_output_value(&lc, i);
15411547
@@ -1543,7 +1549,7 @@ static long linereq_set_config(struct linereq *lr, void __user *ip) · 1 unmodified line
15431549 ret = gpiod_direction_output(desc, val);
15441550 if (ret)
15451551 return ret;
1546− } else if (flags & GPIO_V2_LINE_FLAG_INPUT) {
1552+ } else {
15471553 ret = gpiod_direction_input(desc);
15481554 if (ret)
15491555 return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c+1−1
@@ -400,7 +400,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev, · 399 unmodified lines
400400 mem_channel_number = vram_info->v30.channel_num;
401401 mem_channel_width = vram_info->v30.channel_width;
402402 if (vram_width)
403− *vram_width = mem_channel_number * (1 << mem_channel_width);
403+ *vram_width = mem_channel_number * 16;
404404 break;
405405 default:
406406 return -EINVAL;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+5−2
@@ -5220,11 +5220,14 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev) · 5219 unmodified lines
52205220
52215221 dev_info(adev->dev, "GPU mode1 reset\n");
52225222
5223+ /* Cache the state before bus master disable. The saved config space
5224+ * values are used in other cases like restore after mode-2 reset.
5225+ */
5226+ amdgpu_device_cache_pci_state(adev->pdev);
5227+
52235228 /* disable BM */
52245229 pci_clear_master(adev->pdev);
52255230
5226− amdgpu_device_cache_pci_state(adev->pdev);
5227−
52285231 if (amdgpu_dpm_is_mode1_reset_supported(adev)) {
52295232 dev_info(adev->dev, "GPU smu mode1 reset\n");
52305233 ret = amdgpu_dpm_mode1_reset(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+21−4
@@ -640,6 +640,20 @@ static const char *psp_gfx_cmd_name(enum psp_gfx_cmd_id cmd_id) · 639 unmodified lines
640640 }
641641 }
642642
643+static bool psp_err_warn(struct psp_context *psp)
644+{
645+ struct psp_gfx_cmd_resp *cmd = psp->cmd_buf_mem;
646+
647+ /* This response indicates reg list is already loaded */
648+ if (amdgpu_ip_version(psp->adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 2) &&
649+ cmd->cmd_id == GFX_CMD_ID_LOAD_IP_FW &&
650+ cmd->cmd.cmd_load_ip_fw.fw_type == GFX_FW_TYPE_REG_LIST &&
651+ cmd->resp.status == TEE_ERROR_CANCEL)
652+ return false;
653+
654+ return true;
655+}
656+
643657 static int
644658 psp_cmd_submit_buf(struct psp_context *psp,
645659 struct amdgpu_firmware_info *ucode,
@@ -699,10 +713,13 @@ psp_cmd_submit_buf(struct psp_context *psp, · 53 unmodified lines
699713 dev_warn(psp->adev->dev,
700714 "failed to load ucode %s(0x%X) ",
701715 amdgpu_ucode_name(ucode->ucode_id), ucode->ucode_id);
702− dev_warn(psp->adev->dev,
703− "psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
704− psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), psp->cmd_buf_mem->cmd_id,
705− psp->cmd_buf_mem->resp.status);
716+ if (psp_err_warn(psp))
717+ dev_warn(
718+ psp->adev->dev,
719+ "psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
720+ psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id),
721+ psp->cmd_buf_mem->cmd_id,
722+ psp->cmd_buf_mem->resp.status);
706723 /* If any firmware (including CAP) load fails under SRIOV, it should
707724 * return failure to stop the VF from initializing.
708725 * Also return failure in case of timeout
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c+16−2
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <drm/drm_atomic_helper.h>
44 #include <drm/drm_edid.h>
55 #include <drm/drm_simple_kms_helper.h>
6+#include <drm/drm_gem_framebuffer_helper.h>
67 #include <drm/drm_vblank.h>
78
89 #include "amdgpu.h"
@@ -314,7 +315,13 @@ static int amdgpu_vkms_prepare_fb(struct drm_plane *plane, · 305 unmodified lines
314315 return 0;
315316 }
316317 afb = to_amdgpu_framebuffer(new_state->fb);
317− obj = new_state->fb->obj[0];
318+
319+ obj = drm_gem_fb_get_obj(new_state->fb, 0);
320+ if (!obj) {
321+ DRM_ERROR("Failed to get obj from framebuffer\n");
322+ return -EINVAL;
323+ }
324+
318325 rbo = gem_to_amdgpu_bo(obj);
319326 adev = amdgpu_ttm_adev(rbo->tbo.bdev);
320327
@@ -368,12 +375,19 @@ static void amdgpu_vkms_cleanup_fb(struct drm_plane *plane, · 47 unmodified lines
368375 struct drm_plane_state *old_state)
369376 {
370377 struct amdgpu_bo *rbo;
378+ struct drm_gem_object *obj;
371379 int r;
372380
373381 if (!old_state->fb)
374382 return;
375383
376− rbo = gem_to_amdgpu_bo(old_state->fb->obj[0]);
384+ obj = drm_gem_fb_get_obj(old_state->fb, 0);
385+ if (!obj) {
386+ DRM_ERROR("Failed to get obj from framebuffer\n");
387+ return;
388+ }
389+
390+ rbo = gem_to_amdgpu_bo(obj);
377391 r = amdgpu_bo_reserve(rbo, false);
378392 if (unlikely(r)) {
379393 DRM_ERROR("failed to reserve rbo before unpin\n");
drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h+3−2
@@ -464,8 +464,9 @@ struct psp_gfx_rb_frame · 463 unmodified lines
464464 #define PSP_ERR_UNKNOWN_COMMAND 0x00000100
465465
466466 enum tee_error_code {
467− TEE_SUCCESS = 0x00000000,
468− TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A,
467+ TEE_SUCCESS = 0x00000000,
468+ TEE_ERROR_CANCEL = 0xFFFF0002,
469+ TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A,
469470 };
470471
471472 #endif /* _PSP_TEE_GFX_IF_H_ */
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c+9−1
@@ -1590,9 +1590,17 @@ static bool retrieve_link_cap(struct dc_link *link) · 1589 unmodified lines
15901590 return false;
15911591 }
15921592
1593− if (dp_is_lttpr_present(link))
1593+ if (dp_is_lttpr_present(link)) {
15941594 configure_lttpr_mode_transparent(link);
15951595
1596+ // Echo TOTAL_LTTPR_CNT back downstream
1597+ core_link_write_dpcd(
1598+ link,
1599+ DP_TOTAL_LTTPR_CNT,
1600+ &link->dpcd_caps.lttpr_caps.phy_repeater_cnt,
1601+ sizeof(link->dpcd_caps.lttpr_caps.phy_repeater_cnt));
1602+ }
1603+
15961604 /* Read DP tunneling information. */
15971605 status = dpcd_get_tunneling_device_data(link);
15981606
drivers/gpu/drm/amd/display/include/dpcd_defs.h+5−0
@@ -177,4 +177,9 @@ enum dpcd_psr_sink_states { · 176 unmodified lines
177177 #define DP_SINK_PR_PIXEL_DEVIATION_PER_LINE 0x379
178178 #define DP_SINK_PR_MAX_NUMBER_OF_DEVIATION_LINE 0x37A
179179
180+/* Remove once drm_dp_helper.h is updated upstream */
181+#ifndef DP_TOTAL_LTTPR_CNT
182+#define DP_TOTAL_LTTPR_CNT 0xF000A /* 2.1 */
183+#endif
184+
180185 #endif /* __DAL_DPCD_DEFS_H__ */
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+13−0
@@ -324,6 +324,18 @@ static int smu_dpm_set_umsch_mm_enable(struct smu_context *smu, · 323 unmodified lines
324324 return ret;
325325 }
326326
327+static int smu_set_mall_enable(struct smu_context *smu)
328+{
329+ int ret = 0;
330+
331+ if (!smu->ppt_funcs->set_mall_enable)
332+ return 0;
333+
334+ ret = smu->ppt_funcs->set_mall_enable(smu);
335+
336+ return ret;
337+}
338+
327339 /**
328340 * smu_dpm_set_power_gate - power gate/ungate the specific IP block
329341 *
@@ -1791,6 +1803,7 @@ static int smu_hw_init(void *handle) · 1461 unmodified lines
17911803 smu_dpm_set_jpeg_enable(smu, true);
17921804 smu_dpm_set_vpe_enable(smu, true);
17931805 smu_dpm_set_umsch_mm_enable(smu, true);
1806+ smu_set_mall_enable(smu);
17941807 smu_set_gfx_cgpg(smu, true);
17951808 }
17961809
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h+5−0
@@ -1394,6 +1394,11 @@ struct pptable_funcs { · 1393 unmodified lines
13941394 */
13951395 int (*dpm_set_umsch_mm_enable)(struct smu_context *smu, bool enable);
13961396
1397+ /**
1398+ * @set_mall_enable: Init MALL power gating control.
1399+ */
1400+ int (*set_mall_enable)(struct smu_context *smu);
1401+
13971402 /**
13981403 * @notify_rlc_state: Notify RLC power state to SMU.
13991404 */
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v14_0_0_ppsmc.h+2−2
@@ -106,8 +106,8 @@ · 105 unmodified lines
106106 #define PPSMC_MSG_DisableLSdma 0x35 ///< Disable LSDMA
107107 #define PPSMC_MSG_SetSoftMaxVpe 0x36 ///<
108108 #define PPSMC_MSG_SetSoftMinVpe 0x37 ///<
109−#define PPSMC_MSG_AllocMALLCache 0x38 ///< Allocating MALL Cache
110−#define PPSMC_MSG_ReleaseMALLCache 0x39 ///< Releasing MALL Cache
109+#define PPSMC_MSG_MALLPowerController 0x38 ///< Set MALL control
110+#define PPSMC_MSG_MALLPowerState 0x39 ///< Enter/Exit MALL PG
111111 #define PPSMC_Message_Count 0x3A ///< Total number of PPSMC messages
112112 /** @}*/
113113
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h+3−1
@@ -272,7 +272,9 @@ · 271 unmodified lines
272272 __SMU_DUMMY_MAP(SetSoftMinVpe), \
273273 __SMU_DUMMY_MAP(GetMetricsVersion), \
274274 __SMU_DUMMY_MAP(EnableUCLKShadow), \
275− __SMU_DUMMY_MAP(RmaDueToBadPageThreshold),
275+ __SMU_DUMMY_MAP(RmaDueToBadPageThreshold), \
276+ __SMU_DUMMY_MAP(MALLPowerController), \
277+ __SMU_DUMMY_MAP(MALLPowerState),
276278
277279 #undef __SMU_DUMMY_MAP
278280 #define __SMU_DUMMY_MAP(type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c+73−0
@@ -52,6 +52,19 @@ · 51 unmodified lines
5252 #define mmMP1_SMN_C2PMSG_90 0x029a
5353 #define mmMP1_SMN_C2PMSG_90_BASE_IDX 0
5454
55+/* MALLPowerController message arguments (Defines for the Cache mode control) */
56+#define SMU_MALL_PMFW_CONTROL 0
57+#define SMU_MALL_DRIVER_CONTROL 1
58+
59+/*
60+ * MALLPowerState message arguments
61+ * (Defines for the Allocate/Release Cache mode if in driver mode)
62+ */
63+#define SMU_MALL_EXIT_PG 0
64+#define SMU_MALL_ENTER_PG 1
65+
66+#define SMU_MALL_PG_CONFIG_DEFAULT SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_ON
67+
5568 #define FEATURE_MASK(feature) (1ULL << feature)
5669 #define SMC_DPM_FEATURE ( \
5770 FEATURE_MASK(FEATURE_CCLK_DPM_BIT) | \
@@ -66,6 +79,12 @@ · 8 unmodified lines
6679 FEATURE_MASK(FEATURE_GFX_DPM_BIT) | \
6780 FEATURE_MASK(FEATURE_VPE_DPM_BIT))
6881
82+enum smu_mall_pg_config {
83+ SMU_MALL_PG_CONFIG_PMFW_CONTROL = 0,
84+ SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_ON = 1,
85+ SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_OFF = 2,
86+};
87+
6988 static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] = {
7089 MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1),
7190 MSG_MAP(GetSmuVersion, PPSMC_MSG_GetPmfwVersion, 1),
@@ -113,6 +132,8 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] = · 41 unmodified lines
113132 MSG_MAP(PowerDownUmsch, PPSMC_MSG_PowerDownUmsch, 1),
114133 MSG_MAP(SetSoftMaxVpe, PPSMC_MSG_SetSoftMaxVpe, 1),
115134 MSG_MAP(SetSoftMinVpe, PPSMC_MSG_SetSoftMinVpe, 1),
135+ MSG_MAP(MALLPowerController, PPSMC_MSG_MALLPowerController, 1),
136+ MSG_MAP(MALLPowerState, PPSMC_MSG_MALLPowerState, 1),
116137 };
117138
118139 static struct cmn2asic_mapping smu_v14_0_0_feature_mask_map[SMU_FEATURE_COUNT] = {
@@ -1423,6 +1444,57 @@ static int smu_v14_0_common_get_dpm_table(struct smu_context *smu, struct dpm_cl · 1304 unmodified lines
14231444 return 0;
14241445 }
14251446
1447+static int smu_v14_0_1_init_mall_power_gating(struct smu_context *smu, enum smu_mall_pg_config pg_config)
1448+{
1449+ struct amdgpu_device *adev = smu->adev;
1450+ int ret = 0;
1451+
1452+ if (pg_config == SMU_MALL_PG_CONFIG_PMFW_CONTROL) {
1453+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_MALLPowerController,
1454+ SMU_MALL_PMFW_CONTROL, NULL);
1455+ if (ret) {
1456+ dev_err(adev->dev, "Init MALL PMFW CONTROL Failure\n");
1457+ return ret;
1458+ }
1459+ } else {
1460+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_MALLPowerController,
1461+ SMU_MALL_DRIVER_CONTROL, NULL);
1462+ if (ret) {
1463+ dev_err(adev->dev, "Init MALL Driver CONTROL Failure\n");
1464+ return ret;
1465+ }
1466+
1467+ if (pg_config == SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_ON) {
1468+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_MALLPowerState,
1469+ SMU_MALL_EXIT_PG, NULL);
1470+ if (ret) {
1471+ dev_err(adev->dev, "EXIT MALL PG Failure\n");
1472+ return ret;
1473+ }
1474+ } else if (pg_config == SMU_MALL_PG_CONFIG_DRIVER_CONTROL_ALWAYS_OFF) {
1475+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_MALLPowerState,
1476+ SMU_MALL_ENTER_PG, NULL);
1477+ if (ret) {
1478+ dev_err(adev->dev, "Enter MALL PG Failure\n");
1479+ return ret;
1480+ }
1481+ }
1482+ }
1483+
1484+ return ret;
1485+}
1486+
1487+static int smu_v14_0_common_set_mall_enable(struct smu_context *smu)
1488+{
1489+ enum smu_mall_pg_config pg_config = SMU_MALL_PG_CONFIG_DEFAULT;
1490+ int ret = 0;
1491+
1492+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1493+ ret = smu_v14_0_1_init_mall_power_gating(smu, pg_config);
1494+
1495+ return ret;
1496+}
1497+
14261498 static const struct pptable_funcs smu_v14_0_0_ppt_funcs = {
14271499 .check_fw_status = smu_v14_0_check_fw_status,
14281500 .check_fw_version = smu_v14_0_check_fw_version,
@@ -1454,6 +1526,7 @@ static const struct pptable_funcs smu_v14_0_0_ppt_funcs = { · 25 unmodified lines
14541526 .dpm_set_vpe_enable = smu_v14_0_0_set_vpe_enable,
14551527 .dpm_set_umsch_mm_enable = smu_v14_0_0_set_umsch_mm_enable,
14561528 .get_dpm_clock_table = smu_v14_0_common_get_dpm_table,
1529+ .set_mall_enable = smu_v14_0_common_set_mall_enable,
14571530 };
14581531
14591532 static void smu_v14_0_0_set_smu_mailbox_registers(struct smu_context *smu)
drivers/gpu/drm/drm_fb_helper.c+3−3
@@ -524,6 +524,9 @@ struct fb_info *drm_fb_helper_alloc_info(struct drm_fb_helper *fb_helper) · 523 unmodified lines
524524 if (!info)
525525 return ERR_PTR(-ENOMEM);
526526
527+ if (!drm_leak_fbdev_smem)
528+ info->flags |= FBINFO_HIDE_SMEM_START;
529+
527530 ret = fb_alloc_cmap(&info->cmap, 256, 0);
528531 if (ret)
529532 goto err_release;
@@ -1860,9 +1863,6 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper) · 1330 unmodified lines
18601863 info = fb_helper->info;
18611864 info->var.pixclock = 0;
18621865
1863− if (!drm_leak_fbdev_smem)
1864− info->flags |= FBINFO_HIDE_SMEM_START;
1865−
18661866 /* Need to drop locks to avoid recursive deadlock in
18671867 * register_framebuffer. This is ok because the only thing left to do is
18681868 * register the fbdev emulation instance in kernel_fb_helper_list. */
drivers/gpu/drm/drm_fbdev_dma.c+4−1
@@ -130,7 +130,10 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper, · 129 unmodified lines
130130 info->flags |= FBINFO_READS_FAST; /* signal caching */
131131 info->screen_size = sizes->surface_height * fb->pitches[0];
132132 info->screen_buffer = map.vaddr;
133− info->fix.smem_start = page_to_phys(virt_to_page(info->screen_buffer));
133+ if (!(info->flags & FBINFO_HIDE_SMEM_START)) {
134+ if (!drm_WARN_ON(dev, is_vmalloc_addr(info->screen_buffer)))
135+ info->fix.smem_start = page_to_phys(virt_to_page(info->screen_buffer));
136+ }
134137 info->fix.smem_len = info->screen_size;
135138
136139 return 0;
drivers/gpu/drm/drm_file.c+3−5
@@ -469,14 +469,12 @@ void drm_file_update_pid(struct drm_file *filp) · 468 unmodified lines
469469
470470 dev = filp->minor->dev;
471471 mutex_lock(&dev->filelist_mutex);
472+ get_pid(pid);
472473 old = rcu_replace_pointer(filp->pid, pid, 1);
473474 mutex_unlock(&dev->filelist_mutex);
474475
475− if (pid != old) {
476− get_pid(pid);
477− synchronize_rcu();
478− put_pid(old);
479− }
476+ synchronize_rcu();
477+ put_pid(old);
480478 }
481479
482480 /**
drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c+1−0
@@ -298,6 +298,7 @@ void i915_vma_revoke_fence(struct i915_vma *vma) · 297 unmodified lines
298298 return;
299299
300300 GEM_BUG_ON(fence->vma != vma);
301+ i915_active_wait(&fence->active);
301302 GEM_BUG_ON(!i915_active_is_idle(&fence->active));
302303 GEM_BUG_ON(atomic_read(&fence->pin_count));
303304
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c+6−0
@@ -209,6 +209,8 @@ static int nv17_tv_get_ld_modes(struct drm_encoder *encoder, · 208 unmodified lines
209209 struct drm_display_mode *mode;
210210
211211 mode = drm_mode_duplicate(encoder->dev, tv_mode);
212+ if (!mode)
213+ continue;
212214
213215 mode->clock = tv_norm->tv_enc_mode.vrefresh *
214216 mode->htotal / 1000 *
@@ -258,6 +260,8 @@ static int nv17_tv_get_hd_modes(struct drm_encoder *encoder, · 43 unmodified lines
258260 if (modes[i].hdisplay == output_mode->hdisplay &&
259261 modes[i].vdisplay == output_mode->vdisplay) {
260262 mode = drm_mode_duplicate(encoder->dev, output_mode);
263+ if (!mode)
264+ continue;
261265 mode->type |= DRM_MODE_TYPE_PREFERRED;
262266
263267 } else {
@@ -265,6 +269,8 @@ static int nv17_tv_get_hd_modes(struct drm_encoder *encoder, · 1 unmodified line
265269 modes[i].vdisplay, 60, false,
266270 (output_mode->flags &
267271 DRM_MODE_FLAG_INTERLACE), false);
272+ if (!mode)
273+ continue;
268274 }
269275
270276 /* CVT modes are sometimes unsuitable... */
drivers/gpu/drm/panel/panel-simple.c+1−0
@@ -2752,6 +2752,7 @@ static const struct display_timing koe_tx26d202vm0bwa_timing = { · 2751 unmodified lines
27522752 .vfront_porch = { 3, 5, 10 },
27532753 .vback_porch = { 2, 5, 10 },
27542754 .vsync_len = { 5, 5, 5 },
2755+ .flags = DISPLAY_FLAGS_DE_HIGH,
27552756 };
27562757
27572758 static const struct panel_desc koe_tx26d202vm0bwa = {
drivers/i2c/busses/Makefile+2−4
@@ -29,8 +29,7 @@ obj-$(CONFIG_I2C_SIS630) += i2c-sis630.o · 28 unmodified lines
2929 obj-$(CONFIG_I2C_SIS96X) += i2c-sis96x.o
3030 obj-$(CONFIG_I2C_VIA) += i2c-via.o
3131 obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o
32−i2c-zhaoxin-objs := i2c-viai2c-zhaoxin.o i2c-viai2c-common.o
33−obj-$(CONFIG_I2C_ZHAOXIN) += i2c-zhaoxin.o
32+obj-$(CONFIG_I2C_ZHAOXIN) += i2c-viai2c-zhaoxin.o i2c-viai2c-common.o
3433
3534 # Mac SMBus host controller drivers
3635 obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o
@@ -120,8 +119,7 @@ obj-$(CONFIG_I2C_TEGRA_BPMP) += i2c-tegra-bpmp.o · 83 unmodified lines
120119 obj-$(CONFIG_I2C_UNIPHIER) += i2c-uniphier.o
121120 obj-$(CONFIG_I2C_UNIPHIER_F) += i2c-uniphier-f.o
122121 obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
123−i2c-wmt-objs := i2c-viai2c-wmt.o i2c-viai2c-common.o
124−obj-$(CONFIG_I2C_WMT) += i2c-wmt.o
122+obj-$(CONFIG_I2C_WMT) += i2c-viai2c-wmt.o i2c-viai2c-common.o
125123 i2c-octeon-objs := i2c-octeon-core.o i2c-octeon-platdrv.o
126124 obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o
127125 i2c-thunderx-objs := i2c-octeon-core.o i2c-thunderx-pcidrv.o
drivers/i2c/busses/i2c-viai2c-common.c+9−62
@@ -17,6 +17,7 @@ int viai2c_wait_bus_not_busy(struct viai2c *i2c) · 16 unmodified lines
1717
1818 return 0;
1919 }
20+EXPORT_SYMBOL_GPL(viai2c_wait_bus_not_busy);
2021
2122 static int viai2c_write(struct viai2c *i2c, struct i2c_msg *pmsg, int last)
2223 {
@@ -121,6 +122,7 @@ int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) · 98 unmodified lines
121122
122123 return (ret < 0) ? ret : i;
123124 }
125+EXPORT_SYMBOL_GPL(viai2c_xfer);
124126
125127 /*
126128 * Main process of the byte mode xfer
@@ -130,7 +132,7 @@ int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) · 3 unmodified lines
130132 * 0: there is still data that needs to be transferred
131133 * -EIO: error occurred
132134 */
133−static int viai2c_irq_xfer(struct viai2c *i2c)
135+int viai2c_irq_xfer(struct viai2c *i2c)
134136 {
135137 u16 val;
136138 struct i2c_msg *msg = i2c->msg;
@@ -171,51 +173,11 @@ static int viai2c_irq_xfer(struct viai2c *i2c) · 34 unmodified lines
171173
172174 return i2c->xfered_len == msg->len;
173175 }
174−
175−int __weak viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq)
176−{
177− return 0;
178−}
179−
180−static irqreturn_t viai2c_isr(int irq, void *data)
181−{
182− struct viai2c *i2c = data;
183− u8 status;
184−
185− /* save the status and write-clear it */
186− status = readw(i2c->base + VIAI2C_REG_ISR);
187− if (!status && i2c->platform == VIAI2C_PLAT_ZHAOXIN)
188− return IRQ_NONE;
189−
190− writew(status, i2c->base + VIAI2C_REG_ISR);
191−
192− i2c->ret = 0;
193− if (status & VIAI2C_ISR_NACK_ADDR)
194− i2c->ret = -EIO;
195−
196− if (i2c->platform == VIAI2C_PLAT_WMT && (status & VIAI2C_ISR_SCL_TIMEOUT))
197− i2c->ret = -ETIMEDOUT;
198−
199− if (!i2c->ret) {
200− if (i2c->mode == VIAI2C_BYTE_MODE)
201− i2c->ret = viai2c_irq_xfer(i2c);
202− else
203− i2c->ret = viai2c_fifo_irq_xfer(i2c, true);
204− }
205−
206− /* All the data has been successfully transferred or error occurred */
207− if (i2c->ret)
208− complete(&i2c->complete);
209−
210− return IRQ_HANDLED;
211−}
176+EXPORT_SYMBOL_GPL(viai2c_irq_xfer);
212177
213178 int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c, int plat)
214179 {
215− int err;
216− int irq_flags;
217180 struct viai2c *i2c;
218− struct device_node *np = pdev->dev.of_node;
219181
220182 i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
221183 if (!i2c)
@@ -225,28 +187,8 @@ int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c, int plat) · 3 unmodified lines
225187 if (IS_ERR(i2c->base))
226188 return PTR_ERR(i2c->base);
227189
228− if (plat == VIAI2C_PLAT_WMT) {
229− irq_flags = 0;
230− i2c->irq = irq_of_parse_and_map(np, 0);
231− if (!i2c->irq)
232− return -EINVAL;
233− } else if (plat == VIAI2C_PLAT_ZHAOXIN) {
234− irq_flags = IRQF_SHARED;
235− i2c->irq = platform_get_irq(pdev, 0);
236− if (i2c->irq < 0)
237− return i2c->irq;
238− } else {
239− return dev_err_probe(&pdev->dev, -EINVAL, "wrong platform type\n");
240− }
241−
242190 i2c->platform = plat;
243191
244− err = devm_request_irq(&pdev->dev, i2c->irq, viai2c_isr,
245− irq_flags, pdev->name, i2c);
246− if (err)
247− return dev_err_probe(&pdev->dev, err,
248− "failed to request irq %i\n", i2c->irq);
249−
250192 i2c->dev = &pdev->dev;
251193 init_completion(&i2c->complete);
252194 platform_set_drvdata(pdev, i2c);
@@ -254,3 +196,8 @@ int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c, int plat) · 1 unmodified line
254196 *pi2c = i2c;
255197 return 0;
256198 }
199+EXPORT_SYMBOL_GPL(viai2c_init);
200+
201+MODULE_DESCRIPTION("Via/Wondermedia/Zhaoxin I2C master-mode bus adapter");
202+MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>");
203+MODULE_LICENSE("GPL");
drivers/i2c/busses/i2c-viai2c-common.h+1−1
@@ -80,6 +80,6 @@ struct viai2c { · 79 unmodified lines
8080 int viai2c_wait_bus_not_busy(struct viai2c *i2c);
8181 int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num);
8282 int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c, int plat);
83−int viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq);
83+int viai2c_irq_xfer(struct viai2c *i2c);
8484
8585 #endif
drivers/i2c/busses/i2c-viai2c-wmt.c+36−0
@@ -72,6 +72,32 @@ static int wmt_i2c_reset_hardware(struct viai2c *i2c) · 71 unmodified lines
7272 return 0;
7373 }
7474
75+static irqreturn_t wmt_i2c_isr(int irq, void *data)
76+{
77+ struct viai2c *i2c = data;
78+ u8 status;
79+
80+ /* save the status and write-clear it */
81+ status = readw(i2c->base + VIAI2C_REG_ISR);
82+ writew(status, i2c->base + VIAI2C_REG_ISR);
83+
84+ i2c->ret = 0;
85+ if (status & VIAI2C_ISR_NACK_ADDR)
86+ i2c->ret = -EIO;
87+
88+ if (status & VIAI2C_ISR_SCL_TIMEOUT)
89+ i2c->ret = -ETIMEDOUT;
90+
91+ if (!i2c->ret)
92+ i2c->ret = viai2c_irq_xfer(i2c);
93+
94+ /* All the data has been successfully transferred or error occurred */
95+ if (i2c->ret)
96+ complete(&i2c->complete);
97+
98+ return IRQ_HANDLED;
99+}
100+
75101 static int wmt_i2c_probe(struct platform_device *pdev)
76102 {
77103 struct device_node *np = pdev->dev.of_node;
@@ -84,6 +110,16 @@ static int wmt_i2c_probe(struct platform_device *pdev) · 6 unmodified lines
84110 if (err)
85111 return err;
86112
113+ i2c->irq = platform_get_irq(pdev, 0);
114+ if (i2c->irq < 0)
115+ return i2c->irq;
116+
117+ err = devm_request_irq(&pdev->dev, i2c->irq, wmt_i2c_isr,
118+ 0, pdev->name, i2c);
119+ if (err)
120+ return dev_err_probe(&pdev->dev, err,
121+ "failed to request irq %i\n", i2c->irq);
122+
87123 i2c->clk = of_clk_get(np, 0);
88124 if (IS_ERR(i2c->clk)) {
89125 dev_err(&pdev->dev, "unable to request clock\n");
drivers/i2c/busses/i2c-viai2c-zhaoxin.c+91−22
@@ -49,8 +49,7 @@ struct viai2c_zhaoxin { · 48 unmodified lines
4949 u16 xfer_len;
5050 };
5151
52−/* 'irq == true' means in interrupt context */
53−int viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq)
52+static int viai2c_fifo_xfer(struct viai2c *i2c)
5453 {
5554 u16 i;
5655 u8 tmp;
@@ -59,17 +58,6 @@ int viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq) · 2 unmodified lines
5958 bool read = !!(msg->flags & I2C_M_RD);
6059 struct viai2c_zhaoxin *priv = i2c->pltfm_priv;
6160
62− if (irq) {
63− /* get the received data */
64− if (read)
65− for (i = 0; i < priv->xfer_len; i++)
66− msg->buf[i2c->xfered_len + i] = ioread8(base + ZXI2C_REG_HRDR);
67−
68− i2c->xfered_len += priv->xfer_len;
69− if (i2c->xfered_len == msg->len)
70− return 1;
71− }
72−
7361 /* reset fifo buffer */
7462 tmp = ioread8(base + ZXI2C_REG_HCR);
7563 iowrite8(tmp | ZXI2C_HCR_RST_FIFO, base + ZXI2C_REG_HCR);
@@ -92,18 +80,59 @@ int viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq) · 16 unmodified lines
9280 iowrite8(tmp, base + VIAI2C_REG_CR);
9381 }
9482
95− if (irq) {
96− /* continue transmission */
97− tmp = ioread8(base + VIAI2C_REG_CR);
98− iowrite8(tmp |= VIAI2C_CR_CPU_RDY, base + VIAI2C_REG_CR);
83+ u16 tcr_val = i2c->tcr;
84+
85+ /* start transmission */
86+ tcr_val |= read ? VIAI2C_TCR_READ : 0;
87+ writew(tcr_val | msg->addr, base + VIAI2C_REG_TCR);
88+
89+ return 0;
90+}
91+
92+static int viai2c_fifo_irq_xfer(struct viai2c *i2c)
93+{
94+ u16 i;
95+ u8 tmp;
96+ struct i2c_msg *msg = i2c->msg;
97+ void __iomem *base = i2c->base;
98+ bool read = !!(msg->flags & I2C_M_RD);
99+ struct viai2c_zhaoxin *priv = i2c->pltfm_priv;
100+
101+ /* get the received data */
102+ if (read)
103+ for (i = 0; i < priv->xfer_len; i++)
104+ msg->buf[i2c->xfered_len + i] = ioread8(base + ZXI2C_REG_HRDR);
105+
106+ i2c->xfered_len += priv->xfer_len;
107+ if (i2c->xfered_len == msg->len)
108+ return 1;
109+
110+ /* reset fifo buffer */
111+ tmp = ioread8(base + ZXI2C_REG_HCR);
112+ iowrite8(tmp | ZXI2C_HCR_RST_FIFO, base + ZXI2C_REG_HCR);
113+
114+ /* set xfer len */
115+ priv->xfer_len = min_t(u16, msg->len - i2c->xfered_len, ZXI2C_FIFO_SIZE);
116+ if (read) {
117+ iowrite8(priv->xfer_len - 1, base + ZXI2C_REG_HRLR);
99118 } else {
100− u16 tcr_val = i2c->tcr;
119+ iowrite8(priv->xfer_len - 1, base + ZXI2C_REG_HTLR);
120+ /* set write data */
121+ for (i = 0; i < priv->xfer_len; i++)
122+ iowrite8(msg->buf[i2c->xfered_len + i], base + ZXI2C_REG_HTDR);
123+ }
101124
102− /* start transmission */
103− tcr_val |= read ? VIAI2C_TCR_READ : 0;
104− writew(tcr_val | msg->addr, base + VIAI2C_REG_TCR);
125+ /* prepare to stop transmission */
126+ if (priv->hrv && msg->len == (i2c->xfered_len + priv->xfer_len)) {
127+ tmp = ioread8(base + VIAI2C_REG_CR);
128+ tmp |= read ? VIAI2C_CR_RX_END : VIAI2C_CR_TX_END;
129+ iowrite8(tmp, base + VIAI2C_REG_CR);
105130 }
106131
132+ /* continue transmission */
133+ tmp = ioread8(base + VIAI2C_REG_CR);
134+ iowrite8(tmp |= VIAI2C_CR_CPU_RDY, base + VIAI2C_REG_CR);
135+
107136 return 0;
108137 }
109138
@@ -135,7 +164,7 @@ static int zxi2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int · 25 unmodified lines
135164 priv->xfer_len = 0;
136165 i2c->xfered_len = 0;
137166
138− viai2c_fifo_irq_xfer(i2c, 0);
167+ viai2c_fifo_xfer(i2c);
139168
140169 if (!wait_for_completion_timeout(&i2c->complete, VIAI2C_TIMEOUT))
141170 return -ETIMEDOUT;
@@ -228,6 +257,36 @@ static void zxi2c_get_bus_speed(struct viai2c *i2c) · 86 unmodified lines
228257 dev_info(i2c->dev, "speed mode is %s\n", i2c_freq_mode_string(params[0]));
229258 }
230259
260+static irqreturn_t zxi2c_isr(int irq, void *data)
261+{
262+ struct viai2c *i2c = data;
263+ u8 status;
264+
265+ /* save the status and write-clear it */
266+ status = readw(i2c->base + VIAI2C_REG_ISR);
267+ if (!status)
268+ return IRQ_NONE;
269+
270+ writew(status, i2c->base + VIAI2C_REG_ISR);
271+
272+ i2c->ret = 0;
273+ if (status & VIAI2C_ISR_NACK_ADDR)
274+ i2c->ret = -EIO;
275+
276+ if (!i2c->ret) {
277+ if (i2c->mode == VIAI2C_BYTE_MODE)
278+ i2c->ret = viai2c_irq_xfer(i2c);
279+ else
280+ i2c->ret = viai2c_fifo_irq_xfer(i2c);
281+ }
282+
283+ /* All the data has been successfully transferred or error occurred */
284+ if (i2c->ret)
285+ complete(&i2c->complete);
286+
287+ return IRQ_HANDLED;
288+}
289+
231290 static int zxi2c_probe(struct platform_device *pdev)
232291 {
233292 int error;
@@ -239,6 +298,16 @@ static int zxi2c_probe(struct platform_device *pdev) · 5 unmodified lines
239298 if (error)
240299 return error;
241300
301+ i2c->irq = platform_get_irq(pdev, 0);
302+ if (i2c->irq < 0)
303+ return i2c->irq;
304+
305+ error = devm_request_irq(&pdev->dev, i2c->irq, zxi2c_isr,
306+ IRQF_SHARED, pdev->name, i2c);
307+ if (error)
308+ return dev_err_probe(&pdev->dev, error,
309+ "failed to request irq %i\n", i2c->irq);
310+
242311 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
243312 if (!priv)
244313 return -ENOMEM;
drivers/i2c/i2c-slave-testunit.c+4−1
@@ -118,9 +118,12 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client, · 117 unmodified lines
118118 queue_delayed_work(system_long_wq, &tu->worker,
119119 msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY]));
120120 }
121− fallthrough;
121+ break;
122122
123123 case I2C_SLAVE_WRITE_REQUESTED:
124+ if (test_bit(TU_FLAG_IN_PROCESS, &tu->flags))
125+ return -EBUSY;
126+
124127 memset(tu->regs, 0, TU_NUM_REGS);
125128 tu->reg_idx = 0;
126129 break;
drivers/iio/accel/Kconfig+2−0
@@ -330,6 +330,8 @@ config DMARD10 · 329 unmodified lines
330330 config FXLS8962AF
331331 tristate
332332 depends on I2C || !I2C # cannot be built-in for modular I2C
333+ select IIO_BUFFER
334+ select IIO_KFIFO_BUF
333335
334336 config FXLS8962AF_I2C
335337 tristate "NXP FXLS8962AF/FXLS8964AF Accelerometer I2C Driver"
drivers/iio/adc/ad7266.c+2−0
@@ -157,6 +157,8 @@ static int ad7266_read_raw(struct iio_dev *indio_dev, · 156 unmodified lines
157157 ret = ad7266_read_single(st, val, chan->address);
158158 iio_device_release_direct_mode(indio_dev);
159159
160+ if (ret < 0)
161+ return ret;
160162 *val = (*val >> 2) & 0xfff;
161163 if (chan->scan_type.sign == 's')
162164 *val = sign_extend32(*val,
drivers/iio/adc/xilinx-ams.c+6−2
@@ -414,8 +414,12 @@ static void ams_enable_channel_sequence(struct iio_dev *indio_dev) · 413 unmodified lines
414414
415415 /* Run calibration of PS & PL as part of the sequence */
416416 scan_mask = BIT(0) | BIT(AMS_PS_SEQ_MAX);
417− for (i = 0; i < indio_dev->num_channels; i++)
418− scan_mask |= BIT_ULL(indio_dev->channels[i].scan_index);
417+ for (i = 0; i < indio_dev->num_channels; i++) {
418+ const struct iio_chan_spec *chan = &indio_dev->channels[i];
419+
420+ if (chan->scan_index < AMS_CTRL_SEQ_BASE)
421+ scan_mask |= BIT_ULL(chan->scan_index);
422+ }
419423
420424 if (ams->ps_base) {
421425 /* put sysmon in a soft reset to change the sequence */
drivers/iio/chemical/bme680.h+2−0
@@ -54,7 +54,9 @@ · 53 unmodified lines
5454 #define BME680_NB_CONV_MASK GENMASK(3, 0)
5555
5656 #define BME680_REG_MEAS_STAT_0 0x1D
57+#define BME680_NEW_DATA_BIT BIT(7)
5758 #define BME680_GAS_MEAS_BIT BIT(6)
59+#define BME680_MEAS_BIT BIT(5)
5860
5961 /* Calibration Parameters */
6062 #define BME680_T2_LSB_REG 0x8A
drivers/iio/chemical/bme680_core.c+54−8
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 */
1111 #include <linux/acpi.h>
1212 #include <linux/bitfield.h>
13+#include <linux/delay.h>
1314 #include <linux/device.h>
1415 #include <linux/module.h>
1516 #include <linux/log2.h>
@@ -38,7 +39,7 @@ struct bme680_calib { · 22 unmodified lines
3839 s8 par_h3;
3940 s8 par_h4;
4041 s8 par_h5;
41− s8 par_h6;
42+ u8 par_h6;
4243 s8 par_h7;
4344 s8 par_gh1;
4445 s16 par_gh2;
@@ -342,10 +343,10 @@ static s16 bme680_compensate_temp(struct bme680_data *data, · 297 unmodified lines
342343 if (!calib->par_t2)
343344 bme680_read_calib(data, calib);
344345
345− var1 = (adc_temp >> 3) - (calib->par_t1 << 1);
346+ var1 = (adc_temp >> 3) - ((s32)calib->par_t1 << 1);
346347 var2 = (var1 * calib->par_t2) >> 11;
347348 var3 = ((var1 >> 1) * (var1 >> 1)) >> 12;
348− var3 = (var3 * (calib->par_t3 << 4)) >> 14;
349+ var3 = (var3 * ((s32)calib->par_t3 << 4)) >> 14;
349350 data->t_fine = var2 + var3;
350351 calc_temp = (data->t_fine * 5 + 128) >> 8;
351352
@@ -368,9 +369,9 @@ static u32 bme680_compensate_press(struct bme680_data *data, · 16 unmodified lines
368369 var1 = (data->t_fine >> 1) - 64000;
369370 var2 = ((((var1 >> 2) * (var1 >> 2)) >> 11) * calib->par_p6) >> 2;
370371 var2 = var2 + (var1 * calib->par_p5 << 1);
371− var2 = (var2 >> 2) + (calib->par_p4 << 16);
372+ var2 = (var2 >> 2) + ((s32)calib->par_p4 << 16);
372373 var1 = (((((var1 >> 2) * (var1 >> 2)) >> 13) *
373− (calib->par_p3 << 5)) >> 3) +
374+ ((s32)calib->par_p3 << 5)) >> 3) +
374375 ((calib->par_p2 * var1) >> 1);
375376 var1 = var1 >> 18;
376377 var1 = ((32768 + var1) * calib->par_p1) >> 15;
@@ -388,7 +389,7 @@ static u32 bme680_compensate_press(struct bme680_data *data, · 11 unmodified lines
388389 var3 = ((press_comp >> 8) * (press_comp >> 8) *
389390 (press_comp >> 8) * calib->par_p10) >> 17;
390391
391− press_comp += (var1 + var2 + var3 + (calib->par_p7 << 7)) >> 4;
392+ press_comp += (var1 + var2 + var3 + ((s32)calib->par_p7 << 7)) >> 4;
392393
393394 return press_comp;
394395 }
@@ -414,7 +415,7 @@ static u32 bme680_compensate_humid(struct bme680_data *data, · 19 unmodified lines
414415 (((temp_scaled * ((temp_scaled * calib->par_h5) / 100))
415416 >> 6) / 100) + (1 << 14))) >> 10;
416417 var3 = var1 * var2;
417− var4 = calib->par_h6 << 7;
418+ var4 = (s32)calib->par_h6 << 7;
418419 var4 = (var4 + ((temp_scaled * calib->par_h7) / 100)) >> 4;
419420 var5 = ((var3 >> 14) * (var3 >> 14)) >> 10;
420421 var6 = (var4 * var5) >> 1;
@@ -532,6 +533,43 @@ static u8 bme680_oversampling_to_reg(u8 val) · 111 unmodified lines
532533 return ilog2(val) + 1;
533534 }
534535
536+/*
537+ * Taken from Bosch BME680 API:
538+ * https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x.c#L490
539+ */
540+static int bme680_wait_for_eoc(struct bme680_data *data)
541+{
542+ struct device *dev = regmap_get_device(data->regmap);
543+ unsigned int check;
544+ int ret;
545+ /*
546+ * (Sum of oversampling ratios * time per oversampling) +
547+ * TPH measurement + gas measurement + wait transition from forced mode
548+ * + heater duration
549+ */
550+ int wait_eoc_us = ((data->oversampling_temp + data->oversampling_press +
551+ data->oversampling_humid) * 1936) + (477 * 4) +
552+ (477 * 5) + 1000 + (data->heater_dur * 1000);
553+
554+ usleep_range(wait_eoc_us, wait_eoc_us + 100);
555+
556+ ret = regmap_read(data->regmap, BME680_REG_MEAS_STAT_0, &check);
557+ if (ret) {
558+ dev_err(dev, "failed to read measurement status register.\n");
559+ return ret;
560+ }
561+ if (check & BME680_MEAS_BIT) {
562+ dev_err(dev, "Device measurement cycle incomplete.\n");
563+ return -EBUSY;
564+ }
565+ if (!(check & BME680_NEW_DATA_BIT)) {
566+ dev_err(dev, "No new data available from the device.\n");
567+ return -ENODATA;
568+ }
569+
570+ return 0;
571+}
572+
535573 static int bme680_chip_config(struct bme680_data *data)
536574 {
537575 struct device *dev = regmap_get_device(data->regmap);
@@ -622,6 +660,10 @@ static int bme680_read_temp(struct bme680_data *data, int *val) · 84 unmodified lines
622660 if (ret < 0)
623661 return ret;
624662
663+ ret = bme680_wait_for_eoc(data);
664+ if (ret)
665+ return ret;
666+
625667 ret = regmap_bulk_read(data->regmap, BME680_REG_TEMP_MSB,
626668 &tmp, 3);
627669 if (ret < 0) {
@@ -678,7 +720,7 @@ static int bme680_read_press(struct bme680_data *data, · 50 unmodified lines
678720 }
679721
680722 *val = bme680_compensate_press(data, adc_press);
681− *val2 = 100;
723+ *val2 = 1000;
682724 return IIO_VAL_FRACTIONAL;
683725 }
684726
@@ -738,6 +780,10 @@ static int bme680_read_gas(struct bme680_data *data, · 53 unmodified lines
738780 if (ret < 0)
739781 return ret;
740782
783+ ret = bme680_wait_for_eoc(data);
784+ if (ret)
785+ return ret;
786+
741787 ret = regmap_read(data->regmap, BME680_REG_MEAS_STAT_0, &check);
742788 if (check & BME680_GAS_MEAS_BIT) {
743789 dev_err(dev, "gas measurement incomplete\n");
drivers/iio/dac/Kconfig+1−1
@@ -133,7 +133,7 @@ config AD5624R_SPI · 132 unmodified lines
133133
134134 config AD9739A
135135 tristate "Analog Devices AD9739A RF DAC spi driver"
136− depends on SPI || COMPILE_TEST
136+ depends on SPI
137137 select REGMAP_SPI
138138 select IIO_BACKEND
139139 help
drivers/iio/humidity/hdc3020.c+249−76
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/i2c.h>
2020 #include <linux/init.h>
2121 #include <linux/interrupt.h>
22+#include <linux/math64.h>
2223 #include <linux/module.h>
2324 #include <linux/mutex.h>
2425 #include <linux/pm.h>
@@ -66,8 +67,10 @@ · 41 unmodified lines
6667
6768 #define HDC3020_CRC8_POLYNOMIAL 0x31
6869
69−#define HDC3020_MIN_TEMP -40
70−#define HDC3020_MAX_TEMP 125
70+#define HDC3020_MIN_TEMP_MICRO -39872968
71+#define HDC3020_MAX_TEMP_MICRO 124875639
72+#define HDC3020_MAX_TEMP_HYST_MICRO 164748607
73+#define HDC3020_MAX_HUM_MICRO 99220264
7174
7275 struct hdc3020_data {
7376 struct i2c_client *client;
@@ -368,6 +371,105 @@ static int hdc3020_write_raw(struct iio_dev *indio_dev, · 294 unmodified lines
368371 return -EINVAL;
369372 }
370373
374+static int hdc3020_thresh_get_temp(u16 thresh)
375+{
376+ int temp;
377+
378+ /*
379+ * Get the temperature threshold from 9 LSBs, shift them to get
380+ * the truncated temperature threshold representation and
381+ * calculate the threshold according to the formula in the
382+ * datasheet. Result is degree celsius scaled by 65535.
383+ */
384+ temp = FIELD_GET(HDC3020_THRESH_TEMP_MASK, thresh) <<
385+ HDC3020_THRESH_TEMP_TRUNC_SHIFT;
386+
387+ return -2949075 + (175 * temp);
388+}
389+
390+static int hdc3020_thresh_get_hum(u16 thresh)
391+{
392+ int hum;
393+
394+ /*
395+ * Get the humidity threshold from 7 MSBs, shift them to get the
396+ * truncated humidity threshold representation and calculate the
397+ * threshold according to the formula in the datasheet. Result is
398+ * percent scaled by 65535.
399+ */
400+ hum = FIELD_GET(HDC3020_THRESH_HUM_MASK, thresh) <<
401+ HDC3020_THRESH_HUM_TRUNC_SHIFT;
402+
403+ return hum * 100;
404+}
405+
406+static u16 hdc3020_thresh_set_temp(int s_temp, u16 curr_thresh)
407+{
408+ u64 temp;
409+ u16 thresh;
410+
411+ /*
412+ * Calculate temperature threshold, shift it down to get the
413+ * truncated threshold representation in the 9LSBs while keeping
414+ * the current humidity threshold in the 7 MSBs.
415+ */
416+ temp = (u64)(s_temp + 45000000) * 65535ULL;
417+ temp = div_u64(temp, 1000000 * 175) >> HDC3020_THRESH_TEMP_TRUNC_SHIFT;
418+ thresh = FIELD_PREP(HDC3020_THRESH_TEMP_MASK, temp);
419+ thresh |= (FIELD_GET(HDC3020_THRESH_HUM_MASK, curr_thresh) <<
420+ HDC3020_THRESH_HUM_TRUNC_SHIFT);
421+
422+ return thresh;
423+}
424+
425+static u16 hdc3020_thresh_set_hum(int s_hum, u16 curr_thresh)
426+{
427+ u64 hum;
428+ u16 thresh;
429+
430+ /*
431+ * Calculate humidity threshold, shift it down and up to get the
432+ * truncated threshold representation in the 7MSBs while keeping
433+ * the current temperature threshold in the 9 LSBs.
434+ */
435+ hum = (u64)(s_hum) * 65535ULL;
436+ hum = div_u64(hum, 1000000 * 100) >> HDC3020_THRESH_HUM_TRUNC_SHIFT;
437+ thresh = FIELD_PREP(HDC3020_THRESH_HUM_MASK, hum);
438+ thresh |= FIELD_GET(HDC3020_THRESH_TEMP_MASK, curr_thresh);
439+
440+ return thresh;
441+}
442+
443+static
444+int hdc3020_thresh_clr(s64 s_thresh, s64 s_hyst, enum iio_event_direction dir)
445+{
446+ s64 s_clr;
447+
448+ /*
449+ * Include directions when calculation the clear value,
450+ * since hysteresis is unsigned by definition and the
451+ * clear value is an absolute value which is signed.
452+ */
453+ if (dir == IIO_EV_DIR_RISING)
454+ s_clr = s_thresh - s_hyst;
455+ else
456+ s_clr = s_thresh + s_hyst;
457+
458+ /* Divide by 65535 to get units of micro */
459+ return div_s64(s_clr, 65535);
460+}
461+
462+static int _hdc3020_write_thresh(struct hdc3020_data *data, u16 reg, u16 val)
463+{
464+ u8 buf[5];
465+
466+ put_unaligned_be16(reg, buf);
467+ put_unaligned_be16(val, buf + 2);
468+ buf[4] = crc8(hdc3020_crc8_table, buf + 2, 2, CRC8_INIT_VALUE);
469+
470+ return hdc3020_write_bytes(data, buf, 5);
471+}
472+
371473 static int hdc3020_write_thresh(struct iio_dev *indio_dev,
372474 const struct iio_chan_spec *chan,
373475 enum iio_event_type type,
@@ -376,67 +478,126 @@ static int hdc3020_write_thresh(struct iio_dev *indio_dev, · 2 unmodified lines
376478 int val, int val2)
377479 {
378480 struct hdc3020_data *data = iio_priv(indio_dev);
379− u8 buf[5];
380− u64 tmp;
381− u16 reg;
382− int ret;
383−
384− /* Supported temperature range is from –40 to 125 degree celsius */
385− if (val < HDC3020_MIN_TEMP || val > HDC3020_MAX_TEMP)
386− return -EINVAL;
387−
388− /* Select threshold register */
389− if (info == IIO_EV_INFO_VALUE) {
390− if (dir == IIO_EV_DIR_RISING)
391− reg = HDC3020_S_T_RH_THRESH_HIGH;
392− else
393− reg = HDC3020_S_T_RH_THRESH_LOW;
481+ u16 reg, reg_val, reg_thresh_rd, reg_clr_rd, reg_thresh_wr, reg_clr_wr;
482+ s64 s_thresh, s_hyst, s_clr;
483+ int s_val, thresh, clr, ret;
484+
485+ /* Select threshold registers */
486+ if (dir == IIO_EV_DIR_RISING) {
487+ reg_thresh_rd = HDC3020_R_T_RH_THRESH_HIGH;
488+ reg_thresh_wr = HDC3020_S_T_RH_THRESH_HIGH;
489+ reg_clr_rd = HDC3020_R_T_RH_THRESH_HIGH_CLR;
490+ reg_clr_wr = HDC3020_S_T_RH_THRESH_HIGH_CLR;
394491 } else {
395− if (dir == IIO_EV_DIR_RISING)
396− reg = HDC3020_S_T_RH_THRESH_HIGH_CLR;
397− else
398− reg = HDC3020_S_T_RH_THRESH_LOW_CLR;
492+ reg_thresh_rd = HDC3020_R_T_RH_THRESH_LOW;
493+ reg_thresh_wr = HDC3020_S_T_RH_THRESH_LOW;
494+ reg_clr_rd = HDC3020_R_T_RH_THRESH_LOW_CLR;
495+ reg_clr_wr = HDC3020_S_T_RH_THRESH_LOW_CLR;
399496 }
400497
401498 guard(mutex)(&data->lock);
402− ret = hdc3020_read_be16(data, reg);
499+ ret = hdc3020_read_be16(data, reg_thresh_rd);
500+ if (ret < 0)
501+ return ret;
502+
503+ thresh = ret;
504+ ret = hdc3020_read_be16(data, reg_clr_rd);
403505 if (ret < 0)
404506 return ret;
405507
508+ clr = ret;
509+ /* Scale value to include decimal part into calculations */
510+ s_val = (val < 0) ? (val * 1000000 - val2) : (val * 1000000 + val2);
406511 switch (chan->type) {
407512 case IIO_TEMP:
408− /*
409− * Calculate temperature threshold, shift it down to get the
410− * truncated threshold representation in the 9LSBs while keeping
411− * the current humidity threshold in the 7 MSBs.
412− */
413− tmp = ((u64)(((val + 45) * MICRO) + val2)) * 65535ULL;
414− tmp = div_u64(tmp, MICRO * 175);
415− val = tmp >> HDC3020_THRESH_TEMP_TRUNC_SHIFT;
416− val = FIELD_PREP(HDC3020_THRESH_TEMP_MASK, val);
417− val |= (FIELD_GET(HDC3020_THRESH_HUM_MASK, ret) <<
418− HDC3020_THRESH_HUM_TRUNC_SHIFT);
513+ switch (info) {
514+ case IIO_EV_INFO_VALUE:
515+ s_val = max(s_val, HDC3020_MIN_TEMP_MICRO);
516+ s_val = min(s_val, HDC3020_MAX_TEMP_MICRO);
517+ reg = reg_thresh_wr;
518+ reg_val = hdc3020_thresh_set_temp(s_val, thresh);
519+ ret = _hdc3020_write_thresh(data, reg, reg_val);
520+ if (ret < 0)
521+ return ret;
522+
523+ /* Calculate old hysteresis */
524+ s_thresh = (s64)hdc3020_thresh_get_temp(thresh) * 1000000;
525+ s_clr = (s64)hdc3020_thresh_get_temp(clr) * 1000000;
526+ s_hyst = div_s64(abs(s_thresh - s_clr), 65535);
527+ /* Set new threshold */
528+ thresh = reg_val;
529+ /* Set old hysteresis */
530+ s_val = s_hyst;
531+ fallthrough;
532+ case IIO_EV_INFO_HYSTERESIS:
533+ /*
534+ * Function hdc3020_thresh_get_temp returns temperature
535+ * in degree celsius scaled by 65535. Scale by 1000000
536+ * to be able to subtract scaled hysteresis value.
537+ */
538+ s_thresh = (s64)hdc3020_thresh_get_temp(thresh) * 1000000;
539+ /*
540+ * Units of s_val are in micro degree celsius, scale by
541+ * 65535 to get same units as s_thresh.
542+ */
543+ s_val = min(abs(s_val), HDC3020_MAX_TEMP_HYST_MICRO);
544+ s_hyst = (s64)s_val * 65535;
545+ s_clr = hdc3020_thresh_clr(s_thresh, s_hyst, dir);
546+ s_clr = max(s_clr, HDC3020_MIN_TEMP_MICRO);
547+ s_clr = min(s_clr, HDC3020_MAX_TEMP_MICRO);
548+ reg = reg_clr_wr;
549+ reg_val = hdc3020_thresh_set_temp(s_clr, clr);
550+ break;
551+ default:
552+ return -EOPNOTSUPP;
553+ }
419554 break;
420555 case IIO_HUMIDITYRELATIVE:
421− /*
422− * Calculate humidity threshold, shift it down and up to get the
423− * truncated threshold representation in the 7MSBs while keeping
424− * the current temperature threshold in the 9 LSBs.
425− */
426− tmp = ((u64)((val * MICRO) + val2)) * 65535ULL;
427− tmp = div_u64(tmp, MICRO * 100);
428− val = tmp >> HDC3020_THRESH_HUM_TRUNC_SHIFT;
429− val = FIELD_PREP(HDC3020_THRESH_HUM_MASK, val);
430− val |= FIELD_GET(HDC3020_THRESH_TEMP_MASK, ret);
556+ s_val = (s_val < 0) ? 0 : min(s_val, HDC3020_MAX_HUM_MICRO);
557+ switch (info) {
558+ case IIO_EV_INFO_VALUE:
559+ reg = reg_thresh_wr;
560+ reg_val = hdc3020_thresh_set_hum(s_val, thresh);
561+ ret = _hdc3020_write_thresh(data, reg, reg_val);
562+ if (ret < 0)
563+ return ret;
564+
565+ /* Calculate old hysteresis */
566+ s_thresh = (s64)hdc3020_thresh_get_hum(thresh) * 1000000;
567+ s_clr = (s64)hdc3020_thresh_get_hum(clr) * 1000000;
568+ s_hyst = div_s64(abs(s_thresh - s_clr), 65535);
569+ /* Set new threshold */
570+ thresh = reg_val;
571+ /* Try to set old hysteresis */
572+ s_val = min(abs(s_hyst), HDC3020_MAX_HUM_MICRO);
573+ fallthrough;
574+ case IIO_EV_INFO_HYSTERESIS:
575+ /*
576+ * Function hdc3020_thresh_get_hum returns relative
577+ * humidity in percent scaled by 65535. Scale by 1000000
578+ * to be able to subtract scaled hysteresis value.
579+ */
580+ s_thresh = (s64)hdc3020_thresh_get_hum(thresh) * 1000000;
581+ /*
582+ * Units of s_val are in micro percent, scale by 65535
583+ * to get same units as s_thresh.
584+ */
585+ s_hyst = (s64)s_val * 65535;
586+ s_clr = hdc3020_thresh_clr(s_thresh, s_hyst, dir);
587+ s_clr = max(s_clr, 0);
588+ s_clr = min(s_clr, HDC3020_MAX_HUM_MICRO);
589+ reg = reg_clr_wr;
590+ reg_val = hdc3020_thresh_set_hum(s_clr, clr);
591+ break;
592+ default:
593+ return -EOPNOTSUPP;
594+ }
431595 break;
432596 default:
433597 return -EOPNOTSUPP;
434598 }
435599
436− put_unaligned_be16(reg, buf);
437− put_unaligned_be16(val, buf + 2);
438− buf[4] = crc8(hdc3020_crc8_table, buf + 2, 2, CRC8_INIT_VALUE);
439− return hdc3020_write_bytes(data, buf, 5);
600+ return _hdc3020_write_thresh(data, reg, reg_val);
440601 }
441602
442603 static int hdc3020_read_thresh(struct iio_dev *indio_dev,
@@ -447,48 +608,60 @@ static int hdc3020_read_thresh(struct iio_dev *indio_dev, · 4 unmodified lines
447608 int *val, int *val2)
448609 {
449610 struct hdc3020_data *data = iio_priv(indio_dev);
450− u16 reg;
451− int ret;
611+ u16 reg_thresh, reg_clr;
612+ int thresh, clr, ret;
452613
453− /* Select threshold register */
454− if (info == IIO_EV_INFO_VALUE) {
455− if (dir == IIO_EV_DIR_RISING)
456− reg = HDC3020_R_T_RH_THRESH_HIGH;
457− else
458− reg = HDC3020_R_T_RH_THRESH_LOW;
614+ /* Select threshold registers */
615+ if (dir == IIO_EV_DIR_RISING) {
616+ reg_thresh = HDC3020_R_T_RH_THRESH_HIGH;
617+ reg_clr = HDC3020_R_T_RH_THRESH_HIGH_CLR;
459618 } else {
460− if (dir == IIO_EV_DIR_RISING)
461− reg = HDC3020_R_T_RH_THRESH_HIGH_CLR;
462− else
463− reg = HDC3020_R_T_RH_THRESH_LOW_CLR;
619+ reg_thresh = HDC3020_R_T_RH_THRESH_LOW;
620+ reg_clr = HDC3020_R_T_RH_THRESH_LOW_CLR;
464621 }
465622
466623 guard(mutex)(&data->lock);
467− ret = hdc3020_read_be16(data, reg);
624+ ret = hdc3020_read_be16(data, reg_thresh);
468625 if (ret < 0)
469626 return ret;
470627
471628 switch (chan->type) {
472629 case IIO_TEMP:
473− /*
474− * Get the temperature threshold from 9 LSBs, shift them to get
475− * the truncated temperature threshold representation and
476− * calculate the threshold according to the formula in the
477− * datasheet.
478− */
479− *val = FIELD_GET(HDC3020_THRESH_TEMP_MASK, ret);
480− *val = *val << HDC3020_THRESH_TEMP_TRUNC_SHIFT;
481− *val = -2949075 + (175 * (*val));
630+ thresh = hdc3020_thresh_get_temp(ret);
631+ switch (info) {
632+ case IIO_EV_INFO_VALUE:
633+ *val = thresh;
634+ break;
635+ case IIO_EV_INFO_HYSTERESIS:
636+ ret = hdc3020_read_be16(data, reg_clr);
637+ if (ret < 0)
638+ return ret;
639+
640+ clr = hdc3020_thresh_get_temp(ret);
641+ *val = abs(thresh - clr);
642+ break;
643+ default:
644+ return -EOPNOTSUPP;
645+ }
482646 *val2 = 65535;
483647 return IIO_VAL_FRACTIONAL;
484648 case IIO_HUMIDITYRELATIVE:
485− /*
486− * Get the humidity threshold from 7 MSBs, shift them to get the
487− * truncated humidity threshold representation and calculate the
488− * threshold according to the formula in the datasheet.
489− */
490− *val = FIELD_GET(HDC3020_THRESH_HUM_MASK, ret);
491− *val = (*val << HDC3020_THRESH_HUM_TRUNC_SHIFT) * 100;
649+ thresh = hdc3020_thresh_get_hum(ret);
650+ switch (info) {
651+ case IIO_EV_INFO_VALUE:
652+ *val = thresh;
653+ break;
654+ case IIO_EV_INFO_HYSTERESIS:
655+ ret = hdc3020_read_be16(data, reg_clr);
656+ if (ret < 0)
657+ return ret;
658+
659+ clr = hdc3020_thresh_get_hum(ret);
660+ *val = abs(thresh - clr);
661+ break;
662+ default:
663+ return -EOPNOTSUPP;
664+ }
492665 *val2 = 65535;
493666 return IIO_VAL_FRACTIONAL;
494667 default:
drivers/iommu/amd/init.c+1−0
@@ -2743,6 +2743,7 @@ static void early_enable_iommu(struct amd_iommu *iommu) · 2742 unmodified lines
27432743 iommu_enable_command_buffer(iommu);
27442744 iommu_enable_event_buffer(iommu);
27452745 iommu_set_exclusion_range(iommu);
2746+ iommu_enable_gt(iommu);
27462747 iommu_enable_ga(iommu);
27472748 iommu_enable_xt(iommu);
27482749 iommu_enable_irtcachedis(iommu);
drivers/iommu/amd/iommu.c+6−6
@@ -2061,6 +2061,12 @@ static void do_detach(struct iommu_dev_data *dev_data) · 2060 unmodified lines
20612061 struct protection_domain *domain = dev_data->domain;
20622062 struct amd_iommu *iommu = get_amd_iommu_from_dev_data(dev_data);
20632063
2064+ /* Clear DTE and flush the entry */
2065+ amd_iommu_dev_update_dte(dev_data, false);
2066+
2067+ /* Flush IOTLB and wait for the flushes to finish */
2068+ amd_iommu_domain_flush_all(domain);
2069+
20642070 /* Clear GCR3 table */
20652071 if (pdom_is_sva_capable(domain))
20662072 destroy_gcr3_table(dev_data, domain);
@@ -2069,12 +2075,6 @@ static void do_detach(struct iommu_dev_data *dev_data) · 2 unmodified lines
20692075 dev_data->domain = NULL;
20702076 list_del(&dev_data->list);
20712077
2072− /* Clear DTE and flush the entry */
2073− amd_iommu_dev_update_dte(dev_data, false);
2074−
2075− /* Flush IOTLB and wait for the flushes to finish */
2076− amd_iommu_domain_flush_all(domain);
2077−
20782078 /* decrease reference counters - needs to happen after the flushes */
20792079 domain->dev_iommu[iommu->index] -= 1;
20802080 domain->dev_cnt -= 1;
drivers/iommu/intel/iommu.c+10−10
@@ -2114,12 +2114,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain, · 2113 unmodified lines
21142114 if (ret)
21152115 return ret;
21162116
2117− ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
2118− if (ret) {
2119− domain_detach_iommu(domain, iommu);
2120− return ret;
2121− }
2122−
21232117 info->domain = domain;
21242118 spin_lock_irqsave(&domain->lock, flags);
21252119 list_add(&info->link, &domain->devices);
@@ -2137,15 +2131,21 @@ static int dmar_domain_attach_device(struct dmar_domain *domain, · 11 unmodified lines
21372131 else
21382132 ret = intel_pasid_setup_second_level(iommu, domain, dev, IOMMU_NO_PASID);
21392133
2140− if (ret) {
2141− device_block_translation(dev);
2142− return ret;
2143− }
2134+ if (ret)
2135+ goto out_block_translation;
21442136
21452137 if (sm_supported(info->iommu) || !domain_type_is_si(info->domain))
21462138 iommu_enable_pci_caps(info);
21472139
2140+ ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
2141+ if (ret)
2142+ goto out_block_translation;
2143+
21482144 return 0;
2145+
2146+out_block_translation:
2147+ device_block_translation(dev);
2148+ return ret;
21492149 }
21502150
21512151 /**
drivers/irqchip/irq-loongson-eiointc.c+3−2
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/irqchip/chained_irq.h>
1616 #include <linux/kernel.h>
1717 #include <linux/syscore_ops.h>
18+#include <asm/numa.h>
1819
1920 #define EIOINTC_REG_NODEMAP 0x14a0
2021 #define EIOINTC_REG_IPMAP 0x14c0
@@ -339,7 +340,7 @@ static int __init pch_msi_parse_madt(union acpi_subtable_headers *header, · 318 unmodified lines
339340 int node;
340341
341342 if (cpu_has_flatmode)
342− node = cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NODE);
343+ node = early_cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NODE);
343344 else
344345 node = eiointc_priv[nr_pics - 1]->node;
345346
@@ -431,7 +432,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, · 85 unmodified lines
431432 goto out_free_handle;
432433
433434 if (cpu_has_flatmode)
434− node = cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE);
435+ node = early_cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE);
435436 else
436437 node = acpi_eiointc->node;
437438 acpi_set_vec_parent(node, priv->eiointc_domain, pch_group);
drivers/irqchip/irq-loongson-liointc.c+2−2
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828
2929 #define LIOINTC_INTC_CHIP_START 0x20
3030
31−#define LIOINTC_REG_INTC_STATUS (LIOINTC_INTC_CHIP_START + 0x20)
31+#define LIOINTC_REG_INTC_STATUS(core) (LIOINTC_INTC_CHIP_START + 0x20 + (core) * 8)
3232 #define LIOINTC_REG_INTC_EN_STATUS (LIOINTC_INTC_CHIP_START + 0x04)
3333 #define LIOINTC_REG_INTC_ENABLE (LIOINTC_INTC_CHIP_START + 0x08)
3434 #define LIOINTC_REG_INTC_DISABLE (LIOINTC_INTC_CHIP_START + 0x0c)
@@ -217,7 +217,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, · 182 unmodified lines
217217 goto out_free_priv;
218218
219219 for (i = 0; i < LIOINTC_NUM_CORES; i++)
220− priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS;
220+ priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS(i);
221221
222222 for (i = 0; i < LIOINTC_NUM_PARENT; i++)
223223 priv->handler[i].parent_int_map = parent_int_map[i];
drivers/media/pci/intel/ipu6/ipu6-isys-video.c+1−1
@@ -943,7 +943,7 @@ ipu6_isys_query_stream_by_source(struct ipu6_isys *isys, int source, u8 vc) · 942 unmodified lines
943943 return NULL;
944944
945945 if (source < 0) {
946− dev_err(&stream->isys->adev->auxdev.dev,
946+ dev_err(&isys->adev->auxdev.dev,
947947 "query stream with invalid port number\n");
948948 return NULL;
949949 }
drivers/media/pci/intel/ipu6/ipu6-isys.c+1−1
@@ -799,7 +799,7 @@ static int isys_register_devices(struct ipu6_isys *isys) · 798 unmodified lines
799799 isys->v4l2_dev.mdev = &isys->media_dev;
800800 isys->v4l2_dev.ctrl_handler = NULL;
801801
802− ret = v4l2_device_register(&pdev->dev, &isys->v4l2_dev);
802+ ret = v4l2_device_register(dev, &isys->v4l2_dev);
803803 if (ret < 0)
804804 goto out_media_device_unregister;
805805
drivers/media/pci/intel/ivsc/Kconfig+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 config INTEL_VSC
55 tristate "Intel Visual Sensing Controller"
66 depends on INTEL_MEI && ACPI && VIDEO_DEV
7+ depends on IPU_BRIDGE || !IPU_BRIDGE
78 select MEDIA_CONTROLLER
89 select VIDEO_V4L2_SUBDEV_API
910 select V4L2_FWNODE
drivers/mmc/host/moxart-mmc.c+43−35
@@ -131,10 +131,12 @@ struct moxart_host { · 130 unmodified lines
131131 struct dma_async_tx_descriptor *tx_desc;
132132 struct mmc_host *mmc;
133133 struct mmc_request *mrq;
134+ struct scatterlist *cur_sg;
134135 struct completion dma_complete;
135136 struct completion pio_complete;
136137
137− struct sg_mapping_iter sg_miter;
138+ u32 num_sg;
139+ u32 data_remain;
138140 u32 data_len;
139141 u32 fifo_width;
140142 u32 timeout;
@@ -146,6 +148,35 @@ struct moxart_host { · 5 unmodified lines
146148 bool is_removed;
147149 };
148150
151+static inline void moxart_init_sg(struct moxart_host *host,
152+ struct mmc_data *data)
153+{
154+ host->cur_sg = data->sg;
155+ host->num_sg = data->sg_len;
156+ host->data_remain = host->cur_sg->length;
157+
158+ if (host->data_remain > host->data_len)
159+ host->data_remain = host->data_len;
160+}
161+
162+static inline int moxart_next_sg(struct moxart_host *host)
163+{
164+ int remain;
165+ struct mmc_data *data = host->mrq->cmd->data;
166+
167+ host->cur_sg++;
168+ host->num_sg--;
169+
170+ if (host->num_sg > 0) {
171+ host->data_remain = host->cur_sg->length;
172+ remain = host->data_len - data->bytes_xfered;
173+ if (remain > 0 && remain < host->data_remain)
174+ host->data_remain = remain;
175+ }
176+
177+ return host->num_sg;
178+}
179+
149180 static int moxart_wait_for_status(struct moxart_host *host,
150181 u32 mask, u32 *status)
151182 {
@@ -278,29 +309,14 @@ static void moxart_transfer_dma(struct mmc_data *data, struct moxart_host *host) · 126 unmodified lines
278309
279310 static void moxart_transfer_pio(struct moxart_host *host)
280311 {
281− struct sg_mapping_iter *sgm = &host->sg_miter;
282312 struct mmc_data *data = host->mrq->cmd->data;
283313 u32 *sgp, len = 0, remain, status;
284314
285315 if (host->data_len == data->bytes_xfered)
286316 return;
287317
288− /*
289− * By updating sgm->consumes this will get a proper pointer into the
290− * buffer at any time.
291− */
292− if (!sg_miter_next(sgm)) {
293− /* This shold not happen */
294− dev_err(mmc_dev(host->mmc), "ran out of scatterlist prematurely\n");
295− data->error = -EINVAL;
296− complete(&host->pio_complete);
297− return;
298− }
299− sgp = sgm->addr;
300− remain = sgm->length;
301− if (remain > host->data_len)
302− remain = host->data_len;
303− sgm->consumed = 0;
318+ sgp = sg_virt(host->cur_sg);
319+ remain = host->data_remain;
304320
305321 if (data->flags & MMC_DATA_WRITE) {
306322 while (remain > 0) {
@@ -315,7 +331,6 @@ static void moxart_transfer_pio(struct moxart_host *host) · 8 unmodified lines
315331 sgp++;
316332 len += 4;
317333 }
318− sgm->consumed += len;
319334 remain -= len;
320335 }
321336
@@ -332,22 +347,22 @@ static void moxart_transfer_pio(struct moxart_host *host) · 10 unmodified lines
332347 sgp++;
333348 len += 4;
334349 }
335− sgm->consumed += len;
336350 remain -= len;
337351 }
338352 }
339353
340− data->bytes_xfered += sgm->consumed;
341− if (host->data_len == data->bytes_xfered) {
354+ data->bytes_xfered += host->data_remain - remain;
355+ host->data_remain = remain;
356+
357+ if (host->data_len != data->bytes_xfered)
358+ moxart_next_sg(host);
359+ else
342360 complete(&host->pio_complete);
343− return;
344− }
345361 }
346362
347363 static void moxart_prepare_data(struct moxart_host *host)
348364 {
349365 struct mmc_data *data = host->mrq->cmd->data;
350− unsigned int flags = SG_MITER_ATOMIC; /* Used from IRQ */
351366 u32 datactrl;
352367 int blksz_bits;
353368
@@ -358,19 +373,15 @@ static void moxart_prepare_data(struct moxart_host *host) · 4 unmodified lines
358373 blksz_bits = ffs(data->blksz) - 1;
359374 BUG_ON(1 << blksz_bits != data->blksz);
360375
376+ moxart_init_sg(host, data);
377+
361378 datactrl = DCR_DATA_EN | (blksz_bits & DCR_BLK_SIZE);
362379
363− if (data->flags & MMC_DATA_WRITE) {
364− flags |= SG_MITER_FROM_SG;
380+ if (data->flags & MMC_DATA_WRITE)
365381 datactrl |= DCR_DATA_WRITE;
366− } else {
367− flags |= SG_MITER_TO_SG;
368− }
369382
370383 if (moxart_use_dma(host))
371384 datactrl |= DCR_DMA_EN;
372− else
373− sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
374385
375386 writel(DCR_DATA_FIFO_RESET, host->base + REG_DATA_CONTROL);
376387 writel(MASK_DATA | FIFO_URUN | FIFO_ORUN, host->base + REG_CLEAR);
@@ -443,9 +454,6 @@ static void moxart_request(struct mmc_host *mmc, struct mmc_request *mrq) · 66 unmodified lines
443454 }
444455
445456 request_done:
446− if (!moxart_use_dma(host))
447− sg_miter_stop(&host->sg_miter);
448−
449457 spin_unlock_irqrestore(&host->lock, flags);
450458 mmc_request_done(host->mmc, mrq);
451459 }
drivers/mmc/host/sdhci-brcmstb.c+4−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #define BRCMSTB_MATCH_FLAGS_NO_64BIT BIT(0)
2525 #define BRCMSTB_MATCH_FLAGS_BROKEN_TIMEOUT BIT(1)
2626 #define BRCMSTB_MATCH_FLAGS_HAS_CLOCK_GATE BIT(2)
27+#define BRCMSTB_MATCH_FLAGS_USE_CARD_BUSY BIT(4)
2728
2829 #define BRCMSTB_PRIV_FLAGS_HAS_CQE BIT(0)
2930 #define BRCMSTB_PRIV_FLAGS_GATE_CLOCK BIT(1)
@@ -384,6 +385,9 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev) · 354 unmodified lines
384385 if (match_priv->flags & BRCMSTB_MATCH_FLAGS_BROKEN_TIMEOUT)
385386 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
386387
388+ if (!(match_priv->flags & BRCMSTB_MATCH_FLAGS_USE_CARD_BUSY))
389+ host->mmc_host_ops.card_busy = NULL;
390+
387391 /* Change the base clock frequency if the DT property exists */
388392 if (device_property_read_u32(&pdev->dev, "clock-frequency",
389393 &priv->base_freq_hz) != 0)
drivers/mmc/host/sdhci-pci-core.c+7−4
@@ -1326,7 +1326,7 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on) · 1325 unmodified lines
13261326
13271327 ret = pci_read_config_byte(chip->pdev, 0xAE, &scratch);
13281328 if (ret)
1329− return ret;
1329+ goto fail;
13301330
13311331 /*
13321332 * Turn PMOS on [bit 0], set over current detection to 2.4 V
@@ -1337,7 +1337,10 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on) · 4 unmodified lines
13371337 else
13381338 scratch &= ~0x47;
13391339
1340− return pci_write_config_byte(chip->pdev, 0xAE, scratch);
1340+ ret = pci_write_config_byte(chip->pdev, 0xAE, scratch);
1341+
1342+fail:
1343+ return pcibios_err_to_errno(ret);
13411344 }
13421345
13431346 static int jmicron_probe(struct sdhci_pci_chip *chip)
@@ -2202,7 +2205,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev, · 858 unmodified lines
22022205
22032206 ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
22042207 if (ret)
2205− return ret;
2208+ return pcibios_err_to_errno(ret);
22062209
22072210 slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
22082211 dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
@@ -2211,7 +2214,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev, · 2 unmodified lines
22112214
22122215 ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar);
22132216 if (ret)
2214− return ret;
2217+ return pcibios_err_to_errno(ret);
22152218
22162219 first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK;
22172220
drivers/mmc/host/sdhci-pci-o2micro.c+22−19
@@ -823,7 +823,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 822 unmodified lines
823823 ret = pci_read_config_byte(chip->pdev,
824824 O2_SD_LOCK_WP, &scratch);
825825 if (ret)
826− return ret;
826+ goto read_fail;
827827 scratch &= 0x7f;
828828 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
829829
@@ -834,7 +834,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 4 unmodified lines
834834 ret = pci_read_config_byte(chip->pdev,
835835 O2_SD_CLKREQ, &scratch);
836836 if (ret)
837− return ret;
837+ goto read_fail;
838838 scratch |= 0x20;
839839 pci_write_config_byte(chip->pdev, O2_SD_CLKREQ, scratch);
840840
@@ -843,7 +843,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 2 unmodified lines
843843 */
844844 ret = pci_read_config_byte(chip->pdev, O2_SD_CAPS, &scratch);
845845 if (ret)
846− return ret;
846+ goto read_fail;
847847 scratch |= 0x01;
848848 pci_write_config_byte(chip->pdev, O2_SD_CAPS, scratch);
849849 pci_write_config_byte(chip->pdev, O2_SD_CAPS, 0x73);
@@ -856,7 +856,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 6 unmodified lines
856856 ret = pci_read_config_byte(chip->pdev,
857857 O2_SD_INF_MOD, &scratch);
858858 if (ret)
859− return ret;
859+ goto read_fail;
860860 scratch |= 0x08;
861861 pci_write_config_byte(chip->pdev, O2_SD_INF_MOD, scratch);
862862
@@ -864,7 +864,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 1 unmodified line
864864 ret = pci_read_config_byte(chip->pdev,
865865 O2_SD_LOCK_WP, &scratch);
866866 if (ret)
867− return ret;
867+ goto read_fail;
868868 scratch |= 0x80;
869869 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
870870 break;
@@ -875,7 +875,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 4 unmodified lines
875875 ret = pci_read_config_byte(chip->pdev,
876876 O2_SD_LOCK_WP, &scratch);
877877 if (ret)
878− return ret;
878+ goto read_fail;
879879
880880 scratch &= 0x7f;
881881 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
@@ -886,7 +886,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 4 unmodified lines
886886 O2_SD_FUNC_REG0,
887887 &scratch_32);
888888 if (ret)
889− return ret;
889+ goto read_fail;
890890 scratch_32 = ((scratch_32 & 0xFF000000) >> 24);
891891
892892 /* Check Whether subId is 0x11 or 0x12 */
@@ -898,7 +898,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 5 unmodified lines
898898 O2_SD_FUNC_REG4,
899899 &scratch_32);
900900 if (ret)
901− return ret;
901+ goto read_fail;
902902
903903 /* Enable Base Clk setting change */
904904 scratch_32 |= O2_SD_FREG4_ENABLE_CLK_SET;
@@ -921,7 +921,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 16 unmodified lines
921921 ret = pci_read_config_dword(chip->pdev,
922922 O2_SD_CLK_SETTING, &scratch_32);
923923 if (ret)
924− return ret;
924+ goto read_fail;
925925
926926 scratch_32 &= ~(0xFF00);
927927 scratch_32 |= 0x07E0C800;
@@ -931,14 +931,14 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 3 unmodified lines
931931 ret = pci_read_config_dword(chip->pdev,
932932 O2_SD_CLKREQ, &scratch_32);
933933 if (ret)
934− return ret;
934+ goto read_fail;
935935 scratch_32 |= 0x3;
936936 pci_write_config_dword(chip->pdev, O2_SD_CLKREQ, scratch_32);
937937
938938 ret = pci_read_config_dword(chip->pdev,
939939 O2_SD_PLL_SETTING, &scratch_32);
940940 if (ret)
941− return ret;
941+ goto read_fail;
942942
943943 scratch_32 &= ~(0x1F3F070E);
944944 scratch_32 |= 0x18270106;
@@ -949,7 +949,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 4 unmodified lines
949949 ret = pci_read_config_dword(chip->pdev,
950950 O2_SD_CAP_REG2, &scratch_32);
951951 if (ret)
952− return ret;
952+ goto read_fail;
953953 scratch_32 &= ~(0xE0);
954954 pci_write_config_dword(chip->pdev,
955955 O2_SD_CAP_REG2, scratch_32);
@@ -961,7 +961,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 5 unmodified lines
961961 ret = pci_read_config_byte(chip->pdev,
962962 O2_SD_LOCK_WP, &scratch);
963963 if (ret)
964− return ret;
964+ goto read_fail;
965965 scratch |= 0x80;
966966 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
967967 break;
@@ -971,7 +971,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 3 unmodified lines
971971 ret = pci_read_config_byte(chip->pdev,
972972 O2_SD_LOCK_WP, &scratch);
973973 if (ret)
974− return ret;
974+ goto read_fail;
975975
976976 scratch &= 0x7f;
977977 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
@@ -979,7 +979,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 1 unmodified line
979979 ret = pci_read_config_dword(chip->pdev,
980980 O2_SD_PLL_SETTING, &scratch_32);
981981 if (ret)
982− return ret;
982+ goto read_fail;
983983
984984 if ((scratch_32 & 0xff000000) == 0x01000000) {
985985 scratch_32 &= 0x0000FFFF;
@@ -998,7 +998,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 12 unmodified lines
998998 O2_SD_FUNC_REG4,
999999 &scratch_32);
10001000 if (ret)
1001− return ret;
1001+ goto read_fail;
10021002 scratch_32 |= (1 << 22);
10031003 pci_write_config_dword(chip->pdev,
10041004 O2_SD_FUNC_REG4, scratch_32);
@@ -1017,7 +1017,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 12 unmodified lines
10171017 ret = pci_read_config_byte(chip->pdev,
10181018 O2_SD_LOCK_WP, &scratch);
10191019 if (ret)
1020− return ret;
1020+ goto read_fail;
10211021 scratch |= 0x80;
10221022 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
10231023 break;
@@ -1028,7 +1028,7 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 4 unmodified lines
10281028 /* UnLock WP */
10291029 ret = pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch);
10301030 if (ret)
1031− return ret;
1031+ goto read_fail;
10321032 scratch &= 0x7f;
10331033 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
10341034
@@ -1057,13 +1057,16 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 22 unmodified lines
10571057 /* Lock WP */
10581058 ret = pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch);
10591059 if (ret)
1060− return ret;
1060+ goto read_fail;
10611061 scratch |= 0x80;
10621062 pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
10631063 break;
10641064 }
10651065
10661066 return 0;
1067+
1068+read_fail:
1069+ return pcibios_err_to_errno(ret);
10671070 }
10681071
10691072 #ifdef CONFIG_PM_SLEEP
drivers/mmc/host/sdhci.c+14−11
@@ -2515,26 +2515,29 @@ EXPORT_SYMBOL_GPL(sdhci_get_cd_nogpio); · 2514 unmodified lines
25152515
25162516 static int sdhci_check_ro(struct sdhci_host *host)
25172517 {
2518− unsigned long flags;
2518+ bool allow_invert = false;
25192519 int is_readonly;
25202520
2521− spin_lock_irqsave(&host->lock, flags);
2522−
2523− if (host->flags & SDHCI_DEVICE_DEAD)
2521+ if (host->flags & SDHCI_DEVICE_DEAD) {
25242522 is_readonly = 0;
2525− else if (host->ops->get_ro)
2523+ } else if (host->ops->get_ro) {
25262524 is_readonly = host->ops->get_ro(host);
2527− else if (mmc_can_gpio_ro(host->mmc))
2525+ } else if (mmc_can_gpio_ro(host->mmc)) {
25282526 is_readonly = mmc_gpio_get_ro(host->mmc);
2529− else
2527+ /* Do not invert twice */
2528+ allow_invert = !(host->mmc->caps2 & MMC_CAP2_RO_ACTIVE_HIGH);
2529+ } else {
25302530 is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE)
25312531 & SDHCI_WRITE_PROTECT);
2532+ allow_invert = true;
2533+ }
25322534
2533− spin_unlock_irqrestore(&host->lock, flags);
2535+ if (is_readonly >= 0 &&
2536+ allow_invert &&
2537+ (host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT))
2538+ is_readonly = !is_readonly;
25342539
2535− /* This quirk needs to be replaced by a callback-function later */
2536− return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ?
2537− !is_readonly : is_readonly;
2540+ return is_readonly;
25382541 }
25392542
25402543 #define SAMPLE_COUNT 5
drivers/mtd/nand/raw/nand_base.c+40−26
@@ -1093,28 +1093,32 @@ static int nand_fill_column_cycles(struct nand_chip *chip, u8 *addrs, · 1092 unmodified lines
10931093 unsigned int offset_in_page)
10941094 {
10951095 struct mtd_info *mtd = nand_to_mtd(chip);
1096+ bool ident_stage = !mtd->writesize;
10961097
1097− /* Make sure the offset is less than the actual page size. */
1098− if (offset_in_page > mtd->writesize + mtd->oobsize)
1099− return -EINVAL;
1098+ /* Bypass all checks during NAND identification */
1099+ if (likely(!ident_stage)) {
1100+ /* Make sure the offset is less than the actual page size. */
1101+ if (offset_in_page > mtd->writesize + mtd->oobsize)
1102+ return -EINVAL;
11001103
1101− /*
1102− * On small page NANDs, there's a dedicated command to access the OOB
1103− * area, and the column address is relative to the start of the OOB
1104− * area, not the start of the page. Asjust the address accordingly.
1105− */
1106− if (mtd->writesize <= 512 && offset_in_page >= mtd->writesize)
1107− offset_in_page -= mtd->writesize;
1104+ /*
1105+ * On small page NANDs, there's a dedicated command to access the OOB
1106+ * area, and the column address is relative to the start of the OOB
1107+ * area, not the start of the page. Asjust the address accordingly.
1108+ */
1109+ if (mtd->writesize <= 512 && offset_in_page >= mtd->writesize)
1110+ offset_in_page -= mtd->writesize;
11081111
1109− /*
1110− * The offset in page is expressed in bytes, if the NAND bus is 16-bit
1111− * wide, then it must be divided by 2.
1112− */
1113− if (chip->options & NAND_BUSWIDTH_16) {
1114− if (WARN_ON(offset_in_page % 2))
1115− return -EINVAL;
1112+ /*
1113+ * The offset in page is expressed in bytes, if the NAND bus is 16-bit
1114+ * wide, then it must be divided by 2.
1115+ */
1116+ if (chip->options & NAND_BUSWIDTH_16) {
1117+ if (WARN_ON(offset_in_page % 2))
1118+ return -EINVAL;
11161119
1117− offset_in_page /= 2;
1120+ offset_in_page /= 2;
1121+ }
11181122 }
11191123
11201124 addrs[0] = offset_in_page;
@@ -1123,7 +1127,7 @@ static int nand_fill_column_cycles(struct nand_chip *chip, u8 *addrs, · 2 unmodified lines
11231127 * Small page NANDs use 1 cycle for the columns, while large page NANDs
11241128 * need 2
11251129 */
1126− if (mtd->writesize <= 512)
1130+ if (!ident_stage && mtd->writesize <= 512)
11271131 return 1;
11281132
11291133 addrs[1] = offset_in_page >> 8;
@@ -1436,16 +1440,19 @@ int nand_change_read_column_op(struct nand_chip *chip, · 306 unmodified lines
14361440 unsigned int len, bool force_8bit)
14371441 {
14381442 struct mtd_info *mtd = nand_to_mtd(chip);
1443+ bool ident_stage = !mtd->writesize;
14391444
14401445 if (len && !buf)
14411446 return -EINVAL;
14421447
1443− if (offset_in_page + len > mtd->writesize + mtd->oobsize)
1444− return -EINVAL;
1448+ if (!ident_stage) {
1449+ if (offset_in_page + len > mtd->writesize + mtd->oobsize)
1450+ return -EINVAL;
14451451
1446− /* Small page NANDs do not support column change. */
1447− if (mtd->writesize <= 512)
1448− return -ENOTSUPP;
1452+ /* Small page NANDs do not support column change. */
1453+ if (mtd->writesize <= 512)
1454+ return -ENOTSUPP;
1455+ }
14491456
14501457 if (nand_has_exec_op(chip)) {
14511458 const struct nand_interface_config *conf =
@@ -2173,7 +2180,7 @@ EXPORT_SYMBOL_GPL(nand_reset_op); · 721 unmodified lines
21732180 int nand_read_data_op(struct nand_chip *chip, void *buf, unsigned int len,
21742181 bool force_8bit, bool check_only)
21752182 {
2176− if (!len || !buf)
2183+ if (!len || (!check_only && !buf))
21772184 return -EINVAL;
21782185
21792186 if (nand_has_exec_op(chip)) {
@@ -6301,6 +6308,7 @@ static const struct nand_ops rawnand_ops = { · 4121 unmodified lines
63016308 static int nand_scan_tail(struct nand_chip *chip)
63026309 {
63036310 struct mtd_info *mtd = nand_to_mtd(chip);
6311+ struct nand_device *base = &chip->base;
63046312 struct nand_ecc_ctrl *ecc = &chip->ecc;
63056313 int ret, i;
63066314
@@ -6445,9 +6453,13 @@ static int nand_scan_tail(struct nand_chip *chip) · 138 unmodified lines
64456453 if (!ecc->write_oob_raw)
64466454 ecc->write_oob_raw = ecc->write_oob;
64476455
6448− /* propagate ecc info to mtd_info */
6456+ /* Propagate ECC info to the generic NAND and MTD layers */
64496457 mtd->ecc_strength = ecc->strength;
6458+ if (!base->ecc.ctx.conf.strength)
6459+ base->ecc.ctx.conf.strength = ecc->strength;
64506460 mtd->ecc_step_size = ecc->size;
6461+ if (!base->ecc.ctx.conf.step_size)
6462+ base->ecc.ctx.conf.step_size = ecc->size;
64516463
64526464 /*
64536465 * Set the number of read / write steps for one page depending on ECC
@@ -6455,6 +6467,8 @@ static int nand_scan_tail(struct nand_chip *chip) · 1 unmodified line
64556467 */
64566468 if (!ecc->steps)
64576469 ecc->steps = mtd->writesize / ecc->size;
6470+ if (!base->ecc.ctx.nsteps)
6471+ base->ecc.ctx.nsteps = ecc->steps;
64586472 if (ecc->steps * ecc->size != mtd->writesize) {
64596473 WARN(1, "Invalid ECC parameters\n");
64606474 ret = -EINVAL;
drivers/mtd/nand/raw/rockchip-nand-controller.c+3−3
@@ -420,13 +420,13 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target, · 419 unmodified lines
420420 u32 rate, tc2rw, trwpw, trw2c;
421421 u32 temp;
422422
423− if (target < 0)
424− return 0;
425−
426423 timings = nand_get_sdr_timings(conf);
427424 if (IS_ERR(timings))
428425 return -EOPNOTSUPP;
429426
427+ if (target < 0)
428+ return 0;
429+
430430 if (IS_ERR(nfc->nfc_clk))
431431 rate = clk_get_rate(nfc->ahb_clk);
432432 else
drivers/net/bonding/bond_options.c+3−3
@@ -1214,9 +1214,9 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, · 1213 unmodified lines
12141214 __be32 target;
12151215
12161216 if (newval->string) {
1217− if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) {
1218− netdev_err(bond->dev, "invalid ARP target %pI4 specified\n",
1219− &target);
1217+ if (strlen(newval->string) < 1 ||
1218+ !in4_pton(newval->string + 1, -1, (u8 *)&target, -1, NULL)) {
1219+ netdev_err(bond->dev, "invalid ARP target specified\n");
12201220 return ret;
12211221 }
12221222 if (newval->string[0] == '+')
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+1−0
@@ -128,6 +128,7 @@ static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leaf_err_liste · 127 unmodified lines
128128
129129 static const struct kvaser_usb_driver_info kvaser_usb_driver_info_leafimx = {
130130 .quirks = 0,
131+ .family = KVASER_LEAF,
131132 .ops = &kvaser_usb_leaf_dev_ops,
132133 };
133134
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+1−1
@@ -1262,7 +1262,7 @@ enum { · 1261 unmodified lines
12621262
12631263 struct bnx2x_fw_stats_req {
12641264 struct stats_query_header hdr;
1265− struct stats_query_entry query[FP_SB_MAX_E1x+
1265+ struct stats_query_entry query[FP_SB_MAX_E2 +
12661266 BNX2X_FIRST_QUEUE_QUERY_IDX];
12671267 };
12681268
drivers/net/ethernet/broadcom/bnxt/bnxt.c+5−1
@@ -12851,7 +12851,11 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx) · 12850 unmodified lines
1285112851 if (!BNXT_NEW_RM(bp))
1285212852 return true;
1285312853
12854− if (hwr.vnic == bp->hw_resc.resv_vnics &&
12854+ /* Do not reduce VNIC and RSS ctx reservations. There is a FW
12855+ * issue that will mess up the default VNIC if we reduce the
12856+ * reservations.
12857+ */
12858+ if (hwr.vnic <= bp->hw_resc.resv_vnics &&
1285512859 hwr.rss_ctx <= bp->hw_resc.resv_rsscos_ctxs)
1285612860 return true;
1285712861
drivers/net/ethernet/intel/e1000e/netdev.c+66−66
@@ -6363,49 +6363,49 @@ static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter) · 6362 unmodified lines
63636363 mac_data |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
63646364 ew32(EXTCNF_CTRL, mac_data);
63656365
6366− /* Enable the Dynamic Power Gating in the MAC */
6367− mac_data = er32(FEXTNVM7);
6368− mac_data |= BIT(22);
6369− ew32(FEXTNVM7, mac_data);
6370−
63716366 /* Disable disconnected cable conditioning for Power Gating */
63726367 mac_data = er32(DPGFR);
63736368 mac_data |= BIT(2);
63746369 ew32(DPGFR, mac_data);
63756370
6376− /* Don't wake from dynamic Power Gating with clock request */
6377− mac_data = er32(FEXTNVM12);
6378− mac_data |= BIT(12);
6379− ew32(FEXTNVM12, mac_data);
6380−
6381− /* Ungate PGCB clock */
6382− mac_data = er32(FEXTNVM9);
6383− mac_data &= ~BIT(28);
6384− ew32(FEXTNVM9, mac_data);
6385−
6386− /* Enable K1 off to enable mPHY Power Gating */
6387− mac_data = er32(FEXTNVM6);
6388− mac_data |= BIT(31);
6389− ew32(FEXTNVM6, mac_data);
6390−
6391− /* Enable mPHY power gating for any link and speed */
6392− mac_data = er32(FEXTNVM8);
6393− mac_data |= BIT(9);
6394− ew32(FEXTNVM8, mac_data);
6395−
63966371 /* Enable the Dynamic Clock Gating in the DMA and MAC */
63976372 mac_data = er32(CTRL_EXT);
63986373 mac_data |= E1000_CTRL_EXT_DMA_DYN_CLK_EN;
63996374 ew32(CTRL_EXT, mac_data);
6400−
6401− /* No MAC DPG gating SLP_S0 in modern standby
6402− * Switch the logic of the lanphypc to use PMC counter
6403− */
6404− mac_data = er32(FEXTNVM5);
6405− mac_data |= BIT(7);
6406− ew32(FEXTNVM5, mac_data);
64076375 }
64086376
6377+ /* Enable the Dynamic Power Gating in the MAC */
6378+ mac_data = er32(FEXTNVM7);
6379+ mac_data |= BIT(22);
6380+ ew32(FEXTNVM7, mac_data);
6381+
6382+ /* Don't wake from dynamic Power Gating with clock request */
6383+ mac_data = er32(FEXTNVM12);
6384+ mac_data |= BIT(12);
6385+ ew32(FEXTNVM12, mac_data);
6386+
6387+ /* Ungate PGCB clock */
6388+ mac_data = er32(FEXTNVM9);
6389+ mac_data &= ~BIT(28);
6390+ ew32(FEXTNVM9, mac_data);
6391+
6392+ /* Enable K1 off to enable mPHY Power Gating */
6393+ mac_data = er32(FEXTNVM6);
6394+ mac_data |= BIT(31);
6395+ ew32(FEXTNVM6, mac_data);
6396+
6397+ /* Enable mPHY power gating for any link and speed */
6398+ mac_data = er32(FEXTNVM8);
6399+ mac_data |= BIT(9);
6400+ ew32(FEXTNVM8, mac_data);
6401+
6402+ /* No MAC DPG gating SLP_S0 in modern standby
6403+ * Switch the logic of the lanphypc to use PMC counter
6404+ */
6405+ mac_data = er32(FEXTNVM5);
6406+ mac_data |= BIT(7);
6407+ ew32(FEXTNVM5, mac_data);
6408+
64096409 /* Disable the time synchronization clock */
64106410 mac_data = er32(FEXTNVM7);
64116411 mac_data |= BIT(31);
@@ -6498,33 +6498,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) · 86 unmodified lines
64986498 } else {
64996499 /* Request driver unconfigure the device from S0ix */
65006500
6501− /* Disable the Dynamic Power Gating in the MAC */
6502− mac_data = er32(FEXTNVM7);
6503− mac_data &= 0xFFBFFFFF;
6504− ew32(FEXTNVM7, mac_data);
6505−
6506− /* Disable mPHY power gating for any link and speed */
6507− mac_data = er32(FEXTNVM8);
6508− mac_data &= ~BIT(9);
6509− ew32(FEXTNVM8, mac_data);
6510−
6511− /* Disable K1 off */
6512− mac_data = er32(FEXTNVM6);
6513− mac_data &= ~BIT(31);
6514− ew32(FEXTNVM6, mac_data);
6515−
6516− /* Disable Ungate PGCB clock */
6517− mac_data = er32(FEXTNVM9);
6518− mac_data |= BIT(28);
6519− ew32(FEXTNVM9, mac_data);
6520−
6521− /* Cancel not waking from dynamic
6522− * Power Gating with clock request
6523− */
6524− mac_data = er32(FEXTNVM12);
6525− mac_data &= ~BIT(12);
6526− ew32(FEXTNVM12, mac_data);
6527−
65286501 /* Cancel disable disconnected cable conditioning
65296502 * for Power Gating
65306503 */
@@ -6537,13 +6510,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) · 6 unmodified lines
65376510 mac_data &= 0xFFF7FFFF;
65386511 ew32(CTRL_EXT, mac_data);
65396512
6540− /* Revert the lanphypc logic to use the internal Gbe counter
6541− * and not the PMC counter
6542− */
6543− mac_data = er32(FEXTNVM5);
6544− mac_data &= 0xFFFFFF7F;
6545− ew32(FEXTNVM5, mac_data);
6546−
65476513 /* Enable the periodic inband message,
65486514 * Request PCIe clock in K1 page770_17[10:9] =01b
65496515 */
@@ -6581,6 +6547,40 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter) · 31 unmodified lines
65816547 mac_data &= ~BIT(31);
65826548 mac_data |= BIT(0);
65836549 ew32(FEXTNVM7, mac_data);
6550+
6551+ /* Disable the Dynamic Power Gating in the MAC */
6552+ mac_data = er32(FEXTNVM7);
6553+ mac_data &= 0xFFBFFFFF;
6554+ ew32(FEXTNVM7, mac_data);
6555+
6556+ /* Disable mPHY power gating for any link and speed */
6557+ mac_data = er32(FEXTNVM8);
6558+ mac_data &= ~BIT(9);
6559+ ew32(FEXTNVM8, mac_data);
6560+
6561+ /* Disable K1 off */
6562+ mac_data = er32(FEXTNVM6);
6563+ mac_data &= ~BIT(31);
6564+ ew32(FEXTNVM6, mac_data);
6565+
6566+ /* Disable Ungate PGCB clock */
6567+ mac_data = er32(FEXTNVM9);
6568+ mac_data |= BIT(28);
6569+ ew32(FEXTNVM9, mac_data);
6570+
6571+ /* Cancel not waking from dynamic
6572+ * Power Gating with clock request
6573+ */
6574+ mac_data = er32(FEXTNVM12);
6575+ mac_data &= ~BIT(12);
6576+ ew32(FEXTNVM12, mac_data);
6577+
6578+ /* Revert the lanphypc logic to use the internal Gbe counter
6579+ * and not the PMC counter
6580+ */
6581+ mac_data = er32(FEXTNVM5);
6582+ mac_data &= 0xFFFFFF7F;
6583+ ew32(FEXTNVM5, mac_data);
65846584 }
65856585
65866586 static int e1000e_pm_freeze(struct device *dev)
drivers/net/ethernet/intel/ice/ice_hwmon.c+1−1
@@ -96,7 +96,7 @@ static bool ice_is_internal_reading_supported(struct ice_pf *pf) · 95 unmodified lines
9696
9797 unsigned long sensors = pf->hw.dev_caps.supported_sensors;
9898
99− return _test_bit(ICE_SENSOR_SUPPORT_E810_INT_TEMP_BIT, &sensors);
99+ return test_bit(ICE_SENSOR_SUPPORT_E810_INT_TEMP_BIT, &sensors);
100100 };
101101
102102 void ice_hwmon_init(struct ice_pf *pf)
drivers/net/ethernet/intel/ice/ice_ptp.c+101−30
@@ -1618,6 +1618,10 @@ void ice_ptp_extts_event(struct ice_pf *pf) · 1617 unmodified lines
16181618 u8 chan, tmr_idx;
16191619 u32 hi, lo;
16201620
1621+ /* Don't process timestamp events if PTP is not ready */
1622+ if (pf->ptp.state != ICE_PTP_READY)
1623+ return;
1624+
16211625 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;
16221626 /* Event time is captured by one of the two matched registers
16231627 * GLTSYN_EVNT_L: 32 LSB of sampled time event
@@ -1643,27 +1647,33 @@ void ice_ptp_extts_event(struct ice_pf *pf) · 19 unmodified lines
16431647 /**
16441648 * ice_ptp_cfg_extts - Configure EXTTS pin and channel
16451649 * @pf: Board private structure
1646− * @ena: true to enable; false to disable
16471650 * @chan: GPIO channel (0-3)
1648− * @gpio_pin: GPIO pin
1649− * @extts_flags: request flags from the ptp_extts_request.flags
1651+ * @config: desired EXTTS configuration.
1652+ * @store: If set to true, the values will be stored
1653+ *
1654+ * Configure an external timestamp event on the requested channel.
1655+ *
1656+ * Return: 0 on success, -EOPNOTUSPP on unsupported flags
16501657 */
1651−static int
1652−ice_ptp_cfg_extts(struct ice_pf *pf, bool ena, unsigned int chan, u32 gpio_pin,
1653− unsigned int extts_flags)
1658+static int ice_ptp_cfg_extts(struct ice_pf *pf, unsigned int chan,
1659+ struct ice_extts_channel *config, bool store)
16541660 {
16551661 u32 func, aux_reg, gpio_reg, irq_reg;
16561662 struct ice_hw *hw = &pf->hw;
16571663 u8 tmr_idx;
16581664
1659− if (chan > (unsigned int)pf->ptp.info.n_ext_ts)
1660− return -EINVAL;
1665+ /* Reject requests with unsupported flags */
1666+ if (config->flags & ~(PTP_ENABLE_FEATURE |
1667+ PTP_RISING_EDGE |
1668+ PTP_FALLING_EDGE |
1669+ PTP_STRICT_FLAGS))
1670+ return -EOPNOTSUPP;
16611671
16621672 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;
16631673
16641674 irq_reg = rd32(hw, PFINT_OICR_ENA);
16651675
1666− if (ena) {
1676+ if (config->ena) {
16671677 /* Enable the interrupt */
16681678 irq_reg |= PFINT_OICR_TSYN_EVNT_M;
16691679 aux_reg = GLTSYN_AUX_IN_0_INT_ENA_M;
@@ -1672,9 +1682,9 @@ ice_ptp_cfg_extts(struct ice_pf *pf, bool ena, unsigned int chan, u32 gpio_pin, · 2 unmodified lines
16721682 #define GLTSYN_AUX_IN_0_EVNTLVL_FALLING_EDGE BIT(1)
16731683
16741684 /* set event level to requested edge */
1675− if (extts_flags & PTP_FALLING_EDGE)
1685+ if (config->flags & PTP_FALLING_EDGE)
16761686 aux_reg |= GLTSYN_AUX_IN_0_EVNTLVL_FALLING_EDGE;
1677− if (extts_flags & PTP_RISING_EDGE)
1687+ if (config->flags & PTP_RISING_EDGE)
16781688 aux_reg |= GLTSYN_AUX_IN_0_EVNTLVL_RISING_EDGE;
16791689
16801690 /* Write GPIO CTL reg.
@@ -1695,11 +1705,51 @@ ice_ptp_cfg_extts(struct ice_pf *pf, bool ena, unsigned int chan, u32 gpio_pin, · 14 unmodified lines
16951705
16961706 wr32(hw, PFINT_OICR_ENA, irq_reg);
16971707 wr32(hw, GLTSYN_AUX_IN(chan, tmr_idx), aux_reg);
1698− wr32(hw, GLGEN_GPIO_CTL(gpio_pin), gpio_reg);
1708+ wr32(hw, GLGEN_GPIO_CTL(config->gpio_pin), gpio_reg);
1709+
1710+ if (store)
1711+ memcpy(&pf->ptp.extts_channels[chan], config, sizeof(*config));
16991712
17001713 return 0;
17011714 }
17021715
1716+/**
1717+ * ice_ptp_disable_all_extts - Disable all EXTTS channels
1718+ * @pf: Board private structure
1719+ */
1720+static void ice_ptp_disable_all_extts(struct ice_pf *pf)
1721+{
1722+ struct ice_extts_channel extts_cfg = {};
1723+ int i;
1724+
1725+ for (i = 0; i < pf->ptp.info.n_ext_ts; i++) {
1726+ if (pf->ptp.extts_channels[i].ena) {
1727+ extts_cfg.gpio_pin = pf->ptp.extts_channels[i].gpio_pin;
1728+ extts_cfg.ena = false;
1729+ ice_ptp_cfg_extts(pf, i, &extts_cfg, false);
1730+ }
1731+ }
1732+
1733+ synchronize_irq(pf->oicr_irq.virq);
1734+}
1735+
1736+/**
1737+ * ice_ptp_enable_all_extts - Enable all EXTTS channels
1738+ * @pf: Board private structure
1739+ *
1740+ * Called during reset to restore user configuration.
1741+ */
1742+static void ice_ptp_enable_all_extts(struct ice_pf *pf)
1743+{
1744+ int i;
1745+
1746+ for (i = 0; i < pf->ptp.info.n_ext_ts; i++) {
1747+ if (pf->ptp.extts_channels[i].ena)
1748+ ice_ptp_cfg_extts(pf, i, &pf->ptp.extts_channels[i],
1749+ false);
1750+ }
1751+}
1752+
17031753 /**
17041754 * ice_ptp_cfg_clkout - Configure clock to generate periodic wave
17051755 * @pf: Board private structure
@@ -1718,6 +1768,9 @@ static int ice_ptp_cfg_clkout(struct ice_pf *pf, unsigned int chan, · 12 unmodified lines
17181768 u32 func, val, gpio_pin;
17191769 u8 tmr_idx;
17201770
1771+ if (config && config->flags & ~PTP_PEROUT_PHASE)
1772+ return -EOPNOTSUPP;
1773+
17211774 tmr_idx = hw->func_caps.ts_func_info.tmr_index_owned;
17221775
17231776 /* 0. Reset mode & out_en in AUX_OUT */
@@ -1853,17 +1906,18 @@ ice_ptp_gpio_enable_e810(struct ptp_clock_info *info, · 129 unmodified lines
18531906 struct ptp_clock_request *rq, int on)
18541907 {
18551908 struct ice_pf *pf = ptp_info_to_pf(info);
1856− struct ice_perout_channel clk_cfg = {0};
18571909 bool sma_pres = false;
18581910 unsigned int chan;
18591911 u32 gpio_pin;
1860− int err;
18611912
18621913 if (ice_is_feature_supported(pf, ICE_F_SMA_CTRL))
18631914 sma_pres = true;
18641915
18651916 switch (rq->type) {
18661917 case PTP_CLK_REQ_PEROUT:
1918+ {
1919+ struct ice_perout_channel clk_cfg = {};
1920+
18671921 chan = rq->perout.index;
18681922 if (sma_pres) {
18691923 if (chan == ice_pin_desc_e810t[SMA1].chan)
@@ -1883,15 +1937,19 @@ ice_ptp_gpio_enable_e810(struct ptp_clock_info *info, · 13 unmodified lines
18831937 clk_cfg.gpio_pin = chan;
18841938 }
18851939
1940+ clk_cfg.flags = rq->perout.flags;
18861941 clk_cfg.period = ((rq->perout.period.sec * NSEC_PER_SEC) +
18871942 rq->perout.period.nsec);
18881943 clk_cfg.start_time = ((rq->perout.start.sec * NSEC_PER_SEC) +
18891944 rq->perout.start.nsec);
18901945 clk_cfg.ena = !!on;
18911946
1892− err = ice_ptp_cfg_clkout(pf, chan, &clk_cfg, true);
1893− break;
1947+ return ice_ptp_cfg_clkout(pf, chan, &clk_cfg, true);
1948+ }
18941949 case PTP_CLK_REQ_EXTTS:
1950+ {
1951+ struct ice_extts_channel extts_cfg = {};
1952+
18951953 chan = rq->extts.index;
18961954 if (sma_pres) {
18971955 if (chan < ice_pin_desc_e810t[SMA2].chan)
@@ -1907,14 +1965,15 @@ ice_ptp_gpio_enable_e810(struct ptp_clock_info *info, · 9 unmodified lines
19071965 gpio_pin = chan;
19081966 }
19091967
1910− err = ice_ptp_cfg_extts(pf, !!on, chan, gpio_pin,
1911− rq->extts.flags);
1912− break;
1968+ extts_cfg.flags = rq->extts.flags;
1969+ extts_cfg.gpio_pin = gpio_pin;
1970+ extts_cfg.ena = !!on;
1971+
1972+ return ice_ptp_cfg_extts(pf, chan, &extts_cfg, true);
1973+ }
19131974 default:
19141975 return -EOPNOTSUPP;
19151976 }
1916−
1917− return err;
19181977 }
19191978
19201979 /**
@@ -1927,26 +1986,32 @@ static int ice_ptp_gpio_enable_e823(struct ptp_clock_info *info, · 6 unmodified lines
19271986 struct ptp_clock_request *rq, int on)
19281987 {
19291988 struct ice_pf *pf = ptp_info_to_pf(info);
1930− struct ice_perout_channel clk_cfg = {0};
1931− int err;
19321989
19331990 switch (rq->type) {
19341991 case PTP_CLK_REQ_PPS:
1992+ {
1993+ struct ice_perout_channel clk_cfg = {};
1994+
1995+ clk_cfg.flags = rq->perout.flags;
19351996 clk_cfg.gpio_pin = PPS_PIN_INDEX;
19361997 clk_cfg.period = NSEC_PER_SEC;
19371998 clk_cfg.ena = !!on;
19381999
1939− err = ice_ptp_cfg_clkout(pf, PPS_CLK_GEN_CHAN, &clk_cfg, true);
1940− break;
2000+ return ice_ptp_cfg_clkout(pf, PPS_CLK_GEN_CHAN, &clk_cfg, true);
2001+ }
19412002 case PTP_CLK_REQ_EXTTS:
1942− err = ice_ptp_cfg_extts(pf, !!on, rq->extts.index,
1943− TIME_SYNC_PIN_INDEX, rq->extts.flags);
1944− break;
2003+ {
2004+ struct ice_extts_channel extts_cfg = {};
2005+
2006+ extts_cfg.flags = rq->extts.flags;
2007+ extts_cfg.gpio_pin = TIME_SYNC_PIN_INDEX;
2008+ extts_cfg.ena = !!on;
2009+
2010+ return ice_ptp_cfg_extts(pf, rq->extts.index, &extts_cfg, true);
2011+ }
19452012 default:
19462013 return -EOPNOTSUPP;
19472014 }
1948−
1949− return err;
19502015 }
19512016
19522017 /**
@@ -2781,6 +2846,10 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf) · 828 unmodified lines
27812846 ice_ptp_restart_all_phy(pf);
27822847 }
27832848
2849+ /* Re-enable all periodic outputs and external timestamp events */
2850+ ice_ptp_enable_all_clkout(pf);
2851+ ice_ptp_enable_all_extts(pf);
2852+
27842853 return 0;
27852854 }
27862855
@@ -3340,6 +3409,8 @@ void ice_ptp_release(struct ice_pf *pf) · 553 unmodified lines
33403409
33413410 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx);
33423411
3412+ ice_ptp_disable_all_extts(pf);
3413+
33433414 kthread_cancel_delayed_work_sync(&pf->ptp.work);
33443415
33453416 ice_ptp_port_phy_stop(&pf->ptp.port);
drivers/net/ethernet/intel/ice/ice_ptp.h+9−0
@@ -29,10 +29,17 @@ enum ice_ptp_pin_e810t { · 28 unmodified lines
2929 struct ice_perout_channel {
3030 bool ena;
3131 u32 gpio_pin;
32+ u32 flags;
3233 u64 period;
3334 u64 start_time;
3435 };
3536
37+struct ice_extts_channel {
38+ bool ena;
39+ u32 gpio_pin;
40+ u32 flags;
41+};
42+
3643 /* The ice hardware captures Tx hardware timestamps in the PHY. The timestamp
3744 * is stored in a buffer of registers. Depending on the specific hardware,
3845 * this buffer might be shared across multiple PHY ports.
@@ -227,6 +234,7 @@ enum ice_ptp_state { · 188 unmodified lines
227234 * @ext_ts_irq: the external timestamp IRQ in use
228235 * @kworker: kwork thread for handling periodic work
229236 * @perout_channels: periodic output data
237+ * @extts_channels: channels for external timestamps
230238 * @info: structure defining PTP hardware capabilities
231239 * @clock: pointer to registered PTP clock device
232240 * @tstamp_config: hardware timestamping configuration
@@ -250,6 +258,7 @@ struct ice_ptp { · 17 unmodified lines
250258 u8 ext_ts_irq;
251259 struct kthread_worker *kworker;
252260 struct ice_perout_channel perout_channels[GLTSYN_TGT_H_IDX_MAX];
261+ struct ice_extts_channel extts_channels[GLTSYN_TGT_H_IDX_MAX];
253262 struct ptp_clock_info info;
254263 struct ptp_clock *clock;
255264 struct hwtstamp_config tstamp_config;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c+35−13
@@ -989,7 +989,12 @@ static void mlx5e_xfrm_update_stats(struct xfrm_state *x) · 988 unmodified lines
989989 struct mlx5e_ipsec_sa_entry *sa_entry = to_ipsec_sa_entry(x);
990990 struct mlx5e_ipsec_rule *ipsec_rule = &sa_entry->ipsec_rule;
991991 struct net *net = dev_net(x->xso.dev);
992+ u64 trailer_packets = 0, trailer_bytes = 0;
993+ u64 replay_packets = 0, replay_bytes = 0;
994+ u64 auth_packets = 0, auth_bytes = 0;
995+ u64 success_packets, success_bytes;
992996 u64 packets, bytes, lastuse;
997+ size_t headers;
993998
994999 lockdep_assert(lockdep_is_held(&x->lock) ||
9951000 lockdep_is_held(&dev_net(x->xso.real_dev)->xfrm.xfrm_cfg_mutex) ||
@@ -999,26 +1004,43 @@ static void mlx5e_xfrm_update_stats(struct xfrm_state *x) · 3 unmodified lines
9991004 return;
10001005
10011006 if (sa_entry->attrs.dir == XFRM_DEV_OFFLOAD_IN) {
1002− mlx5_fc_query_cached(ipsec_rule->auth.fc, &bytes, &packets, &lastuse);
1003− x->stats.integrity_failed += packets;
1004− XFRM_ADD_STATS(net, LINUX_MIB_XFRMINSTATEPROTOERROR, packets);
1005−
1006− mlx5_fc_query_cached(ipsec_rule->trailer.fc, &bytes, &packets, &lastuse);
1007− XFRM_ADD_STATS(net, LINUX_MIB_XFRMINHDRERROR, packets);
1007+ mlx5_fc_query_cached(ipsec_rule->auth.fc, &auth_bytes,
1008+ &auth_packets, &lastuse);
1009+ x->stats.integrity_failed += auth_packets;
1010+ XFRM_ADD_STATS(net, LINUX_MIB_XFRMINSTATEPROTOERROR, auth_packets);
1011+
1012+ mlx5_fc_query_cached(ipsec_rule->trailer.fc, &trailer_bytes,
1013+ &trailer_packets, &lastuse);
1014+ XFRM_ADD_STATS(net, LINUX_MIB_XFRMINHDRERROR, trailer_packets);
10081015 }
10091016
10101017 if (x->xso.type != XFRM_DEV_OFFLOAD_PACKET)
10111018 return;
10121019
1013− mlx5_fc_query_cached(ipsec_rule->fc, &bytes, &packets, &lastuse);
1014− x->curlft.packets += packets;
1015− x->curlft.bytes += bytes;
1016−
10171020 if (sa_entry->attrs.dir == XFRM_DEV_OFFLOAD_IN) {
1018− mlx5_fc_query_cached(ipsec_rule->replay.fc, &bytes, &packets, &lastuse);
1019− x->stats.replay += packets;
1020− XFRM_ADD_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR, packets);
1021+ mlx5_fc_query_cached(ipsec_rule->replay.fc, &replay_bytes,
1022+ &replay_packets, &lastuse);
1023+ x->stats.replay += replay_packets;
1024+ XFRM_ADD_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR, replay_packets);
10211025 }
1026+
1027+ mlx5_fc_query_cached(ipsec_rule->fc, &bytes, &packets, &lastuse);
1028+ success_packets = packets - auth_packets - trailer_packets - replay_packets;
1029+ x->curlft.packets += success_packets;
1030+ /* NIC counts all bytes passed through flow steering and doesn't have
1031+ * an ability to count payload data size which is needed for SA.
1032+ *
1033+ * To overcome HW limitestion, let's approximate the payload size
1034+ * by removing always available headers.
1035+ */
1036+ headers = sizeof(struct ethhdr);
1037+ if (sa_entry->attrs.family == AF_INET)
1038+ headers += sizeof(struct iphdr);
1039+ else
1040+ headers += sizeof(struct ipv6hdr);
1041+
1042+ success_bytes = bytes - auth_bytes - trailer_bytes - replay_bytes;
1043+ x->curlft.bytes += success_bytes - headers * success_packets;
10221044 }
10231045
10241046 static int mlx5e_xfrm_validate_policy(struct mlx5_core_dev *mdev,
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+5−0
@@ -6034,6 +6034,11 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv) · 6033 unmodified lines
60346034 kfree(priv->htb_qos_sq_stats[i]);
60356035 kvfree(priv->htb_qos_sq_stats);
60366036
6037+ if (priv->mqprio_rl) {
6038+ mlx5e_mqprio_rl_cleanup(priv->mqprio_rl);
6039+ mlx5e_mqprio_rl_free(priv->mqprio_rl);
6040+ }
6041+
60376042 memset(priv, 0, sizeof(*priv));
60386043 }
60396044
drivers/net/ethernet/mellanox/mlx5/core/eq.c+1−3
@@ -1197,9 +1197,7 @@ static int get_num_eqs(struct mlx5_core_dev *dev) · 1196 unmodified lines
11971197 if (!mlx5_core_is_eth_enabled(dev) && mlx5_eth_supported(dev))
11981198 return 1;
11991199
1200− max_dev_eqs = MLX5_CAP_GEN(dev, max_num_eqs) ?
1201− MLX5_CAP_GEN(dev, max_num_eqs) :
1202− 1 << MLX5_CAP_GEN(dev, log_max_eq);
1200+ max_dev_eqs = mlx5_max_eq_cap_get(dev);
12031201
12041202 num_eqs = min_t(int, mlx5_irq_table_get_num_comp(eq_table->irq_table),
12051203 max_dev_eqs - MLX5_MAX_ASYNC_EQS);
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c+29−8
@@ -6,6 +6,9 @@ · 5 unmodified lines
66 #include "helper.h"
77 #include "ofld.h"
88
9+static int
10+acl_ingress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
11+
912 static bool
1013 esw_acl_ingress_prio_tag_enabled(struct mlx5_eswitch *esw,
1114 const struct mlx5_vport *vport)
@@ -123,18 +126,31 @@ static int esw_acl_ingress_src_port_drop_create(struct mlx5_eswitch *esw, · 111 unmodified lines
123126 {
124127 struct mlx5_flow_act flow_act = {};
125128 struct mlx5_flow_handle *flow_rule;
129+ bool created = false;
126130 int err = 0;
127131
132+ if (!vport->ingress.acl) {
133+ err = acl_ingress_ofld_setup(esw, vport);
134+ if (err)
135+ return err;
136+ created = true;
137+ }
138+
128139 flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP;
129140 flow_act.fg = vport->ingress.offloads.drop_grp;
130141 flow_rule = mlx5_add_flow_rules(vport->ingress.acl, NULL, &flow_act, NULL, 0);
131142 if (IS_ERR(flow_rule)) {
132143 err = PTR_ERR(flow_rule);
133− goto out;
144+ goto err_out;
134145 }
135146
136147 vport->ingress.offloads.drop_rule = flow_rule;
137−out:
148+
149+ return 0;
150+err_out:
151+ /* Only destroy ingress acl created in this function. */
152+ if (created)
153+ esw_acl_ingress_ofld_cleanup(esw, vport);
138154 return err;
139155 }
140156
@@ -299,16 +315,12 @@ static void esw_acl_ingress_ofld_groups_destroy(struct mlx5_vport *vport) · 158 unmodified lines
299315 }
300316 }
301317
302−int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw,
303− struct mlx5_vport *vport)
318+static int
319+acl_ingress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport)
304320 {
305321 int num_ftes = 0;
306322 int err;
307323
308− if (!mlx5_eswitch_vport_match_metadata_enabled(esw) &&
309− !esw_acl_ingress_prio_tag_enabled(esw, vport))
310− return 0;
311−
312324 esw_acl_ingress_allow_rule_destroy(vport);
313325
314326 if (mlx5_eswitch_vport_match_metadata_enabled(esw))
@@ -347,6 +359,15 @@ group_err: · 32 unmodified lines
347359 return err;
348360 }
349361
362+int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport)
363+{
364+ if (!mlx5_eswitch_vport_match_metadata_enabled(esw) &&
365+ !esw_acl_ingress_prio_tag_enabled(esw, vport))
366+ return 0;
367+
368+ return acl_ingress_ofld_setup(esw, vport);
369+}
370+
350371 void esw_acl_ingress_ofld_cleanup(struct mlx5_eswitch *esw,
351372 struct mlx5_vport *vport)
352373 {
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+17−5
@@ -4600,20 +4600,26 @@ mlx5_devlink_port_fn_max_io_eqs_get(struct devlink_port *port, u32 *max_io_eqs, · 4599 unmodified lines
46004600 return -EOPNOTSUPP;
46014601 }
46024602
4603+ if (!MLX5_CAP_GEN_2(esw->dev, max_num_eqs_24b)) {
4604+ NL_SET_ERR_MSG_MOD(extack,
4605+ "Device doesn't support getting the max number of EQs");
4606+ return -EOPNOTSUPP;
4607+ }
4608+
46034609 query_ctx = kzalloc(query_out_sz, GFP_KERNEL);
46044610 if (!query_ctx)
46054611 return -ENOMEM;
46064612
46074613 mutex_lock(&esw->state_lock);
46084614 err = mlx5_vport_get_other_func_cap(esw->dev, vport_num, query_ctx,
4609− MLX5_CAP_GENERAL);
4615+ MLX5_CAP_GENERAL_2);
46104616 if (err) {
46114617 NL_SET_ERR_MSG_MOD(extack, "Failed getting HCA caps");
46124618 goto out;
46134619 }
46144620
46154621 hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4616− max_eqs = MLX5_GET(cmd_hca_cap, hca_caps, max_num_eqs);
4622+ max_eqs = MLX5_GET(cmd_hca_cap_2, hca_caps, max_num_eqs_24b);
46174623 if (max_eqs < MLX5_ESW_MAX_CTRL_EQS)
46184624 *max_io_eqs = 0;
46194625 else
@@ -4644,6 +4650,12 @@ mlx5_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, · 24 unmodified lines
46444650 return -EOPNOTSUPP;
46454651 }
46464652
4653+ if (!MLX5_CAP_GEN_2(esw->dev, max_num_eqs_24b)) {
4654+ NL_SET_ERR_MSG_MOD(extack,
4655+ "Device doesn't support changing the max number of EQs");
4656+ return -EOPNOTSUPP;
4657+ }
4658+
46474659 if (check_add_overflow(max_io_eqs, MLX5_ESW_MAX_CTRL_EQS, &max_eqs)) {
46484660 NL_SET_ERR_MSG_MOD(extack, "Supplied value out of range");
46494661 return -EINVAL;
@@ -4655,17 +4667,17 @@ mlx5_devlink_port_fn_max_io_eqs_set(struct devlink_port *port, u32 max_io_eqs, · 5 unmodified lines
46554667
46564668 mutex_lock(&esw->state_lock);
46574669 err = mlx5_vport_get_other_func_cap(esw->dev, vport_num, query_ctx,
4658− MLX5_CAP_GENERAL);
4670+ MLX5_CAP_GENERAL_2);
46594671 if (err) {
46604672 NL_SET_ERR_MSG_MOD(extack, "Failed getting HCA caps");
46614673 goto out;
46624674 }
46634675
46644676 hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4665− MLX5_SET(cmd_hca_cap, hca_caps, max_num_eqs, max_eqs);
4677+ MLX5_SET(cmd_hca_cap_2, hca_caps, max_num_eqs_24b, max_eqs);
46664678
46674679 err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport_num,
4668− MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE);
4680+ MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE2);
46694681 if (err)
46704682 NL_SET_ERR_MSG_MOD(extack, "Failed setting HCA caps");
46714683
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+10−0
@@ -383,4 +383,14 @@ static inline int mlx5_vport_to_func_id(const struct mlx5_core_dev *dev, u16 vpo · 382 unmodified lines
383383 : vport;
384384 }
385385
386+static inline int mlx5_max_eq_cap_get(const struct mlx5_core_dev *dev)
387+{
388+ if (MLX5_CAP_GEN_2(dev, max_num_eqs_24b))
389+ return MLX5_CAP_GEN_2(dev, max_num_eqs_24b);
390+
391+ if (MLX5_CAP_GEN(dev, max_num_eqs))
392+ return MLX5_CAP_GEN(dev, max_num_eqs);
393+
394+ return 1 << MLX5_CAP_GEN(dev, log_max_eq);
395+}
386396 #endif /* __MLX5_CORE_H__ */
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c+1−3
@@ -711,9 +711,7 @@ int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table) · 710 unmodified lines
711711
712712 int mlx5_irq_table_create(struct mlx5_core_dev *dev)
713713 {
714− int num_eqs = MLX5_CAP_GEN(dev, max_num_eqs) ?
715− MLX5_CAP_GEN(dev, max_num_eqs) :
716− 1 << MLX5_CAP_GEN(dev, log_max_eq);
714+ int num_eqs = mlx5_max_eq_cap_get(dev);
717715 int total_vec;
718716 int pcif_vec;
719717 int req_vec;
drivers/net/ethernet/mellanox/mlxsw/core_linecards.c+1−0
@@ -1484,6 +1484,7 @@ err_type_file_file_validate: · 1483 unmodified lines
14841484 vfree(types_info->data);
14851485 err_data_alloc:
14861486 kfree(types_info);
1487+ linecards->types_info = NULL;
14871488 return err;
14881489 }
14891490
drivers/net/ethernet/renesas/rswitch.c+2−2
@@ -871,13 +871,13 @@ static void rswitch_tx_free(struct net_device *ndev) · 870 unmodified lines
871871 dma_rmb();
872872 skb = gq->skbs[gq->dirty];
873873 if (skb) {
874+ rdev->ndev->stats.tx_packets++;
875+ rdev->ndev->stats.tx_bytes += skb->len;
874876 dma_unmap_single(ndev->dev.parent,
875877 gq->unmap_addrs[gq->dirty],
876878 skb->len, DMA_TO_DEVICE);
877879 dev_kfree_skb_any(gq->skbs[gq->dirty]);
878880 gq->skbs[gq->dirty] = NULL;
879− rdev->ndev->stats.tx_packets++;
880− rdev->ndev->stats.tx_bytes += skb->len;
881881 }
882882 desc->desc.die_dt = DT_EEMPTY;
883883 }
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c+1−1
@@ -272,7 +272,7 @@ static const struct ethqos_emac_por emac_v4_0_0_por[] = { · 271 unmodified lines
272272
273273 static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
274274 .por = emac_v4_0_0_por,
275− .num_por = ARRAY_SIZE(emac_v3_0_0_por),
275+ .num_por = ARRAY_SIZE(emac_v4_0_0_por),
276276 .rgmii_config_loopback_en = false,
277277 .has_emac_ge_3 = true,
278278 .link_clk_name = "phyaux",
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+4−3
@@ -7663,9 +7663,10 @@ int stmmac_dvr_probe(struct device *device, · 7662 unmodified lines
76637663 #ifdef STMMAC_VLAN_TAG_USED
76647664 /* Both mac100 and gmac support receive VLAN tag detection */
76657665 ndev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX;
7666− ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
7667− priv->hw->hw_vlan_en = true;
7668−
7666+ if (priv->plat->has_gmac4) {
7667+ ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
7668+ priv->hw->hw_vlan_en = true;
7669+ }
76697670 if (priv->dma_cap.vlhash) {
76707671 ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
76717672 ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;
drivers/net/ethernet/wangxun/libwx/wx_hw.c+1−0
@@ -1978,6 +1978,7 @@ int wx_sw_init(struct wx *wx) · 1977 unmodified lines
19781978
19791979 bitmap_zero(wx->state, WX_STATE_NBITS);
19801980 bitmap_zero(wx->flags, WX_PF_FLAGS_NBITS);
1981+ wx->misc_irq_domain = false;
19811982
19821983 return 0;
19831984 }
drivers/net/ethernet/wangxun/libwx/wx_lib.c+7−3
@@ -1711,6 +1711,7 @@ static int wx_set_interrupt_capability(struct wx *wx) · 1710 unmodified lines
17111711 }
17121712
17131713 pdev->irq = pci_irq_vector(pdev, 0);
1714+ wx->num_q_vectors = 1;
17141715
17151716 return 0;
17161717 }
@@ -2021,7 +2022,8 @@ void wx_free_irq(struct wx *wx) · 304 unmodified lines
20212022 int vector;
20222023
20232024 if (!(pdev->msix_enabled)) {
2024− free_irq(pdev->irq, wx);
2025+ if (!wx->misc_irq_domain)
2026+ free_irq(pdev->irq, wx);
20252027 return;
20262028 }
20272029
@@ -2036,7 +2038,7 @@ void wx_free_irq(struct wx *wx) · 8 unmodified lines
20362038 free_irq(entry->vector, q_vector);
20372039 }
20382040
2039− if (wx->mac.type == wx_mac_em)
2041+ if (!wx->misc_irq_domain)
20402042 free_irq(wx->msix_entry->vector, wx);
20412043 }
20422044 EXPORT_SYMBOL(wx_free_irq);
@@ -2051,6 +2053,9 @@ int wx_setup_isb_resources(struct wx *wx) · 8 unmodified lines
20512053 {
20522054 struct pci_dev *pdev = wx->pdev;
20532055
2056+ if (wx->isb_mem)
2057+ return 0;
2058+
20542059 wx->isb_mem = dma_alloc_coherent(&pdev->dev,
20552060 sizeof(u32) * 4,
20562061 &wx->isb_dma,
@@ -2410,7 +2415,6 @@ static void wx_free_all_tx_resources(struct wx *wx) · 353 unmodified lines
24102415
24112416 void wx_free_resources(struct wx *wx)
24122417 {
2413− wx_free_isb_resources(wx);
24142418 wx_free_all_rx_resources(wx);
24152419 wx_free_all_tx_resources(wx);
24162420 }
drivers/net/ethernet/wangxun/libwx/wx_type.h+1−0
@@ -1109,6 +1109,7 @@ struct wx { · 1108 unmodified lines
11091109 dma_addr_t isb_dma;
11101110 u32 *isb_mem;
11111111 u32 isb_tag[WX_ISB_MAX];
1112+ bool misc_irq_domain;
11121113
11131114 #define WX_MAX_RETA_ENTRIES 128
11141115 #define WX_RSS_INDIR_TBL_MAX 64
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c+2−0
@@ -387,6 +387,7 @@ err_dis_phy: · 386 unmodified lines
387387 err_free_irq:
388388 wx_free_irq(wx);
389389 err_free_resources:
390+ wx_free_isb_resources(wx);
390391 wx_free_resources(wx);
391392 return err;
392393 }
@@ -408,6 +409,7 @@ static int ngbe_close(struct net_device *netdev) · 15 unmodified lines
408409
409410 ngbe_down(wx);
410411 wx_free_irq(wx);
412+ wx_free_isb_resources(wx);
411413 wx_free_resources(wx);
412414 phylink_disconnect_phy(wx->phylink);
413415 wx_control_hw(wx, false);
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c+47−77
@@ -27,57 +27,19 @@ void txgbe_irq_enable(struct wx *wx, bool queues) · 26 unmodified lines
2727 }
2828
2929 /**
30− * txgbe_intr - msi/legacy mode Interrupt Handler
31− * @irq: interrupt number
32− * @data: pointer to a network interface device structure
33− **/
34−static irqreturn_t txgbe_intr(int __always_unused irq, void *data)
35−{
36− struct wx_q_vector *q_vector;
37− struct wx *wx = data;
38− struct pci_dev *pdev;
39− u32 eicr;
40−
41− q_vector = wx->q_vector[0];
42− pdev = wx->pdev;
43−
44− eicr = wx_misc_isb(wx, WX_ISB_VEC0);
45− if (!eicr) {
46− /* shared interrupt alert!
47− * the interrupt that we masked before the ICR read.
48− */
49− if (netif_running(wx->netdev))
50− txgbe_irq_enable(wx, true);
51− return IRQ_NONE; /* Not our interrupt */
52− }
53− wx->isb_mem[WX_ISB_VEC0] = 0;
54− if (!(pdev->msi_enabled))
55− wr32(wx, WX_PX_INTA, 1);
56−
57− wx->isb_mem[WX_ISB_MISC] = 0;
58− /* would disable interrupts here but it is auto disabled */
59− napi_schedule_irqoff(&q_vector->napi);
60−
61− /* re-enable link(maybe) and non-queue interrupts, no flush.
62− * txgbe_poll will re-enable the queue interrupts
63− */
64− if (netif_running(wx->netdev))
65− txgbe_irq_enable(wx, false);
66−
67− return IRQ_HANDLED;
68−}
69−
70−/**
71− * txgbe_request_msix_irqs - Initialize MSI-X interrupts
30+ * txgbe_request_queue_irqs - Initialize MSI-X queue interrupts
7231 * @wx: board private structure
7332 *
74− * Allocate MSI-X vectors and request interrupts from the kernel.
33+ * Allocate MSI-X queue vectors and request interrupts from the kernel.
7534 **/
76−static int txgbe_request_msix_irqs(struct wx *wx)
35+int txgbe_request_queue_irqs(struct wx *wx)
7736 {
7837 struct net_device *netdev = wx->netdev;
7938 int vector, err;
8039
40+ if (!wx->pdev->msix_enabled)
41+ return 0;
42+
8143 for (vector = 0; vector < wx->num_q_vectors; vector++) {
8244 struct wx_q_vector *q_vector = wx->q_vector[vector];
8345 struct msix_entry *entry = &wx->msix_q_entries[vector];
@@ -110,34 +72,6 @@ free_queue_irqs: · 26 unmodified lines
11072 return err;
11173 }
11274
113−/**
114− * txgbe_request_irq - initialize interrupts
115− * @wx: board private structure
116− *
117− * Attempt to configure interrupts using the best available
118− * capabilities of the hardware and kernel.
119− **/
120−int txgbe_request_irq(struct wx *wx)
121−{
122− struct net_device *netdev = wx->netdev;
123− struct pci_dev *pdev = wx->pdev;
124− int err;
125−
126− if (pdev->msix_enabled)
127− err = txgbe_request_msix_irqs(wx);
128− else if (pdev->msi_enabled)
129− err = request_irq(wx->pdev->irq, &txgbe_intr, 0,
130− netdev->name, wx);
131− else
132− err = request_irq(wx->pdev->irq, &txgbe_intr, IRQF_SHARED,
133− netdev->name, wx);
134−
135− if (err)
136− wx_err(wx, "request_irq failed, Error %d\n", err);
137−
138− return err;
139−}
140−
14175 static int txgbe_request_gpio_irq(struct txgbe *txgbe)
14276 {
14377 txgbe->gpio_irq = irq_find_mapping(txgbe->misc.domain, TXGBE_IRQ_GPIO);
@@ -177,6 +111,36 @@ static const struct irq_domain_ops txgbe_misc_irq_domain_ops = { · 33 unmodified lines
177111 };
178112
179113 static irqreturn_t txgbe_misc_irq_handle(int irq, void *data)
114+{
115+ struct wx_q_vector *q_vector;
116+ struct txgbe *txgbe = data;
117+ struct wx *wx = txgbe->wx;
118+ u32 eicr;
119+
120+ if (wx->pdev->msix_enabled)
121+ return IRQ_WAKE_THREAD;
122+
123+ eicr = wx_misc_isb(wx, WX_ISB_VEC0);
124+ if (!eicr) {
125+ /* shared interrupt alert!
126+ * the interrupt that we masked before the ICR read.
127+ */
128+ if (netif_running(wx->netdev))
129+ txgbe_irq_enable(wx, true);
130+ return IRQ_NONE; /* Not our interrupt */
131+ }
132+ wx->isb_mem[WX_ISB_VEC0] = 0;
133+ if (!(wx->pdev->msi_enabled))
134+ wr32(wx, WX_PX_INTA, 1);
135+
136+ /* would disable interrupts here but it is auto disabled */
137+ q_vector = wx->q_vector[0];
138+ napi_schedule_irqoff(&q_vector->napi);
139+
140+ return IRQ_WAKE_THREAD;
141+}
142+
143+static irqreturn_t txgbe_misc_irq_thread_fn(int irq, void *data)
180144 {
181145 struct txgbe *txgbe = data;
182146 struct wx *wx = txgbe->wx;
@@ -223,6 +187,7 @@ void txgbe_free_misc_irq(struct txgbe *txgbe) · 40 unmodified lines
223187
224188 int txgbe_setup_misc_irq(struct txgbe *txgbe)
225189 {
190+ unsigned long flags = IRQF_ONESHOT;
226191 struct wx *wx = txgbe->wx;
227192 int hwirq, err;
228193
@@ -236,14 +201,17 @@ int txgbe_setup_misc_irq(struct txgbe *txgbe) · 7 unmodified lines
236201 irq_create_mapping(txgbe->misc.domain, hwirq);
237202
238203 txgbe->misc.chip = txgbe_irq_chip;
239− if (wx->pdev->msix_enabled)
204+ if (wx->pdev->msix_enabled) {
240205 txgbe->misc.irq = wx->msix_entry->vector;
241− else
206+ } else {
242207 txgbe->misc.irq = wx->pdev->irq;
208+ if (!wx->pdev->msi_enabled)
209+ flags |= IRQF_SHARED;
210+ }
243211
244− err = request_threaded_irq(txgbe->misc.irq, NULL,
245− txgbe_misc_irq_handle,
246− IRQF_ONESHOT,
212+ err = request_threaded_irq(txgbe->misc.irq, txgbe_misc_irq_handle,
213+ txgbe_misc_irq_thread_fn,
214+ flags,
247215 wx->netdev->name, txgbe);
248216 if (err)
249217 goto del_misc_irq;
@@ -256,6 +224,8 @@ int txgbe_setup_misc_irq(struct txgbe *txgbe) · 6 unmodified lines
256224 if (err)
257225 goto free_gpio_irq;
258226
227+ wx->misc_irq_domain = true;
228+
259229 return 0;
260230
261231 free_gpio_irq:
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.h+1−1
@@ -2,6 +2,6 @@ · 1 unmodified line
22 /* Copyright (c) 2015 - 2024 Beijing WangXun Technology Co., Ltd. */
33
44 void txgbe_irq_enable(struct wx *wx, bool queues);
5−int txgbe_request_irq(struct wx *wx);
5+int txgbe_request_queue_irqs(struct wx *wx);
66 void txgbe_free_misc_irq(struct txgbe *txgbe);
77 int txgbe_setup_misc_irq(struct txgbe *txgbe);
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c+5−4
@@ -309,9 +309,9 @@ static int txgbe_open(struct net_device *netdev) · 308 unmodified lines
309309
310310 wx_configure(wx);
311311
312− err = txgbe_request_irq(wx);
312+ err = txgbe_request_queue_irqs(wx);
313313 if (err)
314− goto err_free_isb;
314+ goto err_free_resources;
315315
316316 /* Notify the stack of the actual queue counts. */
317317 err = netif_set_real_num_tx_queues(netdev, wx->num_tx_queues);
@@ -328,8 +328,8 @@ static int txgbe_open(struct net_device *netdev) · 10 unmodified lines
328328
329329 err_free_irq:
330330 wx_free_irq(wx);
331−err_free_isb:
332− wx_free_isb_resources(wx);
331+err_free_resources:
332+ wx_free_resources(wx);
333333 err_reset:
334334 txgbe_reset(wx);
335335
@@ -747,6 +747,7 @@ static void txgbe_remove(struct pci_dev *pdev) · 411 unmodified lines
747747
748748 txgbe_remove_phy(txgbe);
749749 txgbe_free_misc_irq(txgbe);
750+ wx_free_isb_resources(wx);
750751
751752 pci_release_selected_regions(pdev,
752753 pci_select_bars(pdev, IORESOURCE_MEM));
drivers/net/ntb_netdev.c+1−1
@@ -119,7 +119,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, · 118 unmodified lines
119119 skb->protocol = eth_type_trans(skb, ndev);
120120 skb->ip_summed = CHECKSUM_NONE;
121121
122− if (__netif_rx(skb) == NET_RX_DROP) {
122+ if (netif_rx(skb) == NET_RX_DROP) {
123123 ndev->stats.rx_errors++;
124124 ndev->stats.rx_dropped++;
125125 } else {
drivers/net/phy/aquantia/aquantia.h+4−0
@@ -6,6 +6,9 @@ · 5 unmodified lines
66 * Author: Heiner Kallweit <hkallweit1@gmail.com>
77 */
88
9+#ifndef AQUANTIA_H
10+#define AQUANTIA_H
11+
912 #include <linux/device.h>
1013 #include <linux/phy.h>
1114
@@ -198,3 +201,4 @@ int aqr_phy_led_hw_control_set(struct phy_device *phydev, u8 index, · 186 unmodified lines
198201 int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable);
199202 int aqr_phy_led_polarity_set(struct phy_device *phydev, int index,
200203 unsigned long modes);
204+#endif /* AQUANTIA_H */
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+7−7
@@ -666,7 +666,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) · 665 unmodified lines
666666 hw->wiphy->features |= NL80211_FEATURE_WFA_TPC_IE_IN_PROBES;
667667
668668 if (iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_KEK_KCK_MATERIAL,
669− IWL_FW_CMD_VER_UNKNOWN) == 3)
669+ IWL_FW_CMD_VER_UNKNOWN) >= 3)
670670 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK;
671671
672672 if (fw_has_api(&mvm->fw->ucode_capa,
@@ -1698,7 +1698,8 @@ static void iwl_mvm_prevent_esr_done_wk(struct wiphy *wiphy, · 1025 unmodified lines
16981698 struct iwl_mvm_vif *mvmvif =
16991699 container_of(wk, struct iwl_mvm_vif, prevent_esr_done_wk.work);
17001700 struct iwl_mvm *mvm = mvmvif->mvm;
1701− struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm);
1701+ struct ieee80211_vif *vif =
1702+ container_of((void *)mvmvif, struct ieee80211_vif, drv_priv);
17021703
17031704 guard(mvm)(mvm);
17041705 iwl_mvm_unblock_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_PREVENTION);
@@ -1720,7 +1721,8 @@ static void iwl_mvm_unblock_esr_tpt(struct wiphy *wiphy, struct wiphy_work *wk) · 15 unmodified lines
17201721 struct iwl_mvm_vif *mvmvif =
17211722 container_of(wk, struct iwl_mvm_vif, unblock_esr_tpt_wk);
17221723 struct iwl_mvm *mvm = mvmvif->mvm;
1723− struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm);
1724+ struct ieee80211_vif *vif =
1725+ container_of((void *)mvmvif, struct ieee80211_vif, drv_priv);
17241726
17251727 guard(mvm)(mvm);
17261728 iwl_mvm_unblock_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_TPT);
@@ -6406,11 +6408,9 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, · 4679 unmodified lines
64066408 if (sync) {
64076409 lockdep_assert_held(&mvm->mutex);
64086410 ret = wait_event_timeout(mvm->rx_sync_waitq,
6409− READ_ONCE(mvm->queue_sync_state) == 0 ||
6410− iwl_mvm_is_radio_hw_killed(mvm),
6411+ READ_ONCE(mvm->queue_sync_state) == 0,
64116412 SYNC_RX_QUEUE_TIMEOUT);
6412− WARN_ONCE(!ret && !iwl_mvm_is_radio_hw_killed(mvm),
6413− "queue sync: failed to sync, state is 0x%lx, cookie %d\n",
6413+ WARN_ONCE(!ret, "queue sync: failed to sync, state is 0x%lx, cookie %d\n",
64146414 mvm->queue_sync_state,
64156415 mvm->queue_sync_cookie);
64166416 }
drivers/net/wireless/intel/iwlwifi/mvm/ops.c+3−5
@@ -149,7 +149,7 @@ static void iwl_mvm_rx_esr_mode_notif(struct iwl_mvm *mvm, · 148 unmodified lines
149149 struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm);
150150
151151 /* FW recommendations is only for entering EMLSR */
152− if (!vif || iwl_mvm_vif_from_mac80211(vif)->esr_active)
152+ if (IS_ERR_OR_NULL(vif) || iwl_mvm_vif_from_mac80211(vif)->esr_active)
153153 return;
154154
155155 if (le32_to_cpu(notif->action) == ESR_RECOMMEND_ENTER)
@@ -1898,12 +1898,10 @@ static bool iwl_mvm_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) · 1742 unmodified lines
18981898 bool rfkill_safe_init_done = READ_ONCE(mvm->rfkill_safe_init_done);
18991899 bool unified = iwl_mvm_has_unified_ucode(mvm);
19001900
1901− if (state) {
1901+ if (state)
19021902 set_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
1903− wake_up(&mvm->rx_sync_waitq);
1904− } else {
1903+ else
19051904 clear_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
1906− }
19071905
19081906 iwl_mvm_set_rfkill_state(mvm);
19091907
drivers/net/wireless/intel/iwlwifi/mvm/rx.c+7−8
@@ -557,12 +557,10 @@ struct iwl_mvm_stat_data_all_macs { · 556 unmodified lines
557557 };
558558
559559 static void iwl_mvm_update_link_sig(struct ieee80211_vif *vif, int sig,
560− struct iwl_mvm_vif_link_info *link_info)
560+ struct iwl_mvm_vif_link_info *link_info,
561+ struct ieee80211_bss_conf *bss_conf)
561562 {
562563 struct iwl_mvm *mvm = iwl_mvm_vif_from_mac80211(vif)->mvm;
563− struct ieee80211_bss_conf *bss_conf =
564− iwl_mvm_rcu_fw_link_id_to_link_conf(mvm, link_info->fw_link_id,
565− false);
566564 int thold = bss_conf->cqm_rssi_thold;
567565 int hyst = bss_conf->cqm_rssi_hyst;
568566 int last_event;
@@ -670,7 +668,7 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac, · 101 unmodified lines
670668 mvmvif->deflink.beacon_stats.num_beacons;
671669
672670 /* This is used in pre-MLO API so use deflink */
673− iwl_mvm_update_link_sig(vif, sig, &mvmvif->deflink);
671+ iwl_mvm_update_link_sig(vif, sig, &mvmvif->deflink, &vif->bss_conf);
674672 }
675673
676674 static void iwl_mvm_stat_iterator_all_macs(void *_data, u8 *mac,
@@ -705,7 +703,7 @@ static void iwl_mvm_stat_iterator_all_macs(void *_data, u8 *mac, · 28 unmodified lines
705703 sig = -le32_to_cpu(mac_stats->beacon_filter_average_energy);
706704
707705 /* This is used in pre-MLO API so use deflink */
708− iwl_mvm_update_link_sig(vif, sig, &mvmvif->deflink);
706+ iwl_mvm_update_link_sig(vif, sig, &mvmvif->deflink, &vif->bss_conf);
709707 }
710708
711709 static inline void
@@ -921,7 +919,8 @@ iwl_mvm_stat_iterator_all_links(struct iwl_mvm *mvm, · 209 unmodified lines
921919 mvmvif->link[link_id]->beacon_stats.num_beacons;
922920
923921 sig = -le32_to_cpu(link_stats->beacon_filter_average_energy);
924− iwl_mvm_update_link_sig(bss_conf->vif, sig, link_info);
922+ iwl_mvm_update_link_sig(bss_conf->vif, sig, link_info,
923+ bss_conf);
925924
926925 if (WARN_ONCE(mvmvif->id >= MAC_INDEX_AUX,
927926 "invalid mvmvif id: %d", mvmvif->id))
@@ -967,7 +966,7 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) · 39 unmodified lines
967966
968967 lockdep_assert_held(&mvm->mutex);
969968
970− if (!bss_vif)
969+ if (IS_ERR_OR_NULL(bss_vif))
971970 return;
972971
973972 mvmvif = iwl_mvm_vif_from_mac80211(bss_vif);
drivers/net/wireless/microchip/wilc1000/hif.c+2−1
@@ -382,7 +382,8 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, · 381 unmodified lines
382382 struct ieee80211_p2p_noa_attr noa_attr;
383383 const struct cfg80211_bss_ies *ies;
384384 struct wilc_join_bss_param *param;
385− u8 rates_len = 0, ies_len;
385+ u8 rates_len = 0;
386+ int ies_len;
386387 int ret;
387388
388389 param = kzalloc(sizeof(*param), GFP_KERNEL);
drivers/nvme/host/apple.c+1−0
@@ -1602,4 +1602,5 @@ static struct platform_driver apple_nvme_driver = { · 1601 unmodified lines
16021602 module_platform_driver(apple_nvme_driver);
16031603
16041604 MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
1605+MODULE_DESCRIPTION("Apple ANS NVM Express device driver");
16051606 MODULE_LICENSE("GPL");
drivers/nvme/host/nvme.h+1−1
@@ -502,7 +502,7 @@ static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head) · 501 unmodified lines
502502 enum nvme_ns_features {
503503 NVME_NS_EXT_LBAS = 1 << 0, /* support extended LBA format */
504504 NVME_NS_METADATA_SUPPORTED = 1 << 1, /* support getting generated md */
505− NVME_NS_DEAC, /* DEAC bit in Write Zeores supported */
505+ NVME_NS_DEAC = 1 << 2, /* DEAC bit in Write Zeores supported */
506506 };
507507
508508 struct nvme_ns {
drivers/nvme/target/configfs.c+31−10
@@ -410,7 +410,29 @@ static ssize_t nvmet_addr_tsas_show(struct config_item *item, · 409 unmodified lines
410410 return sprintf(page, "%s\n", nvmet_addr_tsas_rdma[i].name);
411411 }
412412 }
413− return sprintf(page, "reserved\n");
413+ return sprintf(page, "\n");
414+}
415+
416+static u8 nvmet_addr_tsas_rdma_store(const char *page)
417+{
418+ int i;
419+
420+ for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_rdma); i++) {
421+ if (sysfs_streq(page, nvmet_addr_tsas_rdma[i].name))
422+ return nvmet_addr_tsas_rdma[i].type;
423+ }
424+ return NVMF_RDMA_QPTYPE_INVALID;
425+}
426+
427+static u8 nvmet_addr_tsas_tcp_store(const char *page)
428+{
429+ int i;
430+
431+ for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
432+ if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name))
433+ return nvmet_addr_tsas_tcp[i].type;
434+ }
435+ return NVMF_TCP_SECTYPE_INVALID;
414436 }
415437
416438 static ssize_t nvmet_addr_tsas_store(struct config_item *item,
@@ -418,20 +440,19 @@ static ssize_t nvmet_addr_tsas_store(struct config_item *item, · 1 unmodified line
418440 {
419441 struct nvmet_port *port = to_nvmet_port(item);
420442 u8 treq = nvmet_port_disc_addr_treq_mask(port);
421− u8 sectype;
422− int i;
443+ u8 sectype, qptype;
423444
424445 if (nvmet_is_port_enabled(port, __func__))
425446 return -EACCES;
426447
427− if (port->disc_addr.trtype != NVMF_TRTYPE_TCP)
428− return -EINVAL;
429−
430− for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
431− if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name)) {
432− sectype = nvmet_addr_tsas_tcp[i].type;
448+ if (port->disc_addr.trtype == NVMF_TRTYPE_RDMA) {
449+ qptype = nvmet_addr_tsas_rdma_store(page);
450+ if (qptype == port->disc_addr.tsas.rdma.qptype)
451+ return count;
452+ } else if (port->disc_addr.trtype == NVMF_TRTYPE_TCP) {
453+ sectype = nvmet_addr_tsas_tcp_store(page);
454+ if (sectype != NVMF_TCP_SECTYPE_INVALID)
433455 goto found;
434− }
435456 }
436457
437458 pr_err("Invalid value '%s' for tsas\n", page);
drivers/nvme/target/fc.c+1−1
@@ -148,7 +148,7 @@ struct nvmet_fc_tgt_queue { · 147 unmodified lines
148148 struct workqueue_struct *work_q;
149149 struct kref ref;
150150 /* array of fcp_iods */
151− struct nvmet_fc_fcp_iod fod[] __counted_by(sqsize);
151+ struct nvmet_fc_fcp_iod fod[] /* __counted_by(sqsize) */;
152152 } __aligned(sizeof(unsigned long long));
153153
154154 struct nvmet_fc_hostport {
drivers/pci/msi/msi.c+8−2
@@ -352,7 +352,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec, · 351 unmodified lines
352352 struct irq_affinity *affd)
353353 {
354354 struct irq_affinity_desc *masks = NULL;
355− struct msi_desc *entry;
355+ struct msi_desc *entry, desc;
356356 int ret;
357357
358358 /* Reject multi-MSI early on irq domain enabled architectures */
@@ -377,6 +377,12 @@ static int msi_capability_init(struct pci_dev *dev, int nvec, · 18 unmodified lines
377377 /* All MSIs are unmasked by default; mask them all */
378378 entry = msi_first_desc(&dev->dev, MSI_DESC_ALL);
379379 pci_msi_mask(entry, msi_multi_mask(entry));
380+ /*
381+ * Copy the MSI descriptor for the error path because
382+ * pci_msi_setup_msi_irqs() will free it for the hierarchical
383+ * interrupt domain case.
384+ */
385+ memcpy(&desc, entry, sizeof(desc));
380386
381387 /* Configure MSI capability structure */
382388 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
@@ -396,7 +402,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec, · 13 unmodified lines
396402 goto unlock;
397403
398404 err:
399− pci_msi_unmask(entry, msi_multi_mask(entry));
405+ pci_msi_unmask(&desc, msi_multi_mask(&desc));
400406 pci_free_msi_irqs(dev);
401407 fail:
402408 dev->msi_enabled = 0;
drivers/platform/mellanox/nvsw-sn2201.c+4−1
@@ -1198,6 +1198,7 @@ static int nvsw_sn2201_config_pre_init(struct nvsw_sn2201 *nvsw_sn2201) · 1197 unmodified lines
11981198 static int nvsw_sn2201_probe(struct platform_device *pdev)
11991199 {
12001200 struct nvsw_sn2201 *nvsw_sn2201;
1201+ int ret;
12011202
12021203 nvsw_sn2201 = devm_kzalloc(&pdev->dev, sizeof(*nvsw_sn2201), GFP_KERNEL);
12031204 if (!nvsw_sn2201)
@@ -1205,8 +1206,10 @@ static int nvsw_sn2201_probe(struct platform_device *pdev) · 1 unmodified line
12051206
12061207 nvsw_sn2201->dev = &pdev->dev;
12071208 platform_set_drvdata(pdev, nvsw_sn2201);
1208− platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
1209+ ret = platform_device_add_resources(pdev, nvsw_sn2201_lpc_io_resources,
12091210 ARRAY_SIZE(nvsw_sn2201_lpc_io_resources));
1211+ if (ret)
1212+ return ret;
12101213
12111214 nvsw_sn2201->main_mux_deferred_nr = NVSW_SN2201_MAIN_MUX_DEFER_NR;
12121215 nvsw_sn2201->main_mux_devs = nvsw_sn2201_main_mux_brdinfo;
drivers/platform/x86/amilo-rfkill.c+1−0
@@ -171,6 +171,7 @@ static void __exit amilo_rfkill_exit(void) · 170 unmodified lines
171171 }
172172
173173 MODULE_AUTHOR("Ben Hutchings <ben@decadent.org.uk>");
174+MODULE_DESCRIPTION("Fujitsu-Siemens Amilo rfkill support");
174175 MODULE_LICENSE("GPL");
175176 MODULE_DEVICE_TABLE(dmi, amilo_rfkill_id_table);
176177
drivers/platform/x86/firmware_attributes_class.c+1−0
@@ -49,4 +49,5 @@ int fw_attributes_class_put(void) · 48 unmodified lines
4949 EXPORT_SYMBOL_GPL(fw_attributes_class_put);
5050
5151 MODULE_AUTHOR("Mark Pearson <markpearson@lenovo.com>");
52+MODULE_DESCRIPTION("Firmware attributes class helper module");
5253 MODULE_LICENSE("GPL");
drivers/platform/x86/ibm_rtl.c+1−0
@@ -29,6 +29,7 @@ static bool debug; · 28 unmodified lines
2929 module_param(debug, bool, 0644);
3030 MODULE_PARM_DESC(debug, "Show debug output");
3131
32+MODULE_DESCRIPTION("IBM Premium Real Time Mode (PRTM) driver");
3233 MODULE_LICENSE("GPL");
3334 MODULE_AUTHOR("Keith Mannthey <kmmanth@us.ibm.com>");
3435 MODULE_AUTHOR("Vernon Mauery <vernux@us.ibm.com>");
drivers/platform/x86/intel/hid.c+1−0
@@ -38,6 +38,7 @@ MODULE_PARM_DESC(enable_sw_tablet_mode, · 37 unmodified lines
3838 /* When NOT in tablet mode, VGBS returns with the flag 0x40 */
3939 #define TABLET_MODE_FLAG BIT(6)
4040
41+MODULE_DESCRIPTION("Intel HID Event hotkey driver");
4142 MODULE_LICENSE("GPL");
4243 MODULE_AUTHOR("Alex Hung");
4344
drivers/platform/x86/intel/pmc/pltdrv.c+1−0
@@ -86,4 +86,5 @@ static void __exit pmc_core_platform_exit(void) · 85 unmodified lines
8686
8787 module_init(pmc_core_platform_init);
8888 module_exit(pmc_core_platform_exit);
89+MODULE_DESCRIPTION("Intel PMC Core platform driver");
8990 MODULE_LICENSE("GPL v2");
drivers/platform/x86/intel/rst.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/module.h>
88 #include <linux/slab.h>
99
10+MODULE_DESCRIPTION("Intel Rapid Start Technology Driver");
1011 MODULE_LICENSE("GPL");
1112
1213 static ssize_t irst_show_wakeup_events(struct device *dev,
drivers/platform/x86/intel/smartconnect.c+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/acpi.h>
77 #include <linux/module.h>
88
9+MODULE_DESCRIPTION("Intel Smart Connect disabling driver");
910 MODULE_LICENSE("GPL");
1011
1112 static int smartconnect_acpi_init(struct acpi_device *acpi)
drivers/platform/x86/intel/vbtn.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424
2525 #define VGBS_TABLET_MODE_FLAGS (VGBS_TABLET_MODE_FLAG | VGBS_TABLET_MODE_FLAG_ALT)
2626
27+MODULE_DESCRIPTION("Intel Virtual Button driver");
2728 MODULE_LICENSE("GPL");
2829 MODULE_AUTHOR("AceLan Kao");
2930
drivers/platform/x86/lg-laptop.c+34−55
@@ -39,8 +39,6 @@ MODULE_LICENSE("GPL"); · 38 unmodified lines
3939 #define WMI_METHOD_WMBB "2B4F501A-BD3C-4394-8DCF-00A7D2BC8210"
4040 #define WMI_EVENT_GUID WMI_EVENT_GUID0
4141
42−#define WMAB_METHOD "\\XINI.WMAB"
43−#define WMBB_METHOD "\\XINI.WMBB"
4442 #define SB_GGOV_METHOD "\\_SB.GGOV"
4543 #define GOV_TLED 0x2020008
4644 #define WM_GET 1
@@ -74,7 +72,7 @@ static u32 inited; · 27 unmodified lines
7472
7573 static int battery_limit_use_wmbb;
7674 static struct led_classdev kbd_backlight;
77−static enum led_brightness get_kbd_backlight_level(void);
75+static enum led_brightness get_kbd_backlight_level(struct device *dev);
7876
7977 static const struct key_entry wmi_keymap[] = {
8078 {KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */
@@ -84,7 +82,6 @@ static const struct key_entry wmi_keymap[] = { · 3 unmodified lines
8482 * this key both sends an event and
8583 * changes backlight level.
8684 */
87− {KE_KEY, 0x80, {KEY_RFKILL} },
8885 {KE_END, 0}
8986 };
9087
@@ -128,11 +125,10 @@ static int ggov(u32 arg0) · 37 unmodified lines
128125 return res;
129126 }
130127
131−static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2)
128+static union acpi_object *lg_wmab(struct device *dev, u32 method, u32 arg1, u32 arg2)
132129 {
133130 union acpi_object args[3];
134131 acpi_status status;
135− acpi_handle handle;
136132 struct acpi_object_list arg;
137133 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
138134
@@ -143,29 +139,22 @@ static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2) · 4 unmodified lines
143139 args[2].type = ACPI_TYPE_INTEGER;
144140 args[2].integer.value = arg2;
145141
146− status = acpi_get_handle(NULL, (acpi_string) WMAB_METHOD, &handle);
147− if (ACPI_FAILURE(status)) {
148− pr_err("Cannot get handle");
149− return NULL;
150− }
151−
152142 arg.count = 3;
153143 arg.pointer = args;
154144
155− status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
145+ status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMAB", &arg, &buffer);
156146 if (ACPI_FAILURE(status)) {
157− acpi_handle_err(handle, "WMAB: call failed.\n");
147+ dev_err(dev, "WMAB: call failed.\n");
158148 return NULL;
159149 }
160150
161151 return buffer.pointer;
162152 }
163153
164−static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2)
154+static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u32 arg2)
165155 {
166156 union acpi_object args[3];
167157 acpi_status status;
168− acpi_handle handle;
169158 struct acpi_object_list arg;
170159 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
171160 u8 buf[32];
@@ -181,18 +170,12 @@ static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2) · 9 unmodified lines
181170 args[2].buffer.length = 32;
182171 args[2].buffer.pointer = buf;
183172
184− status = acpi_get_handle(NULL, (acpi_string)WMBB_METHOD, &handle);
185− if (ACPI_FAILURE(status)) {
186− pr_err("Cannot get handle");
187− return NULL;
188− }
189−
190173 arg.count = 3;
191174 arg.pointer = args;
192175
193− status = acpi_evaluate_object(handle, NULL, &arg, &buffer);
176+ status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMBB", &arg, &buffer);
194177 if (ACPI_FAILURE(status)) {
195− acpi_handle_err(handle, "WMAB: call failed.\n");
178+ dev_err(dev, "WMBB: call failed.\n");
196179 return NULL;
197180 }
198181
@@ -223,7 +206,7 @@ static void wmi_notify(u32 value, void *context) · 24 unmodified lines
223206
224207 if (eventcode == 0x10000000) {
225208 led_classdev_notify_brightness_hw_changed(
226− &kbd_backlight, get_kbd_backlight_level());
209+ &kbd_backlight, get_kbd_backlight_level(kbd_backlight.dev->parent));
227210 } else {
228211 key = sparse_keymap_entry_from_scancode(
229212 wmi_input_dev, eventcode);
@@ -272,14 +255,7 @@ static void wmi_input_setup(void) · 42 unmodified lines
272255
273256 static void acpi_notify(struct acpi_device *device, u32 event)
274257 {
275− struct key_entry *key;
276−
277258 acpi_handle_debug(device->handle, "notify: %d\n", event);
278− if (inited & INIT_SPARSE_KEYMAP) {
279− key = sparse_keymap_entry_from_scancode(wmi_input_dev, 0x80);
280− if (key && key->type == KE_KEY)
281− sparse_keymap_report_entry(wmi_input_dev, key, 1, true);
282− }
283259 }
284260
285261 static ssize_t fan_mode_store(struct device *dev,
@@ -295,7 +271,7 @@ static ssize_t fan_mode_store(struct device *dev, · 9 unmodified lines
295271 if (ret)
296272 return ret;
297273
298− r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
274+ r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
299275 if (!r)
300276 return -EIO;
301277
@@ -306,9 +282,9 @@ static ssize_t fan_mode_store(struct device *dev, · 4 unmodified lines
306282
307283 m = r->integer.value;
308284 kfree(r);
309− r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
285+ r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
310286 kfree(r);
311− r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
287+ r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
312288 kfree(r);
313289
314290 return count;
@@ -320,7 +296,7 @@ static ssize_t fan_mode_show(struct device *dev, · 5 unmodified lines
320296 unsigned int status;
321297 union acpi_object *r;
322298
323− r = lg_wmab(WM_FAN_MODE, WM_GET, 0);
299+ r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
324300 if (!r)
325301 return -EIO;
326302
@@ -347,7 +323,7 @@ static ssize_t usb_charge_store(struct device *dev, · 20 unmodified lines
347323 if (ret)
348324 return ret;
349325
350− r = lg_wmbb(WMBB_USB_CHARGE, WM_SET, value);
326+ r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_SET, value);
351327 if (!r)
352328 return -EIO;
353329
@@ -361,7 +337,7 @@ static ssize_t usb_charge_show(struct device *dev, · 7 unmodified lines
361337 unsigned int status;
362338 union acpi_object *r;
363339
364− r = lg_wmbb(WMBB_USB_CHARGE, WM_GET, 0);
340+ r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_GET, 0);
365341 if (!r)
366342 return -EIO;
367343
@@ -389,7 +365,7 @@ static ssize_t reader_mode_store(struct device *dev, · 21 unmodified lines
389365 if (ret)
390366 return ret;
391367
392− r = lg_wmab(WM_READER_MODE, WM_SET, value);
368+ r = lg_wmab(dev, WM_READER_MODE, WM_SET, value);
393369 if (!r)
394370 return -EIO;
395371
@@ -403,7 +379,7 @@ static ssize_t reader_mode_show(struct device *dev, · 7 unmodified lines
403379 unsigned int status;
404380 union acpi_object *r;
405381
406− r = lg_wmab(WM_READER_MODE, WM_GET, 0);
382+ r = lg_wmab(dev, WM_READER_MODE, WM_GET, 0);
407383 if (!r)
408384 return -EIO;
409385
@@ -431,7 +407,7 @@ static ssize_t fn_lock_store(struct device *dev, · 21 unmodified lines
431407 if (ret)
432408 return ret;
433409
434− r = lg_wmab(WM_FN_LOCK, WM_SET, value);
410+ r = lg_wmab(dev, WM_FN_LOCK, WM_SET, value);
435411 if (!r)
436412 return -EIO;
437413
@@ -445,7 +421,7 @@ static ssize_t fn_lock_show(struct device *dev, · 7 unmodified lines
445421 unsigned int status;
446422 union acpi_object *r;
447423
448− r = lg_wmab(WM_FN_LOCK, WM_GET, 0);
424+ r = lg_wmab(dev, WM_FN_LOCK, WM_GET, 0);
449425 if (!r)
450426 return -EIO;
451427
@@ -475,9 +451,9 @@ static ssize_t charge_control_end_threshold_store(struct device *dev, · 23 unmodified lines
475451 union acpi_object *r;
476452
477453 if (battery_limit_use_wmbb)
478− r = lg_wmbb(WMBB_BATT_LIMIT, WM_SET, value);
454+ r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_SET, value);
479455 else
480− r = lg_wmab(WM_BATT_LIMIT, WM_SET, value);
456+ r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_SET, value);
481457 if (!r)
482458 return -EIO;
483459
@@ -496,7 +472,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device, · 12 unmodified lines
496472 union acpi_object *r;
497473
498474 if (battery_limit_use_wmbb) {
499− r = lg_wmbb(WMBB_BATT_LIMIT, WM_GET, 0);
475+ r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_GET, 0);
500476 if (!r)
501477 return -EIO;
502478
@@ -507,7 +483,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device, · 4 unmodified lines
507483
508484 status = r->buffer.pointer[0x10];
509485 } else {
510− r = lg_wmab(WM_BATT_LIMIT, WM_GET, 0);
486+ r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_GET, 0);
511487 if (!r)
512488 return -EIO;
513489
@@ -586,7 +562,7 @@ static void tpad_led_set(struct led_classdev *cdev, · 72 unmodified lines
586562 {
587563 union acpi_object *r;
588564
589− r = lg_wmab(WM_TLED, WM_SET, brightness > LED_OFF);
565+ r = lg_wmab(cdev->dev->parent, WM_TLED, WM_SET, brightness > LED_OFF);
590566 kfree(r);
591567 }
592568
@@ -608,16 +584,16 @@ static void kbd_backlight_set(struct led_classdev *cdev, · 15 unmodified lines
608584 val = 0;
609585 if (brightness >= LED_FULL)
610586 val = 0x24;
611− r = lg_wmab(WM_KEY_LIGHT, WM_SET, val);
587+ r = lg_wmab(cdev->dev->parent, WM_KEY_LIGHT, WM_SET, val);
612588 kfree(r);
613589 }
614590
615−static enum led_brightness get_kbd_backlight_level(void)
591+static enum led_brightness get_kbd_backlight_level(struct device *dev)
616592 {
617593 union acpi_object *r;
618594 int val;
619595
620− r = lg_wmab(WM_KEY_LIGHT, WM_GET, 0);
596+ r = lg_wmab(dev, WM_KEY_LIGHT, WM_GET, 0);
621597
622598 if (!r)
623599 return LED_OFF;
@@ -645,7 +621,7 @@ static enum led_brightness get_kbd_backlight_level(void) · 21 unmodified lines
645621
646622 static enum led_brightness kbd_backlight_get(struct led_classdev *cdev)
647623 {
648− return get_kbd_backlight_level();
624+ return get_kbd_backlight_level(cdev->dev->parent);
649625 }
650626
651627 static LED_DEVICE(kbd_backlight, 255, LED_BRIGHT_HW_CHANGED);
@@ -672,6 +648,11 @@ static struct platform_driver pf_driver = { · 20 unmodified lines
672648
673649 static int acpi_add(struct acpi_device *device)
674650 {
651+ struct platform_device_info pdev_info = {
652+ .fwnode = acpi_fwnode_handle(device),
653+ .name = PLATFORM_NAME,
654+ .id = PLATFORM_DEVID_NONE,
655+ };
675656 int ret;
676657 const char *product;
677658 int year = 2017;
@@ -683,9 +664,7 @@ static int acpi_add(struct acpi_device *device) · 5 unmodified lines
683664 if (ret)
684665 return ret;
685666
686− pf_device = platform_device_register_simple(PLATFORM_NAME,
687− PLATFORM_DEVID_NONE,
688− NULL, 0);
667+ pf_device = platform_device_register_full(&pdev_info);
689668 if (IS_ERR(pf_device)) {
690669 ret = PTR_ERR(pf_device);
691670 pf_device = NULL;
@@ -776,7 +755,7 @@ static void acpi_remove(struct acpi_device *device) · 84 unmodified lines
776755 }
777756
778757 static const struct acpi_device_id device_ids[] = {
779− {"LGEX0815", 0},
758+ {"LGEX0820", 0},
780759 {"", 0}
781760 };
782761 MODULE_DEVICE_TABLE(acpi, device_ids);
drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c+1−0
@@ -45,6 +45,7 @@ static struct platform_driver simatic_ipc_batt_driver = { · 44 unmodified lines
4545
4646 module_platform_driver(simatic_ipc_batt_driver);
4747
48+MODULE_DESCRIPTION("CMOS Battery monitoring for Simatic IPCs based on Apollo Lake GPIO");
4849 MODULE_LICENSE("GPL");
4950 MODULE_ALIAS("platform:" KBUILD_MODNAME);
5051 MODULE_SOFTDEP("pre: simatic-ipc-batt platform:apollolake-pinctrl");
drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c+1−0
@@ -45,6 +45,7 @@ static struct platform_driver simatic_ipc_batt_driver = { · 44 unmodified lines
4545
4646 module_platform_driver(simatic_ipc_batt_driver);
4747
48+MODULE_DESCRIPTION("CMOS Battery monitoring for Simatic IPCs based on Elkhart Lake GPIO");
4849 MODULE_LICENSE("GPL");
4950 MODULE_ALIAS("platform:" KBUILD_MODNAME);
5051 MODULE_SOFTDEP("pre: simatic-ipc-batt platform:elkhartlake-pinctrl");
drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c+1−0
@@ -81,6 +81,7 @@ static struct platform_driver simatic_ipc_batt_driver = { · 80 unmodified lines
8181
8282 module_platform_driver(simatic_ipc_batt_driver);
8383
84+MODULE_DESCRIPTION("CMOS Battery monitoring for Simatic IPCs based on Nuvoton GPIO");
8485 MODULE_LICENSE("GPL");
8586 MODULE_ALIAS("platform:" KBUILD_MODNAME);
8687 MODULE_SOFTDEP("pre: simatic-ipc-batt gpio_f7188x platform:elkhartlake-pinctrl platform:alderlake-pinctrl");
drivers/platform/x86/siemens/simatic-ipc-batt.c+1−0
@@ -247,6 +247,7 @@ static struct platform_driver simatic_ipc_batt_driver = { · 246 unmodified lines
247247
248248 module_platform_driver(simatic_ipc_batt_driver);
249249
250+MODULE_DESCRIPTION("CMOS core battery driver for Siemens Simatic IPCs");
250251 MODULE_LICENSE("GPL");
251252 MODULE_ALIAS("platform:" KBUILD_MODNAME);
252253 MODULE_AUTHOR("Henning Schild <henning.schild@siemens.com>");
drivers/platform/x86/siemens/simatic-ipc.c+1−0
@@ -231,6 +231,7 @@ static void __exit simatic_ipc_exit_module(void) · 230 unmodified lines
231231 module_init(simatic_ipc_init_module);
232232 module_exit(simatic_ipc_exit_module);
233233
234+MODULE_DESCRIPTION("Siemens SIMATIC IPC platform driver");
234235 MODULE_LICENSE("GPL v2");
235236 MODULE_AUTHOR("Gerd Haeussler <gerd.haeussler.ext@siemens.com>");
236237 MODULE_ALIAS("dmi:*:svnSIEMENSAG:*");
drivers/platform/x86/toshiba_acpi.c+18−13
@@ -3271,7 +3271,7 @@ static const char *find_hci_method(acpi_handle handle) · 3270 unmodified lines
32713271 */
32723272 #define QUIRK_HCI_HOTKEY_QUICKSTART BIT(1)
32733273
3274−static const struct dmi_system_id toshiba_dmi_quirks[] = {
3274+static const struct dmi_system_id toshiba_dmi_quirks[] __initconst = {
32753275 {
32763276 /* Toshiba Portégé R700 */
32773277 /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
@@ -3306,8 +3306,6 @@ static int toshiba_acpi_add(struct acpi_device *acpi_dev) · 28 unmodified lines
33063306 struct toshiba_acpi_dev *dev;
33073307 const char *hci_method;
33083308 u32 dummy;
3309− const struct dmi_system_id *dmi_id;
3310− long quirks = 0;
33113309 int ret = 0;
33123310
33133311 if (toshiba_acpi)
@@ -3460,16 +3458,6 @@ iio_error: · 146 unmodified lines
34603458 }
34613459 #endif
34623460
3463− dmi_id = dmi_first_match(toshiba_dmi_quirks);
3464− if (dmi_id)
3465− quirks = (long)dmi_id->driver_data;
3466−
3467− if (turn_on_panel_on_resume == -1)
3468− turn_on_panel_on_resume = !!(quirks & QUIRK_TURN_ON_PANEL_ON_RESUME);
3469−
3470− if (hci_hotkey_quickstart == -1)
3471− hci_hotkey_quickstart = !!(quirks & QUIRK_HCI_HOTKEY_QUICKSTART);
3472−
34733461 toshiba_wwan_available(dev);
34743462 if (dev->wwan_supported)
34753463 toshiba_acpi_setup_wwan_rfkill(dev);
@@ -3618,10 +3606,27 @@ static struct acpi_driver toshiba_acpi_driver = { · 142 unmodified lines
36183606 .drv.pm = &toshiba_acpi_pm,
36193607 };
36203608
3609+static void __init toshiba_dmi_init(void)
3610+{
3611+ const struct dmi_system_id *dmi_id;
3612+ long quirks = 0;
3613+
3614+ dmi_id = dmi_first_match(toshiba_dmi_quirks);
3615+ if (dmi_id)
3616+ quirks = (long)dmi_id->driver_data;
3617+
3618+ if (turn_on_panel_on_resume == -1)
3619+ turn_on_panel_on_resume = !!(quirks & QUIRK_TURN_ON_PANEL_ON_RESUME);
3620+
3621+ if (hci_hotkey_quickstart == -1)
3622+ hci_hotkey_quickstart = !!(quirks & QUIRK_HCI_HOTKEY_QUICKSTART);
3623+}
3624+
36213625 static int __init toshiba_acpi_init(void)
36223626 {
36233627 int ret;
36243628
3629+ toshiba_dmi_init();
36253630 toshiba_proc_dir = proc_mkdir(PROC_TOSHIBA, acpi_root_dir);
36263631 if (!toshiba_proc_dir) {
36273632 pr_err("Unable to create proc dir " PROC_TOSHIBA "\n");
drivers/platform/x86/uv_sysfs.c+1−0
@@ -929,4 +929,5 @@ module_init(uv_sysfs_init); · 928 unmodified lines
929929 module_exit(uv_sysfs_exit);
930930
931931 MODULE_AUTHOR("Hewlett Packard Enterprise");
932+MODULE_DESCRIPTION("Sysfs structure for HPE UV systems");
932933 MODULE_LICENSE("GPL");
drivers/platform/x86/wireless-hotkey.c+3−0
@@ -14,11 +14,13 @@ · 13 unmodified lines
1414 #include <linux/acpi.h>
1515 #include <acpi/acpi_bus.h>
1616
17+MODULE_DESCRIPTION("Airplane mode button for AMD, HP & Xiaomi laptops");
1718 MODULE_LICENSE("GPL");
1819 MODULE_AUTHOR("Alex Hung");
1920 MODULE_ALIAS("acpi*:HPQ6001:*");
2021 MODULE_ALIAS("acpi*:WSTADEF:*");
2122 MODULE_ALIAS("acpi*:AMDI0051:*");
23+MODULE_ALIAS("acpi*:LGEX0815:*");
2224
2325 struct wl_button {
2426 struct input_dev *input_dev;
@@ -29,6 +31,7 @@ static const struct acpi_device_id wl_ids[] = { · 4 unmodified lines
2931 {"HPQ6001", 0},
3032 {"WSTADEF", 0},
3133 {"AMDI0051", 0},
34+ {"LGEX0815", 0},
3235 {"", 0},
3336 };
3437
drivers/platform/x86/xo1-rfkill.c+1−0
@@ -74,5 +74,6 @@ static struct platform_driver xo1_rfkill_driver = { · 73 unmodified lines
7474 module_platform_driver(xo1_rfkill_driver);
7575
7676 MODULE_AUTHOR("Daniel Drake <dsd@laptop.org>");
77+MODULE_DESCRIPTION("OLPC XO-1 software RF kill switch");
7778 MODULE_LICENSE("GPL");
7879 MODULE_ALIAS("platform:xo1-rfkill");
drivers/reset/Kconfig+1−0
@@ -68,6 +68,7 @@ config RESET_BRCMSTB_RESCAL · 67 unmodified lines
6868
6969 config RESET_GPIO
7070 tristate "GPIO reset controller"
71+ depends on GPIOLIB
7172 help
7273 This enables a generic reset controller for resets attached via
7374 GPIOs. Typically for OF platforms this driver expects "reset-gpios"
drivers/reset/hisilicon/hi6220_reset.c+1−0
@@ -219,4 +219,5 @@ static int __init hi6220_reset_init(void) · 218 unmodified lines
219219
220220 postcore_initcall(hi6220_reset_init);
221221
222+MODULE_DESCRIPTION("Hisilicon Hi6220 reset controller driver");
222223 MODULE_LICENSE("GPL v2");
drivers/s390/block/dasd_eckd.c+2−2
@@ -4906,7 +4906,7 @@ dasd_eckd_free_cp(struct dasd_ccw_req *cqr, struct request *req) · 4905 unmodified lines
49064906 ccw++;
49074907 if (dst) {
49084908 if (ccw->flags & CCW_FLAG_IDA)
4909− cda = *((char **)dma32_to_virt(ccw->cda));
4909+ cda = dma64_to_virt(*((dma64_t *)dma32_to_virt(ccw->cda)));
49104910 else
49114911 cda = dma32_to_virt(ccw->cda);
49124912 if (dst != cda) {
@@ -5525,7 +5525,7 @@ dasd_eckd_dump_ccw_range(struct dasd_device *device, struct ccw1 *from, · 612 unmodified lines
55255525
55265526 /* get pointer to data (consider IDALs) */
55275527 if (from->flags & CCW_FLAG_IDA)
5528− datap = (char *)*((addr_t *)dma32_to_virt(from->cda));
5528+ datap = dma64_to_virt(*((dma64_t *)dma32_to_virt(from->cda)));
55295529 else
55305530 datap = dma32_to_virt(from->cda);
55315531
drivers/s390/block/dasd_fba.c+1−1
@@ -585,7 +585,7 @@ dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req) · 584 unmodified lines
585585 ccw++;
586586 if (dst) {
587587 if (ccw->flags & CCW_FLAG_IDA)
588− cda = *((char **)dma32_to_virt(ccw->cda));
588+ cda = dma64_to_virt(*((dma64_t *)dma32_to_virt(ccw->cda)));
589589 else
590590 cda = dma32_to_virt(ccw->cda);
591591 if (dst != cda) {
drivers/s390/char/sclp.c+1−0
@@ -1293,6 +1293,7 @@ sclp_init(void) · 1292 unmodified lines
12931293 fail_unregister_reboot_notifier:
12941294 unregister_reboot_notifier(&sclp_reboot_notifier);
12951295 fail_init_state_uninitialized:
1296+ list_del(&sclp_state_change_event.list);
12961297 sclp_init_state = sclp_init_state_uninitialized;
12971298 free_page((unsigned long) sclp_read_sccb);
12981299 free_page((unsigned long) sclp_init_sccb);
drivers/s390/cio/vfio_ccw_cp.c+5−4
@@ -490,13 +490,14 @@ static int ccwchain_fetch_tic(struct ccw1 *ccw, · 489 unmodified lines
490490 struct channel_program *cp)
491491 {
492492 struct ccwchain *iter;
493− u32 cda, ccw_head;
493+ u32 offset, ccw_head;
494494
495495 list_for_each_entry(iter, &cp->ccwchain_list, next) {
496496 ccw_head = iter->ch_iova;
497497 if (is_cpa_within_range(ccw->cda, ccw_head, iter->ch_len)) {
498− cda = (u64)iter->ch_ccw + dma32_to_u32(ccw->cda) - ccw_head;
499− ccw->cda = u32_to_dma32(cda);
498+ /* Calculate offset of TIC target */
499+ offset = dma32_to_u32(ccw->cda) - ccw_head;
500+ ccw->cda = virt_to_dma32((void *)iter->ch_ccw + offset);
500501 return 0;
501502 }
502503 }
@@ -914,7 +915,7 @@ void cp_update_scsw(struct channel_program *cp, union scsw *scsw) · 411 unmodified lines
914915 * in the ioctl directly. Path status changes etc.
915916 */
916917 list_for_each_entry(chain, &cp->ccwchain_list, next) {
917− ccw_head = (u32)(u64)chain->ch_ccw;
918+ ccw_head = dma32_to_u32(virt_to_dma32(chain->ch_ccw));
918919 /*
919920 * On successful execution, cpa points just beyond the end
920921 * of the chain.
drivers/s390/virtio/virtio_ccw.c+3−1
@@ -698,6 +698,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 697 unmodified lines
698698 dma64_t *indicatorp = NULL;
699699 int ret, i, queue_idx = 0;
700700 struct ccw1 *ccw;
701+ dma32_t indicatorp_dma = 0;
701702
702703 ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw), NULL);
703704 if (!ccw)
@@ -725,7 +726,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 21 unmodified lines
725726 */
726727 indicatorp = ccw_device_dma_zalloc(vcdev->cdev,
727728 sizeof(*indicatorp),
728− &ccw->cda);
729+ &indicatorp_dma);
729730 if (!indicatorp)
730731 goto out;
731732 *indicatorp = indicators_dma(vcdev);
@@ -735,6 +736,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 3 unmodified lines
735736 /* no error, just fall back to legacy interrupts */
736737 vcdev->is_thinint = false;
737738 }
739+ ccw->cda = indicatorp_dma;
738740 if (!vcdev->is_thinint) {
739741 /* Register queue indicators with host. */
740742 *indicators(vcdev) = 0;
drivers/scsi/libsas/sas_ata.c+3−3
@@ -610,15 +610,15 @@ int sas_ata_init(struct domain_device *found_dev) · 609 unmodified lines
610610
611611 rc = ata_sas_tport_add(ata_host->dev, ap);
612612 if (rc)
613− goto destroy_port;
613+ goto free_port;
614614
615615 found_dev->sata_dev.ata_host = ata_host;
616616 found_dev->sata_dev.ap = ap;
617617
618618 return 0;
619619
620−destroy_port:
621− kfree(ap);
620+free_port:
621+ ata_port_free(ap);
622622 free_host:
623623 ata_host_put(ata_host);
624624 return rc;
drivers/scsi/libsas/sas_discover.c+1−1
@@ -301,7 +301,7 @@ void sas_free_device(struct kref *kref) · 300 unmodified lines
301301
302302 if (dev_is_sata(dev) && dev->sata_dev.ap) {
303303 ata_sas_tport_delete(dev->sata_dev.ap);
304− kfree(dev->sata_dev.ap);
304+ ata_port_free(dev->sata_dev.ap);
305305 ata_host_put(dev->sata_dev.ata_host);
306306 dev->sata_dev.ata_host = NULL;
307307 dev->sata_dev.ap = NULL;
drivers/scsi/libsas/sas_internal.h+14−0
@@ -145,6 +145,20 @@ static inline void sas_fail_probe(struct domain_device *dev, const char *func, i · 144 unmodified lines
145145 func, dev->parent ? "exp-attached" :
146146 "direct-attached",
147147 SAS_ADDR(dev->sas_addr), err);
148+
149+ /*
150+ * If the device probe failed, the expander phy attached address
151+ * needs to be reset so that the phy will not be treated as flutter
152+ * in the next revalidation
153+ */
154+ if (dev->parent && !dev_is_expander(dev->dev_type)) {
155+ struct sas_phy *phy = dev->phy;
156+ struct domain_device *parent = dev->parent;
157+ struct ex_phy *ex_phy = &parent->ex_dev.ex_phy[phy->number];
158+
159+ memset(ex_phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
160+ }
161+
148162 sas_unregister_dev(dev->port, dev);
149163 }
150164
drivers/scsi/scsi_debug.c+5−1
@@ -926,6 +926,7 @@ static const int device_qfull_result = · 925 unmodified lines
926926 static const int condition_met_result = SAM_STAT_CONDITION_MET;
927927
928928 static struct dentry *sdebug_debugfs_root;
929+static ASYNC_DOMAIN_EXCLUSIVE(sdebug_async_domain);
929930
930931 static void sdebug_err_free(struct rcu_head *head)
931932 {
@@ -1148,6 +1149,8 @@ static int sdebug_target_alloc(struct scsi_target *starget) · 216 unmodified lines
11481149 if (!targetip)
11491150 return -ENOMEM;
11501151
1152+ async_synchronize_full_domain(&sdebug_async_domain);
1153+
11511154 targetip->debugfs_entry = debugfs_create_dir(dev_name(&starget->dev),
11521155 sdebug_debugfs_root);
11531156
@@ -1174,7 +1177,8 @@ static void sdebug_target_destroy(struct scsi_target *starget) · 20 unmodified lines
11741177 targetip = (struct sdebug_target_info *)starget->hostdata;
11751178 if (targetip) {
11761179 starget->hostdata = NULL;
1177− async_schedule(sdebug_tartget_cleanup_async, targetip);
1180+ async_schedule_domain(sdebug_tartget_cleanup_async, targetip,
1181+ &sdebug_async_domain);
11781182 }
11791183 }
11801184
drivers/soc/litex/Kconfig+1−1
@@ -7,7 +7,7 @@ config LITEX · 6 unmodified lines
77
88 config LITEX_SOC_CONTROLLER
99 tristate "Enable LiteX SoC Controller driver"
10− depends on OF || COMPILE_TEST
10+ depends on OF
1111 depends on HAS_IOMEM
1212 select LITEX
1313 help
drivers/soc/litex/litex_soc_ctrl.c+1−3
@@ -82,13 +82,11 @@ static int litex_reset_handler(struct notifier_block *this, unsigned long mode, · 81 unmodified lines
8282 return NOTIFY_DONE;
8383 }
8484
85−#ifdef CONFIG_OF
8685 static const struct of_device_id litex_soc_ctrl_of_match[] = {
8786 {.compatible = "litex,soc-controller"},
8887 {},
8988 };
9089 MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match);
91−#endif /* CONFIG_OF */
9290
9391 static int litex_soc_ctrl_probe(struct platform_device *pdev)
9492 {
@@ -130,7 +128,7 @@ static void litex_soc_ctrl_remove(struct platform_device *pdev) · 35 unmodified lines
130128 static struct platform_driver litex_soc_ctrl_driver = {
131129 .driver = {
132130 .name = "litex-soc-controller",
133− .of_match_table = of_match_ptr(litex_soc_ctrl_of_match)
131+ .of_match_table = litex_soc_ctrl_of_match,
134132 },
135133 .probe = litex_soc_ctrl_probe,
136134 .remove_new = litex_soc_ctrl_remove,
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c+2−2
@@ -707,7 +707,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance · 706 unmodified lines
707707 * block forever.
708708 */
709709 for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
710− if (state)
710+ if (vchiq_remote_initialised(state))
711711 break;
712712 usleep_range(500, 600);
713713 }
@@ -1202,7 +1202,7 @@ void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f · 488 unmodified lines
12021202 {
12031203 int i;
12041204
1205− if (!state)
1205+ if (!vchiq_remote_initialised(state))
12061206 return;
12071207
12081208 /*
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h+5−0
@@ -413,6 +413,11 @@ struct vchiq_state { · 412 unmodified lines
413413 struct opaque_platform_state *platform_state;
414414 };
415415
416+static inline bool vchiq_remote_initialised(const struct vchiq_state *state)
417+{
418+ return state->remote && state->remote->initialised;
419+}
420+
416421 struct bulk_waiter {
417422 struct vchiq_bulk *bulk;
418423 struct completion event;
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c+1−1
@@ -138,7 +138,7 @@ void vchiq_debugfs_deinit(void) · 137 unmodified lines
138138
139139 #else /* CONFIG_DEBUG_FS */
140140
141−void vchiq_debugfs_init(void)
141+void vchiq_debugfs_init(struct vchiq_state *state)
142142 {
143143 }
144144
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c+6−1
@@ -1170,6 +1170,11 @@ static int vchiq_open(struct inode *inode, struct file *file) · 1169 unmodified lines
11701170
11711171 dev_dbg(state->dev, "arm: vchiq open\n");
11721172
1173+ if (!vchiq_remote_initialised(state)) {
1174+ dev_dbg(state->dev, "arm: vchiq has no connection to VideoCore\n");
1175+ return -ENOTCONN;
1176+ }
1177+
11731178 instance = kzalloc(sizeof(*instance), GFP_KERNEL);
11741179 if (!instance)
11751180 return -ENOMEM;
@@ -1200,7 +1205,7 @@ static int vchiq_release(struct inode *inode, struct file *file) · 24 unmodified lines
12001205
12011206 dev_dbg(state->dev, "arm: instance=%p\n", instance);
12021207
1203− if (!state) {
1208+ if (!vchiq_remote_initialised(state)) {
12041209 ret = -EPERM;
12051210 goto out;
12061211 }
drivers/tee/optee/ffa_abi.c+9−3
@@ -660,7 +660,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev, · 659 unmodified lines
660660 const struct ffa_ops *ops)
661661 {
662662 const struct ffa_msg_ops *msg_ops = ops->msg_ops;
663− struct ffa_send_direct_data data = { OPTEE_FFA_GET_API_VERSION };
663+ struct ffa_send_direct_data data = {
664+ .data0 = OPTEE_FFA_GET_API_VERSION,
665+ };
664666 int rc;
665667
666668 msg_ops->mode_32bit_set(ffa_dev);
@@ -677,7 +679,9 @@ static bool optee_ffa_api_is_compatbile(struct ffa_device *ffa_dev, · 10 unmodified lines
677679 return false;
678680 }
679681
680− data = (struct ffa_send_direct_data){ OPTEE_FFA_GET_OS_VERSION };
682+ data = (struct ffa_send_direct_data){
683+ .data0 = OPTEE_FFA_GET_OS_VERSION,
684+ };
681685 rc = msg_ops->sync_send_receive(ffa_dev, &data);
682686 if (rc) {
683687 pr_err("Unexpected error %d\n", rc);
@@ -698,7 +702,9 @@ static bool optee_ffa_exchange_caps(struct ffa_device *ffa_dev, · 14 unmodified lines
698702 unsigned int *rpc_param_count,
699703 unsigned int *max_notif_value)
700704 {
701− struct ffa_send_direct_data data = { OPTEE_FFA_EXCHANGE_CAPABILITIES };
705+ struct ffa_send_direct_data data = {
706+ .data0 = OPTEE_FFA_EXCHANGE_CAPABILITIES,
707+ };
702708 int rc;
703709
704710 rc = ops->msg_ops->sync_send_receive(ffa_dev, &data);
drivers/thermal/gov_step_wise.c+5−18
@@ -55,7 +55,11 @@ static unsigned long get_target_state(struct thermal_instance *instance, · 54 unmodified lines
5555 if (cur_state <= instance->lower)
5656 return THERMAL_NO_TARGET;
5757
58− return clamp(cur_state - 1, instance->lower, instance->upper);
58+ /*
59+ * If 'throttle' is false, no mitigation is necessary, so
60+ * request the lower state for this instance.
61+ */
62+ return instance->lower;
5963 }
6064
6165 return instance->target;
@@ -93,23 +97,6 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, · 31 unmodified lines
9397 if (instance->initialized && old_target == instance->target)
9498 continue;
9599
96− if (trip->type == THERMAL_TRIP_PASSIVE) {
97− /*
98− * If the target state for this thermal instance
99− * changes from THERMAL_NO_TARGET to something else,
100− * ensure that the zone temperature will be updated
101− * (assuming enabled passive cooling) until it becomes
102− * THERMAL_NO_TARGET again, or the cooling device may
103− * not be reset to its initial state.
104− */
105− if (old_target == THERMAL_NO_TARGET &&
106− instance->target != THERMAL_NO_TARGET)
107− tz->passive++;
108− else if (old_target != THERMAL_NO_TARGET &&
109− instance->target == THERMAL_NO_TARGET)
110− tz->passive--;
111− }
112−
113100 instance->initialized = true;
114101
115102 mutex_lock(&instance->cdev->lock);
drivers/tty/mxser.c+1−1
@@ -288,7 +288,7 @@ struct mxser_board { · 287 unmodified lines
288288 enum mxser_must_hwid must_hwid;
289289 speed_t max_baud;
290290
291− struct mxser_port ports[] __counted_by(nports);
291+ struct mxser_port ports[] /* __counted_by(nports) */;
292292 };
293293
294294 static DECLARE_BITMAP(mxser_boards, MXSER_BOARDS);
drivers/tty/serial/8250/8250_core.c+0−5
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 */
1616
1717 #include <linux/acpi.h>
18−#include <linux/cleanup.h>
1918 #include <linux/module.h>
2019 #include <linux/moduleparam.h>
2120 #include <linux/ioport.h>
@@ -42,8 +41,6 @@ · 20 unmodified lines
4241
4342 #include <asm/irq.h>
4443
45−#include "../serial_base.h" /* For serial_base_add_isa_preferred_console() */
46−
4744 #include "8250.h"
4845
4946 /*
@@ -563,8 +560,6 @@ static void __init serial8250_isa_init_ports(void) · 513 unmodified lines
563560 port->irqflags |= irqflag;
564561 if (serial8250_isa_config != NULL)
565562 serial8250_isa_config(i, &up->port, &up->capabilities);
566−
567− serial_base_add_isa_preferred_console(serial8250_reg.dev_name, i);
568563 }
569564 }
570565
drivers/tty/serial/8250/8250_omap.c+20−5
@@ -115,6 +115,10 @@ · 114 unmodified lines
115115 /* RX FIFO occupancy indicator */
116116 #define UART_OMAP_RX_LVL 0x19
117117
118+/* Timeout low and High */
119+#define UART_OMAP_TO_L 0x26
120+#define UART_OMAP_TO_H 0x27
121+
118122 /*
119123 * Copy of the genpd flags for the console.
120124 * Only used if console suspend is disabled
@@ -663,13 +667,24 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) · 542 unmodified lines
663667
664668 /*
665669 * On K3 SoCs, it is observed that RX TIMEOUT is signalled after
666− * FIFO has been drained, in which case a dummy read of RX FIFO
667− * is required to clear RX TIMEOUT condition.
670+ * FIFO has been drained or erroneously.
671+ * So apply solution of Errata i2310 as mentioned in
672+ * https://www.ti.com/lit/pdf/sprz536
668673 */
669674 if (priv->habit & UART_RX_TIMEOUT_QUIRK &&
670− (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT &&
671− serial_port_in(port, UART_OMAP_RX_LVL) == 0) {
672− serial_port_in(port, UART_RX);
675+ (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT) {
676+ unsigned char efr2, timeout_h, timeout_l;
677+
678+ efr2 = serial_in(up, UART_OMAP_EFR2);
679+ timeout_h = serial_in(up, UART_OMAP_TO_H);
680+ timeout_l = serial_in(up, UART_OMAP_TO_L);
681+ serial_out(up, UART_OMAP_TO_H, 0xFF);
682+ serial_out(up, UART_OMAP_TO_L, 0xFF);
683+ serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE);
684+ serial_in(up, UART_IIR);
685+ serial_out(up, UART_OMAP_EFR2, efr2);
686+ serial_out(up, UART_OMAP_TO_H, timeout_h);
687+ serial_out(up, UART_OMAP_TO_L, timeout_l);
673688 }
674689
675690 /* Stop processing interrupts on input overrun */
drivers/tty/serial/8250/8250_pci.c+12−1
@@ -1985,6 +1985,17 @@ enum { · 1984 unmodified lines
19851985 MOXA_SUPP_RS485 = BIT(2),
19861986 };
19871987
1988+static unsigned short moxa_get_nports(unsigned short device)
1989+{
1990+ switch (device) {
1991+ case PCI_DEVICE_ID_MOXA_CP116E_A_A:
1992+ case PCI_DEVICE_ID_MOXA_CP116E_A_B:
1993+ return 8;
1994+ }
1995+
1996+ return FIELD_GET(0x00F0, device);
1997+}
1998+
19881999 static bool pci_moxa_is_mini_pcie(unsigned short device)
19892000 {
19902001 if (device == PCI_DEVICE_ID_MOXA_CP102N ||
@@ -2038,7 +2049,7 @@ static int pci_moxa_init(struct pci_dev *dev) · 47 unmodified lines
20382049 {
20392050 unsigned short device = dev->device;
20402051 resource_size_t iobar_addr = pci_resource_start(dev, 2);
2041− unsigned int num_ports = (device & 0x00F0) >> 4, i;
2052+ unsigned int i, num_ports = moxa_get_nports(device);
20422053 u8 val, init_mode = MOXA_RS232;
20432054
20442055 if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) {
drivers/tty/serial/bcm63xx_uart.c+5−2
@@ -308,8 +308,8 @@ static void bcm_uart_do_tx(struct uart_port *port) · 307 unmodified lines
308308
309309 val = bcm_uart_readl(port, UART_MCTL_REG);
310310 val = (val & UART_MCTL_TXFIFOFILL_MASK) >> UART_MCTL_TXFIFOFILL_SHIFT;
311−
312− pending = uart_port_tx_limited(port, ch, port->fifosize - val,
311+ pending = uart_port_tx_limited_flags(port, ch, UART_TX_NOSTOP,
312+ port->fifosize - val,
313313 true,
314314 bcm_uart_writel(port, ch, UART_FIFO_REG),
315315 ({}));
@@ -320,6 +320,9 @@ static void bcm_uart_do_tx(struct uart_port *port) · 4 unmodified lines
320320 val = bcm_uart_readl(port, UART_IR_REG);
321321 val &= ~UART_TX_INT_MASK;
322322 bcm_uart_writel(port, val, UART_IR_REG);
323+
324+ if (uart_tx_stopped(port))
325+ bcm_uart_stop_tx(port);
323326 }
324327
325328 /*
drivers/tty/serial/imx.c+3−1
@@ -1952,8 +1952,10 @@ static int imx_uart_rs485_config(struct uart_port *port, struct ktermios *termio · 1951 unmodified lines
19521952
19531953 /* Make sure Rx is enabled in case Tx is active with Rx disabled */
19541954 if (!(rs485conf->flags & SER_RS485_ENABLED) ||
1955− rs485conf->flags & SER_RS485_RX_DURING_TX)
1955+ rs485conf->flags & SER_RS485_RX_DURING_TX) {
1956+ imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT);
19561957 imx_uart_start_rx(port);
1958+ }
19571959
19581960 return 0;
19591961 }
drivers/tty/serial/mcf.c+1−1
@@ -462,7 +462,7 @@ static const struct uart_ops mcf_uart_ops = { · 461 unmodified lines
462462 .verify_port = mcf_verify_port,
463463 };
464464
465−static struct mcf_uart mcf_ports[4];
465+static struct mcf_uart mcf_ports[10];
466466
467467 #define MCF_MAXPORTS ARRAY_SIZE(mcf_ports)
468468
drivers/tty/serial/serial_base.h+0−30
@@ -49,33 +49,3 @@ void serial_ctrl_unregister_port(struct uart_driver *drv, struct uart_port *port · 48 unmodified lines
4949
5050 int serial_core_register_port(struct uart_driver *drv, struct uart_port *port);
5151 void serial_core_unregister_port(struct uart_driver *drv, struct uart_port *port);
52−
53−#ifdef CONFIG_SERIAL_CORE_CONSOLE
54−
55−int serial_base_add_preferred_console(struct uart_driver *drv,
56− struct uart_port *port);
57−
58−#else
59−
60−static inline
61−int serial_base_add_preferred_console(struct uart_driver *drv,
62− struct uart_port *port)
63−{
64− return 0;
65−}
66−
67−#endif
68−
69−#ifdef CONFIG_SERIAL_8250_CONSOLE
70−
71−int serial_base_add_isa_preferred_console(const char *name, int idx);
72−
73−#else
74−
75−static inline
76−int serial_base_add_isa_preferred_console(const char *name, int idx)
77−{
78− return 0;
79−}
80−
81−#endif
drivers/tty/serial/serial_base_bus.c+0−129
@@ -8,7 +8,6 @@ · 7 unmodified lines
88 * The serial core bus manages the serial core controller instances.
99 */
1010
11−#include <linux/cleanup.h>
1211 #include <linux/container_of.h>
1312 #include <linux/device.h>
1413 #include <linux/idr.h>
@@ -205,134 +204,6 @@ void serial_base_port_device_remove(struct serial_port_device *port_dev) · 190 unmodified lines
205204 put_device(&port_dev->dev);
206205 }
207206
208−#ifdef CONFIG_SERIAL_CORE_CONSOLE
209−
210−static int serial_base_add_one_prefcon(const char *match, const char *dev_name,
211− int port_id)
212−{
213− int ret;
214−
215− ret = add_preferred_console_match(match, dev_name, port_id);
216− if (ret == -ENOENT)
217− return 0;
218−
219− return ret;
220−}
221−
222−#ifdef __sparc__
223−
224−/* Handle Sparc ttya and ttyb options as done in console_setup() */
225−static int serial_base_add_sparc_console(const char *dev_name, int idx)
226−{
227− const char *name;
228−
229− switch (idx) {
230− case 0:
231− name = "ttya";
232− break;
233− case 1:
234− name = "ttyb";
235− break;
236− default:
237− return 0;
238− }
239−
240− return serial_base_add_one_prefcon(name, dev_name, idx);
241−}
242−
243−#else
244−
245−static inline int serial_base_add_sparc_console(const char *dev_name, int idx)
246−{
247− return 0;
248−}
249−
250−#endif
251−
252−static int serial_base_add_prefcon(const char *name, int idx)
253−{
254− const char *char_match __free(kfree) = NULL;
255− const char *nmbr_match __free(kfree) = NULL;
256− int ret;
257−
258− /* Handle ttyS specific options */
259− if (strstarts(name, "ttyS")) {
260− /* No name, just a number */
261− nmbr_match = kasprintf(GFP_KERNEL, "%i", idx);
262− if (!nmbr_match)
263− return -ENODEV;
264−
265− ret = serial_base_add_one_prefcon(nmbr_match, name, idx);
266− if (ret)
267− return ret;
268−
269− /* Sparc ttya and ttyb */
270− ret = serial_base_add_sparc_console(name, idx);
271− if (ret)
272− return ret;
273− }
274−
275− /* Handle the traditional character device name style console=ttyS0 */
276− char_match = kasprintf(GFP_KERNEL, "%s%i", name, idx);
277− if (!char_match)
278− return -ENOMEM;
279−
280− return serial_base_add_one_prefcon(char_match, name, idx);
281−}
282−
283−/**
284− * serial_base_add_preferred_console - Adds a preferred console
285− * @drv: Serial port device driver
286− * @port: Serial port instance
287− *
288− * Tries to add a preferred console for a serial port if specified in the
289− * kernel command line. Supports both the traditional character device such
290− * as console=ttyS0, and a hardware addressing based console=DEVNAME:0.0
291− * style name.
292− *
293− * Translates the kernel command line option using a hardware based addressing
294− * console=DEVNAME:0.0 to the serial port character device such as ttyS0.
295− * Cannot be called early for ISA ports, depends on struct device.
296− *
297− * Note that duplicates are ignored by add_preferred_console().
298− *
299− * Return: 0 on success, negative error code on failure.
300− */
301−int serial_base_add_preferred_console(struct uart_driver *drv,
302− struct uart_port *port)
303−{
304− const char *port_match __free(kfree) = NULL;
305− int ret;
306−
307− ret = serial_base_add_prefcon(drv->dev_name, port->line);
308− if (ret)
309− return ret;
310−
311− port_match = kasprintf(GFP_KERNEL, "%s:%i.%i", dev_name(port->dev),
312− port->ctrl_id, port->port_id);
313− if (!port_match)
314− return -ENOMEM;
315−
316− /* Translate a hardware addressing style console=DEVNAME:0.0 */
317− return serial_base_add_one_prefcon(port_match, drv->dev_name, port->line);
318−}
319−
320−#endif
321−
322−#ifdef CONFIG_SERIAL_8250_CONSOLE
323−
324−/*
325− * Early ISA ports initialize the console before there is no struct device.
326− * This should be only called from serial8250_isa_init_preferred_console(),
327− * other callers are likely wrong and should rely on earlycon instead.
328− */
329−int serial_base_add_isa_preferred_console(const char *name, int idx)
330−{
331− return serial_base_add_prefcon(name, idx);
332−}
333−
334−#endif
335−
336207 static int serial_base_init(void)
337208 {
338209 int ret;
drivers/tty/serial/serial_core.c+0−4
@@ -3422,10 +3422,6 @@ int serial_core_register_port(struct uart_driver *drv, struct uart_port *port) · 3421 unmodified lines
34223422 if (ret)
34233423 goto err_unregister_ctrl_dev;
34243424
3425− ret = serial_base_add_preferred_console(drv, port);
3426− if (ret)
3427− goto err_unregister_port_dev;
3428−
34293425 ret = serial_core_add_one_port(drv, port);
34303426 if (ret)
34313427 goto err_unregister_port_dev;
drivers/usb/atm/cxacru.c+14−0
@@ -1131,6 +1131,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, · 1130 unmodified lines
11311131 struct cxacru_data *instance;
11321132 struct usb_device *usb_dev = interface_to_usbdev(intf);
11331133 struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD];
1134+ struct usb_endpoint_descriptor *in, *out;
11341135 int ret;
11351136
11361137 /* instance init */
@@ -1177,6 +1178,19 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, · 40 unmodified lines
11771178 goto fail;
11781179 }
11791180
1181+ if (usb_endpoint_xfer_int(&cmd_ep->desc))
1182+ ret = usb_find_common_endpoints(intf->cur_altsetting,
1183+ NULL, NULL, &in, &out);
1184+ else
1185+ ret = usb_find_common_endpoints(intf->cur_altsetting,
1186+ &in, &out, NULL, NULL);
1187+
1188+ if (ret) {
1189+ usb_err(usbatm_instance, "cxacru_bind: interface has incorrect endpoints\n");
1190+ ret = -ENODEV;
1191+ goto fail;
1192+ }
1193+
11801194 if ((cmd_ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
11811195 == USB_ENDPOINT_XFER_INT) {
11821196 usb_fill_int_urb(instance->rcv_urb,
drivers/usb/dwc3/core.c+19−7
@@ -957,12 +957,16 @@ static bool dwc3_core_is_valid(struct dwc3 *dwc) · 956 unmodified lines
957957
958958 static void dwc3_core_setup_global_control(struct dwc3 *dwc)
959959 {
960+ unsigned int power_opt;
961+ unsigned int hw_mode;
960962 u32 reg;
961963
962964 reg = dwc3_readl(dwc->regs, DWC3_GCTL);
963965 reg &= ~DWC3_GCTL_SCALEDOWN_MASK;
966+ hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0);
967+ power_opt = DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1);
964968
965− switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1)) {
969+ switch (power_opt) {
966970 case DWC3_GHWPARAMS1_EN_PWROPT_CLK:
967971 /**
968972 * WORKAROUND: DWC3 revisions between 2.10a and 2.50a have an
@@ -995,6 +999,20 @@ static void dwc3_core_setup_global_control(struct dwc3 *dwc) · 26 unmodified lines
995999 break;
9961000 }
9971001
1002+ /*
1003+ * This is a workaround for STAR#4846132, which only affects
1004+ * DWC_usb31 version2.00a operating in host mode.
1005+ *
1006+ * There is a problem in DWC_usb31 version 2.00a operating
1007+ * in host mode that would cause a CSR read timeout When CSR
1008+ * read coincides with RAM Clock Gating Entry. By disable
1009+ * Clock Gating, sacrificing power consumption for normal
1010+ * operation.
1011+ */
1012+ if (power_opt != DWC3_GHWPARAMS1_EN_PWROPT_NO &&
1013+ hw_mode != DWC3_GHWPARAMS0_MODE_GADGET && DWC3_VER_IS(DWC31, 200A))
1014+ reg |= DWC3_GCTL_DSBLCLKGTNG;
1015+
9981016 /* check if current dwc3 is on simulation board */
9991017 if (dwc->hwparams.hwparams6 & DWC3_GHWPARAMS6_EN_FPGA) {
10001018 dev_info(dwc->dev, "Running with FPGA optimizations\n");
@@ -2250,7 +2268,6 @@ assert_reset: · 1249 unmodified lines
22502268
22512269 static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
22522270 {
2253− unsigned long flags;
22542271 u32 reg;
22552272 int i;
22562273
@@ -2293,9 +2310,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) · 36 unmodified lines
22932310 break;
22942311
22952312 if (dwc->current_otg_role == DWC3_OTG_ROLE_DEVICE) {
2296− spin_lock_irqsave(&dwc->lock, flags);
22972313 dwc3_gadget_suspend(dwc);
2298− spin_unlock_irqrestore(&dwc->lock, flags);
22992314 synchronize_irq(dwc->irq_gadget);
23002315 }
23012316
@@ -2312,7 +2327,6 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) · 10 unmodified lines
23122327
23132328 static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
23142329 {
2315− unsigned long flags;
23162330 int ret;
23172331 u32 reg;
23182332 int i;
@@ -2366,9 +2380,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) · 47 unmodified lines
23662380 if (dwc->current_otg_role == DWC3_OTG_ROLE_HOST) {
23672381 dwc3_otg_host_init(dwc);
23682382 } else if (dwc->current_otg_role == DWC3_OTG_ROLE_DEVICE) {
2369− spin_lock_irqsave(&dwc->lock, flags);
23702383 dwc3_gadget_resume(dwc);
2371− spin_unlock_irqrestore(&dwc->lock, flags);
23722384 }
23732385
23742386 break;
drivers/usb/gadget/function/f_printer.c+30−10
@@ -213,6 +213,7 @@ static inline struct usb_endpoint_descriptor *ep_desc(struct usb_gadget *gadget, · 212 unmodified lines
213213 struct usb_endpoint_descriptor *ss)
214214 {
215215 switch (gadget->speed) {
216+ case USB_SPEED_SUPER_PLUS:
216217 case USB_SPEED_SUPER:
217218 return ss;
218219 case USB_SPEED_HIGH:
@@ -449,11 +450,8 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) · 230 unmodified lines
449450 mutex_lock(&dev->lock_printer_io);
450451 spin_lock_irqsave(&dev->lock, flags);
451452
452− if (dev->interface < 0) {
453− spin_unlock_irqrestore(&dev->lock, flags);
454− mutex_unlock(&dev->lock_printer_io);
455− return -ENODEV;
456− }
453+ if (dev->interface < 0)
454+ goto out_disabled;
457455
458456 /* We will use this flag later to check if a printer reset happened
459457 * after we turn interrupts back on.
@@ -461,6 +459,9 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) · 1 unmodified line
461459 dev->reset_printer = 0;
462460
463461 setup_rx_reqs(dev);
462+ /* this dropped the lock - need to retest */
463+ if (dev->interface < 0)
464+ goto out_disabled;
464465
465466 bytes_copied = 0;
466467 current_rx_req = dev->current_rx_req;
@@ -494,6 +495,8 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) · 27 unmodified lines
494495 wait_event_interruptible(dev->rx_wait,
495496 (likely(!list_empty(&dev->rx_buffers))));
496497 spin_lock_irqsave(&dev->lock, flags);
498+ if (dev->interface < 0)
499+ goto out_disabled;
497500 }
498501
499502 /* We have data to return then copy it to the caller's buffer.*/
@@ -537,6 +540,9 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) · 37 unmodified lines
537540 return -EAGAIN;
538541 }
539542
543+ if (dev->interface < 0)
544+ goto out_disabled;
545+
540546 /* If we not returning all the data left in this RX request
541547 * buffer then adjust the amount of data left in the buffer.
542548 * Othewise if we are done with this RX request buffer then
@@ -566,6 +572,11 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) · 23 unmodified lines
566572 return bytes_copied;
567573 else
568574 return -EAGAIN;
575+
576+out_disabled:
577+ spin_unlock_irqrestore(&dev->lock, flags);
578+ mutex_unlock(&dev->lock_printer_io);
579+ return -ENODEV;
569580 }
570581
571582 static ssize_t
@@ -586,11 +597,8 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) · 14 unmodified lines
586597 mutex_lock(&dev->lock_printer_io);
587598 spin_lock_irqsave(&dev->lock, flags);
588599
589− if (dev->interface < 0) {
590− spin_unlock_irqrestore(&dev->lock, flags);
591− mutex_unlock(&dev->lock_printer_io);
592− return -ENODEV;
593− }
600+ if (dev->interface < 0)
601+ goto out_disabled;
594602
595603 /* Check if a printer reset happens while we have interrupts on */
596604 dev->reset_printer = 0;
@@ -613,6 +621,8 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) · 16 unmodified lines
613621 wait_event_interruptible(dev->tx_wait,
614622 (likely(!list_empty(&dev->tx_reqs))));
615623 spin_lock_irqsave(&dev->lock, flags);
624+ if (dev->interface < 0)
625+ goto out_disabled;
616626 }
617627
618628 while (likely(!list_empty(&dev->tx_reqs)) && len) {
@@ -662,6 +672,9 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) · 43 unmodified lines
662672 return -EAGAIN;
663673 }
664674
675+ if (dev->interface < 0)
676+ goto out_disabled;
677+
665678 list_add(&req->list, &dev->tx_reqs_active);
666679
667680 /* here, we unlock, and only unlock, to avoid deadlock. */
@@ -674,6 +687,8 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) · 6 unmodified lines
674687 mutex_unlock(&dev->lock_printer_io);
675688 return -EAGAIN;
676689 }
690+ if (dev->interface < 0)
691+ goto out_disabled;
677692 }
678693
679694 spin_unlock_irqrestore(&dev->lock, flags);
@@ -685,6 +700,11 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) · 5 unmodified lines
685700 return bytes_copied;
686701 else
687702 return -EAGAIN;
703+
704+out_disabled:
705+ spin_unlock_irqrestore(&dev->lock, flags);
706+ mutex_unlock(&dev->lock_printer_io);
707+ return -ENODEV;
688708 }
689709
690710 static int
drivers/usb/gadget/function/u_ether.c+1−3
@@ -1163,8 +1163,6 @@ struct net_device *gether_connect(struct gether *link) · 1162 unmodified lines
11631163 if (netif_running(dev->net))
11641164 eth_start(dev, GFP_ATOMIC);
11651165
1166− netif_device_attach(dev->net);
1167−
11681166 /* on error, disable any endpoints */
11691167 } else {
11701168 (void) usb_ep_disable(link->out_ep);
@@ -1202,7 +1200,7 @@ void gether_disconnect(struct gether *link) · 31 unmodified lines
12021200
12031201 DBG(dev, "%s\n", __func__);
12041202
1205− netif_device_detach(dev->net);
1203+ netif_stop_queue(dev->net);
12061204 netif_carrier_off(dev->net);
12071205
12081206 /* disable endpoints, forcing (synchronous) completion
drivers/usb/gadget/udc/aspeed_udc.c+2−2
@@ -66,8 +66,8 @@ · 65 unmodified lines
6666 #define USB_UPSTREAM_EN BIT(0)
6767
6868 /* Main config reg */
69−#define UDC_CFG_SET_ADDR(x) ((x) & 0x3f)
70−#define UDC_CFG_ADDR_MASK (0x3f)
69+#define UDC_CFG_SET_ADDR(x) ((x) & UDC_CFG_ADDR_MASK)
70+#define UDC_CFG_ADDR_MASK GENMASK(6, 0)
7171
7272 /* Interrupt ctrl & status reg */
7373 #define UDC_IRQ_EP_POOL_NAK BIT(17)
drivers/usb/musb/da8xx.c+6−2
@@ -556,7 +556,7 @@ static int da8xx_probe(struct platform_device *pdev) · 555 unmodified lines
556556 ret = of_platform_populate(pdev->dev.of_node, NULL,
557557 da8xx_auxdata_lookup, &pdev->dev);
558558 if (ret)
559− return ret;
559+ goto err_unregister_phy;
560560
561561 pinfo = da8xx_dev_info;
562562 pinfo.parent = &pdev->dev;
@@ -571,9 +571,13 @@ static int da8xx_probe(struct platform_device *pdev) · 8 unmodified lines
571571 ret = PTR_ERR_OR_ZERO(glue->musb);
572572 if (ret) {
573573 dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
574− usb_phy_generic_unregister(glue->usb_phy);
574+ goto err_unregister_phy;
575575 }
576576
577+ return 0;
578+
579+err_unregister_phy:
580+ usb_phy_generic_unregister(glue->usb_phy);
577581 return ret;
578582 }
579583
drivers/usb/typec/ucsi/ucsi_acpi.c+61−0
@@ -25,6 +25,7 @@ struct ucsi_acpi { · 24 unmodified lines
2525 unsigned long flags;
2626 #define UCSI_ACPI_COMMAND_PENDING 1
2727 #define UCSI_ACPI_ACK_PENDING 2
28+#define UCSI_ACPI_CHECK_BOGUS_EVENT 3
2829 guid_t guid;
2930 u64 cmd;
3031 };
@@ -128,6 +129,58 @@ static const struct ucsi_operations ucsi_zenbook_ops = { · 97 unmodified lines
128129 .async_write = ucsi_acpi_async_write
129130 };
130131
132+static int ucsi_gram_read(struct ucsi *ucsi, unsigned int offset,
133+ void *val, size_t val_len)
134+{
135+ u16 bogus_change = UCSI_CONSTAT_POWER_LEVEL_CHANGE |
136+ UCSI_CONSTAT_PDOS_CHANGE;
137+ struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
138+ struct ucsi_connector_status *status;
139+ int ret;
140+
141+ ret = ucsi_acpi_read(ucsi, offset, val, val_len);
142+ if (ret < 0)
143+ return ret;
144+
145+ if (UCSI_COMMAND(ua->cmd) == UCSI_GET_CONNECTOR_STATUS &&
146+ test_bit(UCSI_ACPI_CHECK_BOGUS_EVENT, &ua->flags) &&
147+ offset == UCSI_MESSAGE_IN) {
148+ status = (struct ucsi_connector_status *)val;
149+
150+ /* Clear the bogus change */
151+ if (status->change == bogus_change)
152+ status->change = 0;
153+
154+ clear_bit(UCSI_ACPI_CHECK_BOGUS_EVENT, &ua->flags);
155+ }
156+
157+ return ret;
158+}
159+
160+static int ucsi_gram_sync_write(struct ucsi *ucsi, unsigned int offset,
161+ const void *val, size_t val_len)
162+{
163+ struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
164+ int ret;
165+
166+ ret = ucsi_acpi_sync_write(ucsi, offset, val, val_len);
167+ if (ret < 0)
168+ return ret;
169+
170+ if (UCSI_COMMAND(ua->cmd) == UCSI_GET_PDOS &&
171+ ua->cmd & UCSI_GET_PDOS_PARTNER_PDO(1) &&
172+ ua->cmd & UCSI_GET_PDOS_SRC_PDOS)
173+ set_bit(UCSI_ACPI_CHECK_BOGUS_EVENT, &ua->flags);
174+
175+ return ret;
176+}
177+
178+static const struct ucsi_operations ucsi_gram_ops = {
179+ .read = ucsi_gram_read,
180+ .sync_write = ucsi_gram_sync_write,
181+ .async_write = ucsi_acpi_async_write
182+};
183+
131184 static const struct dmi_system_id ucsi_acpi_quirks[] = {
132185 {
133186 .matches = {
@@ -136,6 +189,14 @@ static const struct dmi_system_id ucsi_acpi_quirks[] = { · 2 unmodified lines
136189 },
137190 .driver_data = (void *)&ucsi_zenbook_ops,
138191 },
192+ {
193+ .matches = {
194+ DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
195+ DMI_MATCH(DMI_PRODUCT_FAMILY, "LG gram PC"),
196+ DMI_MATCH(DMI_PRODUCT_NAME, "90Q"),
197+ },
198+ .driver_data = (void *)&ucsi_gram_ops,
199+ },
139200 { }
140201 };
141202
drivers/usb/typec/ucsi/ucsi_glink.c+4−1
@@ -372,6 +372,7 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev, · 371 unmodified lines
372372 ret = fwnode_property_read_u32(fwnode, "reg", &port);
373373 if (ret < 0) {
374374 dev_err(dev, "missing reg property of %pOFn\n", fwnode);
375+ fwnode_handle_put(fwnode);
375376 return ret;
376377 }
377378
@@ -386,9 +387,11 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev, · 8 unmodified lines
386387 if (!desc)
387388 continue;
388389
389− if (IS_ERR(desc))
390+ if (IS_ERR(desc)) {
391+ fwnode_handle_put(fwnode);
390392 return dev_err_probe(dev, PTR_ERR(desc),
391393 "unable to acquire orientation gpio\n");
394+ }
392395 ucsi->port_orientation[port] = desc;
393396 }
394397
drivers/usb/typec/ucsi/ucsi_stm32g0.c+15−4
@@ -65,6 +65,7 @@ struct ucsi_stm32g0 { · 64 unmodified lines
6565 struct device *dev;
6666 unsigned long flags;
6767 #define COMMAND_PENDING 1
68+#define ACK_PENDING 2
6869 const char *fw_name;
6970 struct ucsi *ucsi;
7071 bool suspended;
@@ -396,9 +397,13 @@ static int ucsi_stm32g0_sync_write(struct ucsi *ucsi, unsigned int offset, const · 325 unmodified lines
396397 size_t len)
397398 {
398399 struct ucsi_stm32g0 *g0 = ucsi_get_drvdata(ucsi);
400+ bool ack = UCSI_COMMAND(*(u64 *)val) == UCSI_ACK_CC_CI;
399401 int ret;
400402
401− set_bit(COMMAND_PENDING, &g0->flags);
403+ if (ack)
404+ set_bit(ACK_PENDING, &g0->flags);
405+ else
406+ set_bit(COMMAND_PENDING, &g0->flags);
402407
403408 ret = ucsi_stm32g0_async_write(ucsi, offset, val, len);
404409 if (ret)
@@ -406,9 +411,14 @@ static int ucsi_stm32g0_sync_write(struct ucsi *ucsi, unsigned int offset, const · 1 unmodified line
406411
407412 if (!wait_for_completion_timeout(&g0->complete, msecs_to_jiffies(5000)))
408413 ret = -ETIMEDOUT;
414+ else
415+ return 0;
409416
410417 out_clear_bit:
411− clear_bit(COMMAND_PENDING, &g0->flags);
418+ if (ack)
419+ clear_bit(ACK_PENDING, &g0->flags);
420+ else
421+ clear_bit(COMMAND_PENDING, &g0->flags);
412422
413423 return ret;
414424 }
@@ -429,8 +439,9 @@ static irqreturn_t ucsi_stm32g0_irq_handler(int irq, void *data) · 14 unmodified lines
429439 if (UCSI_CCI_CONNECTOR(cci))
430440 ucsi_connector_change(g0->ucsi, UCSI_CCI_CONNECTOR(cci));
431441
432− if (test_bit(COMMAND_PENDING, &g0->flags) &&
433− cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))
442+ if (cci & UCSI_CCI_ACK_COMPLETE && test_and_clear_bit(ACK_PENDING, &g0->flags))
443+ complete(&g0->complete);
444+ if (cci & UCSI_CCI_COMMAND_COMPLETE && test_and_clear_bit(COMMAND_PENDING, &g0->flags))
434445 complete(&g0->complete);
435446
436447 return IRQ_HANDLED;
drivers/watchdog/Kconfig+1−0
@@ -257,6 +257,7 @@ config GPIO_WATCHDOG_ARCH_INITCALL · 256 unmodified lines
257257 config LENOVO_SE10_WDT
258258 tristate "Lenovo SE10 Watchdog"
259259 depends on (X86 && DMI) || COMPILE_TEST
260+ depends on HAS_IOPORT
260261 select WATCHDOG_CORE
261262 help
262263 If you say yes here you get support for the watchdog
drivers/watchdog/menz69_wdt.c+1−0
@@ -161,6 +161,7 @@ static struct mcb_driver men_z069_driver = { · 160 unmodified lines
161161 module_mcb_driver(men_z069_driver);
162162
163163 MODULE_AUTHOR("Johannes Thumshirn <jth@kernel.org>");
164+MODULE_DESCRIPTION("Watchdog driver for the MEN z069 IP-Core");
164165 MODULE_LICENSE("GPL v2");
165166 MODULE_ALIAS("mcb:16z069");
166167 MODULE_IMPORT_NS(MCB);
drivers/watchdog/omap_wdt.c+1−0
@@ -370,5 +370,6 @@ static struct platform_driver omap_wdt_driver = { · 369 unmodified lines
370370 module_platform_driver(omap_wdt_driver);
371371
372372 MODULE_AUTHOR("George G. Davis");
373+MODULE_DESCRIPTION("Driver for the TI OMAP 16xx/24xx/34xx 32KHz (non-secure) watchdog");
373374 MODULE_LICENSE("GPL");
374375 MODULE_ALIAS("platform:omap_wdt");
drivers/watchdog/simatic-ipc-wdt.c+1−0
@@ -227,6 +227,7 @@ static struct platform_driver simatic_ipc_wdt_driver = { · 226 unmodified lines
227227
228228 module_platform_driver(simatic_ipc_wdt_driver);
229229
230+MODULE_DESCRIPTION("Siemens SIMATIC IPC driver for Watchdogs");
230231 MODULE_LICENSE("GPL v2");
231232 MODULE_ALIAS("platform:" KBUILD_MODNAME);
232233 MODULE_AUTHOR("Gerd Haeussler <gerd.haeussler.ext@siemens.com>");
drivers/watchdog/ts4800_wdt.c+1−0
@@ -200,5 +200,6 @@ static struct platform_driver ts4800_wdt_driver = { · 199 unmodified lines
200200 module_platform_driver(ts4800_wdt_driver);
201201
202202 MODULE_AUTHOR("Damien Riegel <damien.riegel@savoirfairelinux.com>");
203+MODULE_DESCRIPTION("Watchdog driver for TS-4800 based boards");
203204 MODULE_LICENSE("GPL v2");
204205 MODULE_ALIAS("platform:ts4800_wdt");
drivers/watchdog/twl4030_wdt.c+1−0
@@ -118,6 +118,7 @@ static struct platform_driver twl4030_wdt_driver = { · 117 unmodified lines
118118 module_platform_driver(twl4030_wdt_driver);
119119
120120 MODULE_AUTHOR("Nokia Corporation");
121+MODULE_DESCRIPTION("TWL4030 Watchdog");
121122 MODULE_LICENSE("GPL");
122123 MODULE_ALIAS("platform:twl4030_wdt");
123124
fs/afs/inode.c+2−2
@@ -512,7 +512,7 @@ static int afs_iget5_set_root(struct inode *inode, void *opaque) · 511 unmodified lines
512512 struct afs_vnode *vnode = AFS_FS_I(inode);
513513
514514 vnode->volume = as->volume;
515− vnode->fid.vid = as->volume->vid,
515+ vnode->fid.vid = as->volume->vid;
516516 vnode->fid.vnode = 1;
517517 vnode->fid.unique = 1;
518518 inode->i_ino = 1;
@@ -545,7 +545,7 @@ struct inode *afs_root_iget(struct super_block *sb, struct key *key) · 26 unmodified lines
545545 BUG_ON(!(inode->i_state & I_NEW));
546546
547547 vnode = AFS_FS_I(inode);
548− vnode->cb_v_check = atomic_read(&as->volume->cb_v_break),
548+ vnode->cb_v_check = atomic_read(&as->volume->cb_v_break);
549549 afs_set_netfs_context(vnode);
550550
551551 op = afs_alloc_operation(key, as->volume);
fs/bcachefs/alloc_background.c+139−124
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <linux/sched/task.h>
3030 #include <linux/sort.h>
3131
32−static void bch2_discard_one_bucket_fast(struct bch_fs *c, struct bpos bucket);
32+static void bch2_discard_one_bucket_fast(struct bch_dev *, u64);
3333
3434 /* Persistent alloc info: */
3535
@@ -893,12 +893,12 @@ int bch2_trigger_alloc(struct btree_trans *trans, · 857 unmodified lines
893893 if (statechange(a->data_type == BCH_DATA_need_discard) &&
894894 !bch2_bucket_is_open_safe(c, new.k->p.inode, new.k->p.offset) &&
895895 bucket_flushed(new_a))
896− bch2_discard_one_bucket_fast(c, new.k->p);
896+ bch2_discard_one_bucket_fast(ca, new.k->p.offset);
897897
898898 if (statechange(a->data_type == BCH_DATA_cached) &&
899899 !bch2_bucket_is_open(c, new.k->p.inode, new.k->p.offset) &&
900900 should_invalidate_buckets(ca, bch2_dev_usage_read(ca)))
901− bch2_do_invalidates(c);
901+ bch2_dev_do_invalidates(ca);
902902
903903 if (statechange(a->data_type == BCH_DATA_need_gc_gens))
904904 bch2_gc_gens_async(c);
@@ -1636,34 +1636,38 @@ int bch2_check_alloc_to_lru_refs(struct bch_fs *c) · 731 unmodified lines
16361636 return ret;
16371637 }
16381638
1639−static int discard_in_flight_add(struct bch_fs *c, struct bpos bucket)
1639+static int discard_in_flight_add(struct bch_dev *ca, u64 bucket, bool in_progress)
16401640 {
16411641 int ret;
16421642
1643− mutex_lock(&c->discard_buckets_in_flight_lock);
1644− darray_for_each(c->discard_buckets_in_flight, i)
1645− if (bkey_eq(*i, bucket)) {
1643+ mutex_lock(&ca->discard_buckets_in_flight_lock);
1644+ darray_for_each(ca->discard_buckets_in_flight, i)
1645+ if (i->bucket == bucket) {
16461646 ret = -BCH_ERR_EEXIST_discard_in_flight_add;
16471647 goto out;
16481648 }
16491649
1650− ret = darray_push(&c->discard_buckets_in_flight, bucket);
1650+ ret = darray_push(&ca->discard_buckets_in_flight, ((struct discard_in_flight) {
1651+ .in_progress = in_progress,
1652+ .bucket = bucket,
1653+ }));
16511654 out:
1652− mutex_unlock(&c->discard_buckets_in_flight_lock);
1655+ mutex_unlock(&ca->discard_buckets_in_flight_lock);
16531656 return ret;
16541657 }
16551658
1656−static void discard_in_flight_remove(struct bch_fs *c, struct bpos bucket)
1659+static void discard_in_flight_remove(struct bch_dev *ca, u64 bucket)
16571660 {
1658− mutex_lock(&c->discard_buckets_in_flight_lock);
1659− darray_for_each(c->discard_buckets_in_flight, i)
1660− if (bkey_eq(*i, bucket)) {
1661− darray_remove_item(&c->discard_buckets_in_flight, i);
1661+ mutex_lock(&ca->discard_buckets_in_flight_lock);
1662+ darray_for_each(ca->discard_buckets_in_flight, i)
1663+ if (i->bucket == bucket) {
1664+ BUG_ON(!i->in_progress);
1665+ darray_remove_item(&ca->discard_buckets_in_flight, i);
16621666 goto found;
16631667 }
16641668 BUG();
16651669 found:
1666− mutex_unlock(&c->discard_buckets_in_flight_lock);
1670+ mutex_unlock(&ca->discard_buckets_in_flight_lock);
16671671 }
16681672
16691673 struct discard_buckets_state {
@@ -1671,26 +1675,11 @@ struct discard_buckets_state { · 1 unmodified line
16711675 u64 open;
16721676 u64 need_journal_commit;
16731677 u64 discarded;
1674− struct bch_dev *ca;
16751678 u64 need_journal_commit_this_dev;
16761679 };
16771680
1678−static void discard_buckets_next_dev(struct bch_fs *c, struct discard_buckets_state *s, struct bch_dev *ca)
1679−{
1680− if (s->ca == ca)
1681− return;
1682−
1683− if (s->ca && s->need_journal_commit_this_dev >
1684− bch2_dev_usage_read(s->ca).d[BCH_DATA_free].buckets)
1685− bch2_journal_flush_async(&c->journal, NULL);
1686−
1687− if (s->ca)
1688− percpu_ref_put(&s->ca->io_ref);
1689− s->ca = ca;
1690− s->need_journal_commit_this_dev = 0;
1691−}
1692−
16931681 static int bch2_discard_one_bucket(struct btree_trans *trans,
1682+ struct bch_dev *ca,
16941683 struct btree_iter *need_discard_iter,
16951684 struct bpos *discard_pos_done,
16961685 struct discard_buckets_state *s)
@@ -1704,16 +1693,6 @@ static int bch2_discard_one_bucket(struct btree_trans *trans, · 7 unmodified lines
17041693 bool discard_locked = false;
17051694 int ret = 0;
17061695
1707− struct bch_dev *ca = s->ca && s->ca->dev_idx == pos.inode
1708− ? s->ca
1709− : bch2_dev_get_ioref(c, pos.inode, WRITE);
1710− if (!ca) {
1711− bch2_btree_iter_set_pos(need_discard_iter, POS(pos.inode + 1, 0));
1712− return 0;
1713− }
1714−
1715− discard_buckets_next_dev(c, s, ca);
1716−
17171696 if (bch2_bucket_is_open_safe(c, pos.inode, pos.offset)) {
17181697 s->open++;
17191698 goto out;
@@ -1773,7 +1752,7 @@ static int bch2_discard_one_bucket(struct btree_trans *trans, · 53 unmodified lines
17731752 goto out;
17741753 }
17751754
1776− if (discard_in_flight_add(c, SPOS(iter.pos.inode, iter.pos.offset, true)))
1755+ if (discard_in_flight_add(ca, iter.pos.offset, true))
17771756 goto out;
17781757
17791758 discard_locked = true;
@@ -1811,7 +1790,7 @@ write: · 31 unmodified lines
18111790 s->discarded++;
18121791 out:
18131792 if (discard_locked)
1814− discard_in_flight_remove(c, iter.pos);
1793+ discard_in_flight_remove(ca, iter.pos.offset);
18151794 s->seen++;
18161795 bch2_trans_iter_exit(trans, &iter);
18171796 printbuf_exit(&buf);
@@ -1820,7 +1799,8 @@ out: · 2 unmodified lines
18201799
18211800 static void bch2_do_discards_work(struct work_struct *work)
18221801 {
1823− struct bch_fs *c = container_of(work, struct bch_fs, discard_work);
1802+ struct bch_dev *ca = container_of(work, struct bch_dev, discard_work);
1803+ struct bch_fs *c = ca->fs;
18241804 struct discard_buckets_state s = {};
18251805 struct bpos discard_pos_done = POS_MAX;
18261806 int ret;
@@ -1831,23 +1811,41 @@ static void bch2_do_discards_work(struct work_struct *work) · 4 unmodified lines
18311811 * successful commit:
18321812 */
18331813 ret = bch2_trans_run(c,
1834− for_each_btree_key(trans, iter,
1835− BTREE_ID_need_discard, POS_MIN, 0, k,
1836− bch2_discard_one_bucket(trans, &iter, &discard_pos_done, &s)));
1837−
1838− discard_buckets_next_dev(c, &s, NULL);
1814+ for_each_btree_key_upto(trans, iter,
1815+ BTREE_ID_need_discard,
1816+ POS(ca->dev_idx, 0),
1817+ POS(ca->dev_idx, U64_MAX), 0, k,
1818+ bch2_discard_one_bucket(trans, ca, &iter, &discard_pos_done, &s)));
18391819
18401820 trace_discard_buckets(c, s.seen, s.open, s.need_journal_commit, s.discarded,
18411821 bch2_err_str(ret));
18421822
18431823 bch2_write_ref_put(c, BCH_WRITE_REF_discard);
1824+ percpu_ref_put(&ca->io_ref);
1825+}
1826+
1827+void bch2_dev_do_discards(struct bch_dev *ca)
1828+{
1829+ struct bch_fs *c = ca->fs;
1830+
1831+ if (!bch2_dev_get_ioref(c, ca->dev_idx, WRITE))
1832+ return;
1833+
1834+ if (!bch2_write_ref_tryget(c, BCH_WRITE_REF_discard))
1835+ goto put_ioref;
1836+
1837+ if (queue_work(c->write_ref_wq, &ca->discard_work))
1838+ return;
1839+
1840+ bch2_write_ref_put(c, BCH_WRITE_REF_discard);
1841+put_ioref:
1842+ percpu_ref_put(&ca->io_ref);
18441843 }
18451844
18461845 void bch2_do_discards(struct bch_fs *c)
18471846 {
1848− if (bch2_write_ref_tryget(c, BCH_WRITE_REF_discard) &&
1849− !queue_work(c->write_ref_wq, &c->discard_work))
1850− bch2_write_ref_put(c, BCH_WRITE_REF_discard);
1847+ for_each_member_device(c, ca)
1848+ bch2_dev_do_discards(ca);
18511849 }
18521850
18531851 static int bch2_clear_bucket_needs_discard(struct btree_trans *trans, struct bpos bucket)
@@ -1876,68 +1874,69 @@ err: · 22 unmodified lines
18761874
18771875 static void bch2_do_discards_fast_work(struct work_struct *work)
18781876 {
1879− struct bch_fs *c = container_of(work, struct bch_fs, discard_fast_work);
1877+ struct bch_dev *ca = container_of(work, struct bch_dev, discard_fast_work);
1878+ struct bch_fs *c = ca->fs;
18801879
18811880 while (1) {
18821881 bool got_bucket = false;
1883− struct bpos bucket;
1884− struct bch_dev *ca;
1882+ u64 bucket;
18851883
1886− mutex_lock(&c->discard_buckets_in_flight_lock);
1887− darray_for_each(c->discard_buckets_in_flight, i) {
1888− if (i->snapshot)
1884+ mutex_lock(&ca->discard_buckets_in_flight_lock);
1885+ darray_for_each(ca->discard_buckets_in_flight, i) {
1886+ if (i->in_progress)
18891887 continue;
18901888
1891− ca = bch2_dev_get_ioref(c, i->inode, WRITE);
1892− if (!ca) {
1893− darray_remove_item(&c->discard_buckets_in_flight, i);
1894− continue;
1895− }
1896−
18971889 got_bucket = true;
1898− bucket = *i;
1899− i->snapshot = true;
1890+ bucket = i->bucket;
1891+ i->in_progress = true;
19001892 break;
19011893 }
1902− mutex_unlock(&c->discard_buckets_in_flight_lock);
1894+ mutex_unlock(&ca->discard_buckets_in_flight_lock);
19031895
19041896 if (!got_bucket)
19051897 break;
19061898
19071899 if (ca->mi.discard && !c->opts.nochanges)
19081900 blkdev_issue_discard(ca->disk_sb.bdev,
1909− bucket.offset * ca->mi.bucket_size,
1901+ bucket_to_sector(ca, bucket),
19101902 ca->mi.bucket_size,
19111903 GFP_KERNEL);
19121904
19131905 int ret = bch2_trans_do(c, NULL, NULL,
1914− BCH_WATERMARK_btree|
1915− BCH_TRANS_COMMIT_no_enospc,
1916− bch2_clear_bucket_needs_discard(trans, bucket));
1906+ BCH_WATERMARK_btree|
1907+ BCH_TRANS_COMMIT_no_enospc,
1908+ bch2_clear_bucket_needs_discard(trans, POS(ca->dev_idx, bucket)));
19171909 bch_err_fn(c, ret);
19181910
1919− percpu_ref_put(&ca->io_ref);
1920− discard_in_flight_remove(c, bucket);
1911+ discard_in_flight_remove(ca, bucket);
19211912
19221913 if (ret)
19231914 break;
19241915 }
19251916
19261917 bch2_write_ref_put(c, BCH_WRITE_REF_discard_fast);
1918+ percpu_ref_put(&ca->io_ref);
19271919 }
19281920
1929−static void bch2_discard_one_bucket_fast(struct bch_fs *c, struct bpos bucket)
1921+static void bch2_discard_one_bucket_fast(struct bch_dev *ca, u64 bucket)
19301922 {
1931− rcu_read_lock();
1932− struct bch_dev *ca = bch2_dev_rcu(c, bucket.inode);
1933− bool dead = !ca || percpu_ref_is_dying(&ca->io_ref);
1934− rcu_read_unlock();
1923+ struct bch_fs *c = ca->fs;
1924+
1925+ if (discard_in_flight_add(ca, bucket, false))
1926+ return;
1927+
1928+ if (!bch2_dev_get_ioref(c, ca->dev_idx, WRITE))
1929+ return;
1930+
1931+ if (!bch2_write_ref_tryget(c, BCH_WRITE_REF_discard_fast))
1932+ goto put_ioref;
1933+
1934+ if (queue_work(c->write_ref_wq, &ca->discard_fast_work))
1935+ return;
19351936
1936− if (!dead &&
1937− !discard_in_flight_add(c, bucket) &&
1938− bch2_write_ref_tryget(c, BCH_WRITE_REF_discard_fast) &&
1939− !queue_work(c->write_ref_wq, &c->discard_fast_work))
1940− bch2_write_ref_put(c, BCH_WRITE_REF_discard_fast);
1937+ bch2_write_ref_put(c, BCH_WRITE_REF_discard_fast);
1938+put_ioref:
1939+ percpu_ref_put(&ca->io_ref);
19411940 }
19421941
19431942 static int invalidate_one_bucket(struct btree_trans *trans,
@@ -2038,7 +2037,8 @@ again: · 94 unmodified lines
20382037
20392038 static void bch2_do_invalidates_work(struct work_struct *work)
20402039 {
2041− struct bch_fs *c = container_of(work, struct bch_fs, invalidate_work);
2040+ struct bch_dev *ca = container_of(work, struct bch_dev, invalidate_work);
2041+ struct bch_fs *c = ca->fs;
20422042 struct btree_trans *trans = bch2_trans_get(c);
20432043 int ret = 0;
20442044
@@ -2046,52 +2046,63 @@ static void bch2_do_invalidates_work(struct work_struct *work) · 1 unmodified line
20462046 if (ret)
20472047 goto err;
20482048
2049− for_each_member_device(c, ca) {
2050− s64 nr_to_invalidate =
2051− should_invalidate_buckets(ca, bch2_dev_usage_read(ca));
2052− struct btree_iter iter;
2053− bool wrapped = false;
2054−
2055− bch2_trans_iter_init(trans, &iter, BTREE_ID_lru,
2056− lru_pos(ca->dev_idx, 0,
2057− ((bch2_current_io_time(c, READ) + U32_MAX) &
2058− LRU_TIME_MAX)), 0);
2059−
2060− while (true) {
2061− bch2_trans_begin(trans);
2062−
2063− struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
2064− ret = bkey_err(k);
2065− if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2066− continue;
2067− if (ret)
2068− break;
2069− if (!k.k)
2070− break;
2049+ s64 nr_to_invalidate =
2050+ should_invalidate_buckets(ca, bch2_dev_usage_read(ca));
2051+ struct btree_iter iter;
2052+ bool wrapped = false;
20712053
2072− ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
2073− if (ret)
2074− break;
2054+ bch2_trans_iter_init(trans, &iter, BTREE_ID_lru,
2055+ lru_pos(ca->dev_idx, 0,
2056+ ((bch2_current_io_time(c, READ) + U32_MAX) &
2057+ LRU_TIME_MAX)), 0);
20752058
2076− bch2_btree_iter_advance(&iter);
2077− }
2078− bch2_trans_iter_exit(trans, &iter);
2059+ while (true) {
2060+ bch2_trans_begin(trans);
20792061
2080− if (ret < 0) {
2081− bch2_dev_put(ca);
2062+ struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
2063+ ret = bkey_err(k);
2064+ if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2065+ continue;
2066+ if (ret)
20822067 break;
2083− }
2068+ if (!k.k)
2069+ break;
2070+
2071+ ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
2072+ if (ret)
2073+ break;
2074+
2075+ bch2_btree_iter_advance(&iter);
20842076 }
2077+ bch2_trans_iter_exit(trans, &iter);
20852078 err:
20862079 bch2_trans_put(trans);
20872080 bch2_write_ref_put(c, BCH_WRITE_REF_invalidate);
2081+ percpu_ref_put(&ca->io_ref);
2082+}
2083+
2084+void bch2_dev_do_invalidates(struct bch_dev *ca)
2085+{
2086+ struct bch_fs *c = ca->fs;
2087+
2088+ if (!bch2_dev_get_ioref(c, ca->dev_idx, WRITE))
2089+ return;
2090+
2091+ if (!bch2_write_ref_tryget(c, BCH_WRITE_REF_invalidate))
2092+ goto put_ioref;
2093+
2094+ if (queue_work(c->write_ref_wq, &ca->invalidate_work))
2095+ return;
2096+
2097+ bch2_write_ref_put(c, BCH_WRITE_REF_invalidate);
2098+put_ioref:
2099+ percpu_ref_put(&ca->io_ref);
20882100 }
20892101
20902102 void bch2_do_invalidates(struct bch_fs *c)
20912103 {
2092− if (bch2_write_ref_tryget(c, BCH_WRITE_REF_invalidate) &&
2093− !queue_work(c->write_ref_wq, &c->invalidate_work))
2094− bch2_write_ref_put(c, BCH_WRITE_REF_invalidate);
2104+ for_each_member_device(c, ca)
2105+ bch2_dev_do_invalidates(ca);
20952106 }
20962107
20972108 int bch2_dev_freespace_init(struct bch_fs *c, struct bch_dev *ca,
@@ -2407,16 +2418,20 @@ void bch2_dev_allocator_add(struct bch_fs *c, struct bch_dev *ca) · 309 unmodified lines
24072418 set_bit(ca->dev_idx, c->rw_devs[i].d);
24082419 }
24092420
2410−void bch2_fs_allocator_background_exit(struct bch_fs *c)
2421+void bch2_dev_allocator_background_exit(struct bch_dev *ca)
2422+{
2423+ darray_exit(&ca->discard_buckets_in_flight);
2424+}
2425+
2426+void bch2_dev_allocator_background_init(struct bch_dev *ca)
24112427 {
2412− darray_exit(&c->discard_buckets_in_flight);
2428+ mutex_init(&ca->discard_buckets_in_flight_lock);
2429+ INIT_WORK(&ca->discard_work, bch2_do_discards_work);
2430+ INIT_WORK(&ca->discard_fast_work, bch2_do_discards_fast_work);
2431+ INIT_WORK(&ca->invalidate_work, bch2_do_invalidates_work);
24132432 }
24142433
24152434 void bch2_fs_allocator_background_init(struct bch_fs *c)
24162435 {
24172436 spin_lock_init(&c->freelist_lock);
2418− mutex_init(&c->discard_buckets_in_flight_lock);
2419− INIT_WORK(&c->discard_work, bch2_do_discards_work);
2420− INIT_WORK(&c->discard_fast_work, bch2_do_discards_fast_work);
2421− INIT_WORK(&c->invalidate_work, bch2_do_invalidates_work);
24222437 }
fs/bcachefs/alloc_background.h+5−1
@@ -275,6 +275,7 @@ int bch2_trigger_alloc(struct btree_trans *, enum btree_id, unsigned, · 274 unmodified lines
275275 enum btree_iter_update_trigger_flags);
276276 int bch2_check_alloc_info(struct bch_fs *);
277277 int bch2_check_alloc_to_lru_refs(struct bch_fs *);
278+void bch2_dev_do_discards(struct bch_dev *);
278279 void bch2_do_discards(struct bch_fs *);
279280
280281 static inline u64 should_invalidate_buckets(struct bch_dev *ca,
@@ -289,6 +290,7 @@ static inline u64 should_invalidate_buckets(struct bch_dev *ca, · 8 unmodified lines
289290 return clamp_t(s64, want_free - free, 0, u.d[BCH_DATA_cached].buckets);
290291 }
291292
293+void bch2_dev_do_invalidates(struct bch_dev *);
292294 void bch2_do_invalidates(struct bch_fs *);
293295
294296 static inline struct bch_backpointer *alloc_v4_backpointers(struct bch_alloc_v4 *a)
@@ -312,7 +314,9 @@ u64 bch2_min_rw_member_capacity(struct bch_fs *); · 17 unmodified lines
312314 void bch2_dev_allocator_remove(struct bch_fs *, struct bch_dev *);
313315 void bch2_dev_allocator_add(struct bch_fs *, struct bch_dev *);
314316
315−void bch2_fs_allocator_background_exit(struct bch_fs *);
317+void bch2_dev_allocator_background_exit(struct bch_dev *);
318+void bch2_dev_allocator_background_init(struct bch_dev *);
319+
316320 void bch2_fs_allocator_background_init(struct bch_fs *);
317321
318322 #endif /* _BCACHEFS_ALLOC_BACKGROUND_H */
fs/bcachefs/alloc_foreground.c+2−2
@@ -621,13 +621,13 @@ again: · 620 unmodified lines
621621 avail = dev_buckets_free(ca, *usage, watermark);
622622
623623 if (usage->d[BCH_DATA_need_discard].buckets > avail)
624− bch2_do_discards(c);
624+ bch2_dev_do_discards(ca);
625625
626626 if (usage->d[BCH_DATA_need_gc_gens].buckets > avail)
627627 bch2_gc_gens_async(c);
628628
629629 if (should_invalidate_buckets(ca, *usage))
630− bch2_do_invalidates(c);
630+ bch2_dev_do_invalidates(ca);
631631
632632 if (!avail) {
633633 if (cl && !waiting) {
fs/bcachefs/bcachefs.h+11−5
@@ -493,6 +493,11 @@ struct io_count { · 492 unmodified lines
493493 u64 sectors[2][BCH_DATA_NR];
494494 };
495495
496+struct discard_in_flight {
497+ bool in_progress:1;
498+ u64 bucket:63;
499+};
500+
496501 struct bch_dev {
497502 struct kobject kobj;
498503 #ifdef CONFIG_BCACHEFS_DEBUG
@@ -554,6 +559,12 @@ struct bch_dev { · 55 unmodified lines
554559 size_t inc_gen_really_needs_gc;
555560 size_t buckets_waiting_on_journal;
556561
562+ struct work_struct invalidate_work;
563+ struct work_struct discard_work;
564+ struct mutex discard_buckets_in_flight_lock;
565+ DARRAY(struct discard_in_flight) discard_buckets_in_flight;
566+ struct work_struct discard_fast_work;
567+
557568 atomic64_t rebalance_work;
558569
559570 struct journal_device journal;
@@ -915,11 +926,6 @@ struct bch_fs { · 355 unmodified lines
915926 unsigned write_points_nr;
916927
917928 struct buckets_waiting_for_journal buckets_waiting_for_journal;
918− struct work_struct invalidate_work;
919− struct work_struct discard_work;
920− struct mutex discard_buckets_in_flight_lock;
921− DARRAY(struct bpos) discard_buckets_in_flight;
922− struct work_struct discard_fast_work;
923929
924930 /* GARBAGE COLLECTION */
925931 struct work_struct gc_gens_work;
fs/bcachefs/btree_iter.c+6−13
@@ -3130,7 +3130,6 @@ struct btree_trans *__bch2_trans_get(struct bch_fs *c, unsigned fn_idx) · 3129 unmodified lines
31303130
31313131 trans = mempool_alloc(&c->btree_trans_pool, GFP_NOFS);
31323132 memset(trans, 0, sizeof(*trans));
3133− closure_init_stack(&trans->ref);
31343133
31353134 seqmutex_lock(&c->btree_trans_lock);
31363135 if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) {
@@ -3150,18 +3149,12 @@ struct btree_trans *__bch2_trans_get(struct bch_fs *c, unsigned fn_idx) · 13 unmodified lines
31503149 BUG_ON(pos_task &&
31513150 pid == pos_task->pid &&
31523151 pos->locked);
3153−
3154− if (pos_task && pid < pos_task->pid) {
3155− list_add_tail(&trans->list, &pos->list);
3156− goto list_add_done;
3157− }
31583152 }
31593153 }
3160− list_add_tail(&trans->list, &c->btree_trans_list);
3161−list_add_done:
3154+
3155+ list_add(&trans->list, &c->btree_trans_list);
31623156 seqmutex_unlock(&c->btree_trans_lock);
31633157 got_trans:
3164− trans->ref.closure_get_happened = false;
31653158 trans->c = c;
31663159 trans->last_begin_time = local_clock();
31673160 trans->fn_idx = fn_idx;
@@ -3200,6 +3193,8 @@ got_trans: · 32 unmodified lines
32003193 trans->srcu_idx = srcu_read_lock(&c->btree_trans_barrier);
32013194 trans->srcu_lock_time = jiffies;
32023195 trans->srcu_held = true;
3196+
3197+ closure_init_stack_release(&trans->ref);
32033198 return trans;
32043199 }
32053200
@@ -3257,10 +3252,10 @@ void bch2_trans_put(struct btree_trans *trans) · 51 unmodified lines
32573252 bch2_journal_keys_put(c);
32583253
32593254 /*
3260− * trans->ref protects trans->locking_wait.task, btree_paths arary; used
3255+ * trans->ref protects trans->locking_wait.task, btree_paths array; used
32613256 * by cycle detector
32623257 */
3263− closure_sync(&trans->ref);
3258+ closure_return_sync(&trans->ref);
32643259 trans->locking_wait.task = NULL;
32653260
32663261 unsigned long *paths_allocated = trans->paths_allocated;
@@ -3385,8 +3380,6 @@ void bch2_fs_btree_iter_exit(struct bch_fs *c) · 118 unmodified lines
33853380 per_cpu_ptr(c->btree_trans_bufs, cpu)->trans;
33863381
33873382 if (trans) {
3388− closure_sync(&trans->ref);
3389−
33903383 seqmutex_lock(&c->btree_trans_lock);
33913384 list_del(&trans->list);
33923385 seqmutex_unlock(&c->btree_trans_lock);
fs/bcachefs/chardev.c+6−3
@@ -216,7 +216,8 @@ static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a · 215 unmodified lines
216216
217217 ret = PTR_ERR_OR_ZERO(optstr) ?:
218218 bch2_parse_mount_opts(NULL, &thr->opts, optstr);
219− kfree(optstr);
219+ if (!IS_ERR(optstr))
220+ kfree(optstr);
220221
221222 if (ret)
222223 goto err;
@@ -319,7 +320,8 @@ static long bch2_ioctl_disk_add(struct bch_fs *c, struct bch_ioctl_disk arg) · 96 unmodified lines
319320 return ret;
320321
321322 ret = bch2_dev_add(c, path);
322− kfree(path);
323+ if (!IS_ERR(path))
324+ kfree(path);
323325
324326 return ret;
325327 }
@@ -850,7 +852,8 @@ static long bch2_ioctl_fsck_online(struct bch_fs *c, · 524 unmodified lines
850852
851853 ret = PTR_ERR_OR_ZERO(optstr) ?:
852854 bch2_parse_mount_opts(c, &thr->opts, optstr);
853− kfree(optstr);
855+ if (!IS_ERR(optstr))
856+ kfree(optstr);
854857
855858 if (ret)
856859 goto err;
fs/bcachefs/debug.c+69−40
@@ -568,6 +568,32 @@ static const struct file_operations cached_btree_nodes_ops = { · 567 unmodified lines
568568 .read = bch2_cached_btree_nodes_read,
569569 };
570570
571+typedef int (*list_cmp_fn)(const struct list_head *l, const struct list_head *r);
572+
573+static void list_sort(struct list_head *head, list_cmp_fn cmp)
574+{
575+ struct list_head *pos;
576+
577+ list_for_each(pos, head)
578+ while (!list_is_last(pos, head) &&
579+ cmp(pos, pos->next) > 0) {
580+ struct list_head *pos2, *next = pos->next;
581+
582+ list_del(next);
583+ list_for_each(pos2, head)
584+ if (cmp(next, pos2) < 0)
585+ goto pos_found;
586+ BUG();
587+pos_found:
588+ list_add_tail(next, pos2);
589+ }
590+}
591+
592+static int list_ptr_order_cmp(const struct list_head *l, const struct list_head *r)
593+{
594+ return cmp_int(l, r);
595+}
596+
571597 static ssize_t bch2_btree_transactions_read(struct file *file, char __user *buf,
572598 size_t size, loff_t *ppos)
573599 {
@@ -575,41 +601,39 @@ static ssize_t bch2_btree_transactions_read(struct file *file, char __user *buf, · 1 unmodified line
575601 struct bch_fs *c = i->c;
576602 struct btree_trans *trans;
577603 ssize_t ret = 0;
578− u32 seq;
579604
580605 i->ubuf = buf;
581606 i->size = size;
582607 i->ret = 0;
583608 restart:
584609 seqmutex_lock(&c->btree_trans_lock);
585− list_for_each_entry(trans, &c->btree_trans_list, list) {
586− struct task_struct *task = READ_ONCE(trans->locking_wait.task);
610+ list_sort(&c->btree_trans_list, list_ptr_order_cmp);
587611
588− if (!task || task->pid <= i->iter)
612+ list_for_each_entry(trans, &c->btree_trans_list, list) {
613+ if ((ulong) trans < i->iter)
589614 continue;
590615
591− closure_get(&trans->ref);
592− seq = seqmutex_seq(&c->btree_trans_lock);
593− seqmutex_unlock(&c->btree_trans_lock);
616+ i->iter = (ulong) trans;
594617
595− ret = flush_buf(i);
596− if (ret) {
597− closure_put(&trans->ref);
598− goto unlocked;
599− }
618+ if (!closure_get_not_zero(&trans->ref))
619+ continue;
620+
621+ u32 seq = seqmutex_unlock(&c->btree_trans_lock);
600622
601623 bch2_btree_trans_to_text(&i->buf, trans);
602624
603625 prt_printf(&i->buf, "backtrace:\n");
604626 printbuf_indent_add(&i->buf, 2);
605− bch2_prt_task_backtrace(&i->buf, task, 0, GFP_KERNEL);
627+ bch2_prt_task_backtrace(&i->buf, trans->locking_wait.task, 0, GFP_KERNEL);
606628 printbuf_indent_sub(&i->buf, 2);
607629 prt_newline(&i->buf);
608630
609− i->iter = task->pid;
610−
611631 closure_put(&trans->ref);
612632
633+ ret = flush_buf(i);
634+ if (ret)
635+ goto unlocked;
636+
613637 if (!seqmutex_relock(&c->btree_trans_lock, seq))
614638 goto restart;
615639 }
@@ -804,50 +828,55 @@ static const struct file_operations btree_transaction_stats_op = { · 188 unmodified lines
804828 .read = btree_transaction_stats_read,
805829 };
806830
807−static ssize_t bch2_btree_deadlock_read(struct file *file, char __user *buf,
808− size_t size, loff_t *ppos)
831+/* walk btree transactions until we find a deadlock and print it */
832+static void btree_deadlock_to_text(struct printbuf *out, struct bch_fs *c)
809833 {
810− struct dump_iter *i = file->private_data;
811− struct bch_fs *c = i->c;
812834 struct btree_trans *trans;
813− ssize_t ret = 0;
814− u32 seq;
815−
816− i->ubuf = buf;
817− i->size = size;
818− i->ret = 0;
819−
820− if (i->iter)
821− goto out;
835+ pid_t iter = 0;
822836 restart:
823837 seqmutex_lock(&c->btree_trans_lock);
824838 list_for_each_entry(trans, &c->btree_trans_list, list) {
825839 struct task_struct *task = READ_ONCE(trans->locking_wait.task);
826840
827− if (!task || task->pid <= i->iter)
841+ if (!task || task->pid <= iter)
828842 continue;
829843
830− closure_get(&trans->ref);
831− seq = seqmutex_seq(&c->btree_trans_lock);
832− seqmutex_unlock(&c->btree_trans_lock);
844+ iter = task->pid;
833845
834− ret = flush_buf(i);
835− if (ret) {
836− closure_put(&trans->ref);
837− goto out;
838− }
846+ if (!closure_get_not_zero(&trans->ref))
847+ continue;
839848
840− bch2_check_for_deadlock(trans, &i->buf);
849+ u32 seq = seqmutex_unlock(&c->btree_trans_lock);
841850
842− i->iter = task->pid;
851+ bool found = bch2_check_for_deadlock(trans, out) != 0;
843852
844853 closure_put(&trans->ref);
845854
855+ if (found)
856+ return;
857+
846858 if (!seqmutex_relock(&c->btree_trans_lock, seq))
847859 goto restart;
848860 }
849861 seqmutex_unlock(&c->btree_trans_lock);
850−out:
862+}
863+
864+static ssize_t bch2_btree_deadlock_read(struct file *file, char __user *buf,
865+ size_t size, loff_t *ppos)
866+{
867+ struct dump_iter *i = file->private_data;
868+ struct bch_fs *c = i->c;
869+ ssize_t ret = 0;
870+
871+ i->ubuf = buf;
872+ i->size = size;
873+ i->ret = 0;
874+
875+ if (!i->iter) {
876+ btree_deadlock_to_text(&i->buf, c);
877+ i->iter++;
878+ }
879+
851880 if (i->buf.allocation_failure)
852881 ret = -ENOMEM;
853882
fs/bcachefs/journal.c+5−0
@@ -1521,6 +1521,11 @@ bool bch2_journal_seq_pins_to_text(struct printbuf *out, struct journal *j, u64 · 1520 unmodified lines
15211521 struct journal_entry_pin *pin;
15221522
15231523 spin_lock(&j->lock);
1524+ if (!test_bit(JOURNAL_running, &j->flags)) {
1525+ spin_unlock(&j->lock);
1526+ return true;
1527+ }
1528+
15241529 *seq = max(*seq, j->pin.front);
15251530
15261531 if (*seq >= j->pin.back) {
fs/bcachefs/journal_io.c+7−0
@@ -1677,6 +1677,13 @@ static CLOSURE_CALLBACK(journal_write_done) · 1676 unmodified lines
16771677 mod_delayed_work(j->wq, &j->write_work, max(0L, delta));
16781678 }
16791679
1680+ /*
1681+ * We don't typically trigger journal writes from her - the next journal
1682+ * write will be triggered immediately after the previous one is
1683+ * allocated, in bch2_journal_write() - but the journal write error path
1684+ * is special:
1685+ */
1686+ bch2_journal_do_writes(j);
16801687 spin_unlock(&j->lock);
16811688 }
16821689
fs/bcachefs/journal_seq_blacklist.c+1−1
@@ -232,7 +232,7 @@ bool bch2_blacklist_entries_gc(struct bch_fs *c) · 231 unmodified lines
232232 BUG_ON(nr != t->nr);
233233
234234 unsigned i;
235− for (src = bl->start, i = eytzinger0_first(t->nr);
235+ for (src = bl->start, i = t->nr == 0 ? 0 : eytzinger0_first(t->nr);
236236 src < bl->start + nr;
237237 src++, i = eytzinger0_next(i, nr)) {
238238 BUG_ON(t->entries[i].start != le64_to_cpu(src->start));
fs/bcachefs/sb-errors.c+10−4
@@ -110,19 +110,25 @@ out: · 109 unmodified lines
110110 void bch2_sb_errors_from_cpu(struct bch_fs *c)
111111 {
112112 bch_sb_errors_cpu *src = &c->fsck_error_counts;
113− struct bch_sb_field_errors *dst =
114− bch2_sb_field_resize(&c->disk_sb, errors,
115− bch2_sb_field_errors_u64s(src->nr));
113+ struct bch_sb_field_errors *dst;
116114 unsigned i;
117115
116+ mutex_lock(&c->fsck_error_counts_lock);
117+
118+ dst = bch2_sb_field_resize(&c->disk_sb, errors,
119+ bch2_sb_field_errors_u64s(src->nr));
120+
118121 if (!dst)
119− return;
122+ goto err;
120123
121124 for (i = 0; i < src->nr; i++) {
122125 SET_BCH_SB_ERROR_ENTRY_ID(&dst->entries[i], src->data[i].id);
123126 SET_BCH_SB_ERROR_ENTRY_NR(&dst->entries[i], src->data[i].nr);
124127 dst->entries[i].last_error_time = cpu_to_le64(src->data[i].last_error_time);
125128 }
129+
130+err:
131+ mutex_unlock(&c->fsck_error_counts_lock);
126132 }
127133
128134 static int bch2_sb_errors_to_cpu(struct bch_fs *c)
fs/bcachefs/seqmutex.h+4−7
@@ -19,17 +19,14 @@ static inline bool seqmutex_trylock(struct seqmutex *lock) · 18 unmodified lines
1919 static inline void seqmutex_lock(struct seqmutex *lock)
2020 {
2121 mutex_lock(&lock->lock);
22−}
23−
24−static inline void seqmutex_unlock(struct seqmutex *lock)
25−{
2622 lock->seq++;
27− mutex_unlock(&lock->lock);
2823 }
2924
30−static inline u32 seqmutex_seq(struct seqmutex *lock)
25+static inline u32 seqmutex_unlock(struct seqmutex *lock)
3126 {
32− return lock->seq;
27+ u32 seq = lock->seq;
28+ mutex_unlock(&lock->lock);
29+ return seq;
3330 }
3431
3532 static inline bool seqmutex_relock(struct seqmutex *lock, u32 seq)
fs/bcachefs/snapshot.c+3−0
@@ -168,6 +168,9 @@ static noinline struct snapshot_t *__snapshot_t_mut(struct bch_fs *c, u32 id) · 167 unmodified lines
168168 size_t new_bytes = kmalloc_size_roundup(struct_size(new, s, idx + 1));
169169 size_t new_size = (new_bytes - sizeof(*new)) / sizeof(new->s[0]);
170170
171+ if (unlikely(new_bytes > INT_MAX))
172+ return NULL;
173+
171174 new = kvzalloc(new_bytes, GFP_KERNEL);
172175 if (!new)
173176 return NULL;
fs/bcachefs/super.c+5−1
@@ -536,7 +536,6 @@ static void __bch2_fs_free(struct bch_fs *c) · 535 unmodified lines
536536
537537 bch2_find_btree_nodes_exit(&c->found_btree_nodes);
538538 bch2_free_pending_node_rewrites(c);
539− bch2_fs_allocator_background_exit(c);
540539 bch2_fs_sb_errors_exit(c);
541540 bch2_fs_counters_exit(c);
542541 bch2_fs_snapshots_exit(c);
@@ -1195,6 +1194,7 @@ static void bch2_dev_free(struct bch_dev *ca) · 652 unmodified lines
11951194
11961195 kfree(ca->buckets_nouse);
11971196 bch2_free_super(&ca->disk_sb);
1197+ bch2_dev_allocator_background_exit(ca);
11981198 bch2_dev_journal_exit(ca);
11991199
12001200 free_percpu(ca->io_done);
@@ -1317,6 +1317,8 @@ static struct bch_dev *__bch2_dev_alloc(struct bch_fs *c, · 116 unmodified lines
13171317 atomic_long_set(&ca->ref, 1);
13181318 #endif
13191319
1320+ bch2_dev_allocator_background_init(ca);
1321+
13201322 if (percpu_ref_init(&ca->io_ref, bch2_dev_io_ref_complete,
13211323 PERCPU_REF_INIT_DEAD, GFP_KERNEL) ||
13221324 !(ca->sb_read_scratch = (void *) __get_free_page(GFP_KERNEL)) ||
@@ -1529,6 +1531,7 @@ static void __bch2_dev_read_only(struct bch_fs *c, struct bch_dev *ca) · 206 unmodified lines
15291531 * The allocator thread itself allocates btree nodes, so stop it first:
15301532 */
15311533 bch2_dev_allocator_remove(c, ca);
1534+ bch2_recalc_capacity(c);
15321535 bch2_dev_journal_stop(&c->journal, ca);
15331536 }
15341537
@@ -1540,6 +1543,7 @@ static void __bch2_dev_read_write(struct bch_fs *c, struct bch_dev *ca) · 5 unmodified lines
15401543
15411544 bch2_dev_allocator_add(c, ca);
15421545 bch2_recalc_capacity(c);
1546+ bch2_dev_do_discards(ca);
15431547 }
15441548
15451549 int __bch2_dev_set_state(struct bch_fs *c, struct bch_dev *ca,
fs/btrfs/block-group.c+11−2
@@ -1924,8 +1924,17 @@ void btrfs_reclaim_bgs_work(struct work_struct *work) · 1923 unmodified lines
19241924 next:
19251925 if (ret) {
19261926 /* Refcount held by the reclaim_bgs list after splice. */
1927− btrfs_get_block_group(bg);
1928− list_add_tail(&bg->bg_list, &retry_list);
1927+ spin_lock(&fs_info->unused_bgs_lock);
1928+ /*
1929+ * This block group might be added to the unused list
1930+ * during the above process. Move it back to the
1931+ * reclaim list otherwise.
1932+ */
1933+ if (list_empty(&bg->bg_list)) {
1934+ btrfs_get_block_group(bg);
1935+ list_add_tail(&bg->bg_list, &retry_list);
1936+ }
1937+ spin_unlock(&fs_info->unused_bgs_lock);
19291938 }
19301939 btrfs_put_block_group(bg);
19311940
fs/btrfs/free-space-cache.c+1−1
@@ -2697,7 +2697,7 @@ static int __btrfs_add_free_space_zoned(struct btrfs_block_group *block_group, · 2696 unmodified lines
26972697 u64 offset = bytenr - block_group->start;
26982698 u64 to_free, to_unusable;
26992699 int bg_reclaim_threshold = 0;
2700− bool initial = (size == block_group->length);
2700+ bool initial = ((size == block_group->length) && (block_group->alloc_offset == 0));
27012701 u64 reclaimable_unusable;
27022702
27032703 WARN_ON(!initial && offset + size > block_group->zone_capacity);
fs/btrfs/qgroup.c+2−2
@@ -1351,7 +1351,7 @@ static int flush_reservations(struct btrfs_fs_info *fs_info) · 1350 unmodified lines
13511351
13521352 int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
13531353 {
1354− struct btrfs_root *quota_root;
1354+ struct btrfs_root *quota_root = NULL;
13551355 struct btrfs_trans_handle *trans = NULL;
13561356 int ret = 0;
13571357
@@ -1449,9 +1449,9 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info) · 91 unmodified lines
14491449 btrfs_free_tree_block(trans, btrfs_root_id(quota_root),
14501450 quota_root->node, 0, 1);
14511451
1452− btrfs_put_root(quota_root);
14531452
14541453 out:
1454+ btrfs_put_root(quota_root);
14551455 mutex_unlock(&fs_info->qgroup_ioctl_lock);
14561456 if (ret && trans)
14571457 btrfs_end_transaction(trans);
fs/btrfs/scrub.c+14−10
@@ -1688,20 +1688,24 @@ static void scrub_submit_extent_sector_read(struct scrub_ctx *sctx, · 1687 unmodified lines
16881688 (i << fs_info->sectorsize_bits);
16891689 int err;
16901690
1691− bbio = btrfs_bio_alloc(stripe->nr_sectors, REQ_OP_READ,
1692− fs_info, scrub_read_endio, stripe);
1693− bbio->bio.bi_iter.bi_sector = logical >> SECTOR_SHIFT;
1694−
16951691 io_stripe.is_scrub = true;
1692+ stripe_len = (nr_sectors - i) << fs_info->sectorsize_bits;
1693+ /*
1694+ * For RST cases, we need to manually split the bbio to
1695+ * follow the RST boundary.
1696+ */
16961697 err = btrfs_map_block(fs_info, BTRFS_MAP_READ, logical,
1697− &stripe_len, &bioc, &io_stripe,
1698− &mirror);
1698+ &stripe_len, &bioc, &io_stripe, &mirror);
16991699 btrfs_put_bioc(bioc);
1700− if (err) {
1701− btrfs_bio_end_io(bbio,
1702− errno_to_blk_status(err));
1703− return;
1700+ if (err < 0) {
1701+ set_bit(i, &stripe->io_error_bitmap);
1702+ set_bit(i, &stripe->error_bitmap);
1703+ continue;
17041704 }
1705+
1706+ bbio = btrfs_bio_alloc(stripe->nr_sectors, REQ_OP_READ,
1707+ fs_info, scrub_read_endio, stripe);
1708+ bbio->bio.bi_iter.bi_sector = logical >> SECTOR_SHIFT;
17051709 }
17061710
17071711 __bio_add_page(&bbio->bio, page, fs_info->sectorsize, pgoff);
fs/btrfs/tree-log.c+28−15
@@ -138,6 +138,25 @@ static void wait_log_commit(struct btrfs_root *root, int transid); · 137 unmodified lines
138138 * and once to do all the other items.
139139 */
140140
141+static struct inode *btrfs_iget_logging(u64 objectid, struct btrfs_root *root)
142+{
143+ unsigned int nofs_flag;
144+ struct inode *inode;
145+
146+ /*
147+ * We're holding a transaction handle whether we are logging or
148+ * replaying a log tree, so we must make sure NOFS semantics apply
149+ * because btrfs_alloc_inode() may be triggered and it uses GFP_KERNEL
150+ * to allocate an inode, which can recurse back into the filesystem and
151+ * attempt a transaction commit, resulting in a deadlock.
152+ */
153+ nofs_flag = memalloc_nofs_save();
154+ inode = btrfs_iget(root->fs_info->sb, objectid, root);
155+ memalloc_nofs_restore(nofs_flag);
156+
157+ return inode;
158+}
159+
141160 /*
142161 * start a sub transaction and setup the log tree
143162 * this increments the log tree writer count to make the people
@@ -600,7 +619,7 @@ static noinline struct inode *read_one_inode(struct btrfs_root *root, · 456 unmodified lines
600619 {
601620 struct inode *inode;
602621
603− inode = btrfs_iget(root->fs_info->sb, objectid, root);
622+ inode = btrfs_iget_logging(objectid, root);
604623 if (IS_ERR(inode))
605624 inode = NULL;
606625 return inode;
@@ -5438,7 +5457,6 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans, · 4831 unmodified lines
54385457 struct btrfs_log_ctx *ctx)
54395458 {
54405459 struct btrfs_root *root = start_inode->root;
5441− struct btrfs_fs_info *fs_info = root->fs_info;
54425460 struct btrfs_path *path;
54435461 LIST_HEAD(dir_list);
54445462 struct btrfs_dir_list *dir_elem;
@@ -5499,7 +5517,7 @@ again: · 54 unmodified lines
54995517 continue;
55005518
55015519 btrfs_release_path(path);
5502− di_inode = btrfs_iget(fs_info->sb, di_key.objectid, root);
5520+ di_inode = btrfs_iget_logging(di_key.objectid, root);
55035521 if (IS_ERR(di_inode)) {
55045522 ret = PTR_ERR(di_inode);
55055523 goto out;
@@ -5559,7 +5577,7 @@ again: · 53 unmodified lines
55595577 btrfs_add_delayed_iput(curr_inode);
55605578 curr_inode = NULL;
55615579
5562− vfs_inode = btrfs_iget(fs_info->sb, ino, root);
5580+ vfs_inode = btrfs_iget_logging(ino, root);
55635581 if (IS_ERR(vfs_inode)) {
55645582 ret = PTR_ERR(vfs_inode);
55655583 break;
@@ -5654,7 +5672,7 @@ static int add_conflicting_inode(struct btrfs_trans_handle *trans, · 88 unmodified lines
56545672 if (ctx->num_conflict_inodes >= MAX_CONFLICT_INODES)
56555673 return BTRFS_LOG_FORCE_COMMIT;
56565674
5657− inode = btrfs_iget(root->fs_info->sb, ino, root);
5675+ inode = btrfs_iget_logging(ino, root);
56585676 /*
56595677 * If the other inode that had a conflicting dir entry was deleted in
56605678 * the current transaction then we either:
@@ -5755,7 +5773,6 @@ static int log_conflicting_inodes(struct btrfs_trans_handle *trans, · 94 unmodified lines
57555773 struct btrfs_root *root,
57565774 struct btrfs_log_ctx *ctx)
57575775 {
5758− struct btrfs_fs_info *fs_info = root->fs_info;
57595776 int ret = 0;
57605777
57615778 /*
@@ -5786,7 +5803,7 @@ static int log_conflicting_inodes(struct btrfs_trans_handle *trans, · 24 unmodified lines
57865803 list_del(&curr->list);
57875804 kfree(curr);
57885805
5789− inode = btrfs_iget(fs_info->sb, ino, root);
5806+ inode = btrfs_iget_logging(ino, root);
57905807 /*
57915808 * If the other inode that had a conflicting dir entry was
57925809 * deleted in the current transaction, we need to log its parent
@@ -5797,7 +5814,7 @@ static int log_conflicting_inodes(struct btrfs_trans_handle *trans, · 4 unmodified lines
57975814 if (ret != -ENOENT)
57985815 break;
57995816
5800− inode = btrfs_iget(fs_info->sb, parent, root);
5817+ inode = btrfs_iget_logging(parent, root);
58015818 if (IS_ERR(inode)) {
58025819 ret = PTR_ERR(inode);
58035820 break;
@@ -6319,7 +6336,6 @@ static int log_new_delayed_dentries(struct btrfs_trans_handle *trans, · 515 unmodified lines
63196336 struct btrfs_log_ctx *ctx)
63206337 {
63216338 const bool orig_log_new_dentries = ctx->log_new_dentries;
6322− struct btrfs_fs_info *fs_info = trans->fs_info;
63236339 struct btrfs_delayed_item *item;
63246340 int ret = 0;
63256341
@@ -6345,7 +6361,7 @@ static int log_new_delayed_dentries(struct btrfs_trans_handle *trans, · 19 unmodified lines
63456361 if (key.type == BTRFS_ROOT_ITEM_KEY)
63466362 continue;
63476363
6348− di_inode = btrfs_iget(fs_info->sb, key.objectid, inode->root);
6364+ di_inode = btrfs_iget_logging(key.objectid, inode->root);
63496365 if (IS_ERR(di_inode)) {
63506366 ret = PTR_ERR(di_inode);
63516367 break;
@@ -6729,7 +6745,6 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, · 377 unmodified lines
67296745 struct btrfs_inode *inode,
67306746 struct btrfs_log_ctx *ctx)
67316747 {
6732− struct btrfs_fs_info *fs_info = trans->fs_info;
67336748 int ret;
67346749 struct btrfs_path *path;
67356750 struct btrfs_key key;
@@ -6794,8 +6809,7 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, · 58 unmodified lines
67946809 cur_offset = item_size;
67956810 }
67966811
6797− dir_inode = btrfs_iget(fs_info->sb, inode_key.objectid,
6798− root);
6812+ dir_inode = btrfs_iget_logging(inode_key.objectid, root);
67996813 /*
68006814 * If the parent inode was deleted, return an error to
68016815 * fallback to a transaction commit. This is to prevent
@@ -6857,7 +6871,6 @@ static int log_new_ancestors(struct btrfs_trans_handle *trans, · 55 unmodified lines
68576871 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]);
68586872
68596873 while (true) {
6860− struct btrfs_fs_info *fs_info = root->fs_info;
68616874 struct extent_buffer *leaf;
68626875 int slot;
68636876 struct btrfs_key search_key;
@@ -6872,7 +6885,7 @@ static int log_new_ancestors(struct btrfs_trans_handle *trans, · 8 unmodified lines
68726885 search_key.objectid = found_key.offset;
68736886 search_key.type = BTRFS_INODE_ITEM_KEY;
68746887 search_key.offset = 0;
6875− inode = btrfs_iget(fs_info->sb, ino, root);
6888+ inode = btrfs_iget_logging(ino, root);
68766889 if (IS_ERR(inode))
68776890 return PTR_ERR(inode);
68786891
fs/dcache.c+14−17
@@ -3029,28 +3029,25 @@ EXPORT_SYMBOL(d_splice_alias); · 3028 unmodified lines
30293029
30303030 bool is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
30313031 {
3032− bool result;
3032+ bool subdir;
30333033 unsigned seq;
30343034
30353035 if (new_dentry == old_dentry)
30363036 return true;
30373037
3038− do {
3039− /* for restarting inner loop in case of seq retry */
3040− seq = read_seqbegin(&rename_lock);
3041− /*
3042− * Need rcu_readlock to protect against the d_parent trashing
3043− * due to d_move
3044− */
3045− rcu_read_lock();
3046− if (d_ancestor(old_dentry, new_dentry))
3047− result = true;
3048− else
3049− result = false;
3050− rcu_read_unlock();
3051− } while (read_seqretry(&rename_lock, seq));
3052−
3053− return result;
3038+ /* Access d_parent under rcu as d_move() may change it. */
3039+ rcu_read_lock();
3040+ seq = read_seqbegin(&rename_lock);
3041+ subdir = d_ancestor(old_dentry, new_dentry);
3042+ /* Try lockless once... */
3043+ if (read_seqretry(&rename_lock, seq)) {
3044+ /* ...else acquire lock for progress even on deep chains. */
3045+ read_seqlock_excl(&rename_lock);
3046+ subdir = d_ancestor(old_dentry, new_dentry);
3047+ read_sequnlock_excl(&rename_lock);
3048+ }
3049+ rcu_read_unlock();
3050+ return subdir;
30543051 }
30553052 EXPORT_SYMBOL(is_subdir);
30563053
fs/erofs/super.c+1−1
@@ -343,7 +343,7 @@ static int erofs_read_superblock(struct super_block *sb) · 342 unmodified lines
343343 sbi->build_time = le64_to_cpu(dsb->build_time);
344344 sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec);
345345
346− memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid));
346+ super_set_uuid(sb, (void *)dsb->uuid, sizeof(dsb->uuid));
347347
348348 ret = strscpy(sbi->volume_name, dsb->volume_name,
349349 sizeof(dsb->volume_name));
fs/erofs/zmap.c+2−0
@@ -711,6 +711,8 @@ int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map, · 710 unmodified lines
711711
712712 err = z_erofs_do_map_blocks(inode, map, flags);
713713 out:
714+ if (err)
715+ map->m_llen = 0;
714716 trace_z_erofs_map_blocks_iter_exit(inode, map, flags, err);
715717 return err;
716718 }
fs/erofs/zutil.c+4−4
@@ -148,7 +148,7 @@ int __init z_erofs_gbuf_init(void) · 147 unmodified lines
148148
149149 void z_erofs_gbuf_exit(void)
150150 {
151− int i;
151+ int i, j;
152152
153153 for (i = 0; i < z_erofs_gbuf_count + (!!z_erofs_rsvbuf); ++i) {
154154 struct z_erofs_gbuf *gbuf = &z_erofs_gbufpool[i];
@@ -161,9 +161,9 @@ void z_erofs_gbuf_exit(void) · 6 unmodified lines
161161 if (!gbuf->pages)
162162 continue;
163163
164− for (i = 0; i < gbuf->nrpages; ++i)
165− if (gbuf->pages[i])
166− put_page(gbuf->pages[i]);
164+ for (j = 0; j < gbuf->nrpages; ++j)
165+ if (gbuf->pages[j])
166+ put_page(gbuf->pages[j]);
167167 kfree(gbuf->pages);
168168 gbuf->pages = NULL;
169169 }
fs/locks.c+4−5
@@ -2448,8 +2448,9 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, · 2447 unmodified lines
24482448 error = do_lock_file_wait(filp, cmd, file_lock);
24492449
24502450 /*
2451− * Attempt to detect a close/fcntl race and recover by releasing the
2452− * lock that was just acquired. There is no need to do that when we're
2451+ * Detect close/fcntl races and recover by zapping all POSIX locks
2452+ * associated with this file and our files_struct, just like on
2453+ * filp_flush(). There is no need to do that when we're
24532454 * unlocking though, or for OFD locks.
24542455 */
24552456 if (!error && file_lock->c.flc_type != F_UNLCK &&
@@ -2464,9 +2465,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, · 8 unmodified lines
24642465 f = files_lookup_fd_locked(files, fd);
24652466 spin_unlock(&files->file_lock);
24662467 if (f != filp) {
2467− file_lock->c.flc_type = F_UNLCK;
2468− error = do_lock_file_wait(filp, cmd, file_lock);
2469− WARN_ON_ONCE(error);
2468+ locks_remove_posix(filp, files);
24702469 error = -EBADF;
24712470 }
24722471 }
fs/namei.c+8−2
@@ -3572,8 +3572,12 @@ static const char *open_last_lookups(struct nameidata *nd, · 3571 unmodified lines
35723572 else
35733573 inode_lock_shared(dir->d_inode);
35743574 dentry = lookup_open(nd, file, op, got_write);
3575− if (!IS_ERR(dentry) && (file->f_mode & FMODE_CREATED))
3576− fsnotify_create(dir->d_inode, dentry);
3575+ if (!IS_ERR(dentry)) {
3576+ if (file->f_mode & FMODE_CREATED)
3577+ fsnotify_create(dir->d_inode, dentry);
3578+ if (file->f_mode & FMODE_OPENED)
3579+ fsnotify_open(file);
3580+ }
35773581 if (open_flag & O_CREAT)
35783582 inode_unlock(dir->d_inode);
35793583 else
@@ -3700,6 +3704,8 @@ int vfs_tmpfile(struct mnt_idmap *idmap, · 120 unmodified lines
37003704 mode = vfs_prepare_mode(idmap, dir, mode, mode, mode);
37013705 error = dir->i_op->tmpfile(idmap, dir, file, mode);
37023706 dput(child);
3707+ if (file->f_mode & FMODE_OPENED)
3708+ fsnotify_open(file);
37033709 if (error)
37043710 return error;
37053711 /* Don't check for other permissions, the inode was just created */
fs/netfs/buffered_write.c+9−3
@@ -523,6 +523,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr · 522 unmodified lines
523523 struct netfs_group *group;
524524 struct folio *folio = page_folio(vmf->page);
525525 struct file *file = vmf->vma->vm_file;
526+ struct address_space *mapping = file->f_mapping;
526527 struct inode *inode = file_inode(file);
527528 struct netfs_inode *ictx = netfs_inode(inode);
528529 vm_fault_t ret = VM_FAULT_RETRY;
@@ -534,6 +535,11 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr · 5 unmodified lines
534535
535536 if (folio_lock_killable(folio) < 0)
536537 goto out;
538+ if (folio->mapping != mapping) {
539+ folio_unlock(folio);
540+ ret = VM_FAULT_NOPAGE;
541+ goto out;
542+ }
537543
538544 if (folio_wait_writeback_killable(folio)) {
539545 ret = VM_FAULT_LOCKED;
@@ -549,9 +555,9 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr · 9 unmodified lines
549555 group = netfs_folio_group(folio);
550556 if (group != netfs_group && group != NETFS_FOLIO_COPY_TO_CACHE) {
551557 folio_unlock(folio);
552− err = filemap_fdatawait_range(inode->i_mapping,
553− folio_pos(folio),
554− folio_pos(folio) + folio_size(folio));
558+ err = filemap_fdatawrite_range(mapping,
559+ folio_pos(folio),
560+ folio_pos(folio) + folio_size(folio));
555561 switch (err) {
556562 case 0:
557563 ret = VM_FAULT_RETRY;
fs/netfs/direct_write.c+2−1
@@ -92,8 +92,9 @@ ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter * · 91 unmodified lines
9292 __set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags);
9393 if (async)
9494 wreq->iocb = iocb;
95+ wreq->len = iov_iter_count(&wreq->io_iter);
9596 wreq->cleanup = netfs_cleanup_dio_write;
96− ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), iov_iter_count(&wreq->io_iter));
97+ ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len);
9798 if (ret < 0) {
9899 _debug("begin = %zd", ret);
99100 goto out;
fs/netfs/internal.h+0−9
@@ -63,15 +63,6 @@ static inline void netfs_proc_del_rreq(struct netfs_io_request *rreq) {} · 62 unmodified lines
6363 /*
6464 * misc.c
6565 */
66−#define NETFS_FLAG_PUT_MARK BIT(0)
67−#define NETFS_FLAG_PAGECACHE_MARK BIT(1)
68−int netfs_xa_store_and_mark(struct xarray *xa, unsigned long index,
69− struct folio *folio, unsigned int flags,
70− gfp_t gfp_mask);
71−int netfs_add_folios_to_buffer(struct xarray *buffer,
72− struct address_space *mapping,
73− pgoff_t index, pgoff_t to, gfp_t gfp_mask);
74−void netfs_clear_buffer(struct xarray *buffer);
7566
7667 /*
7768 * objects.c
fs/netfs/misc.c+0−81
@@ -8,87 +8,6 @@ · 7 unmodified lines
88 #include <linux/swap.h>
99 #include "internal.h"
1010
11−/*
12− * Attach a folio to the buffer and maybe set marks on it to say that we need
13− * to put the folio later and twiddle the pagecache flags.
14− */
15−int netfs_xa_store_and_mark(struct xarray *xa, unsigned long index,
16− struct folio *folio, unsigned int flags,
17− gfp_t gfp_mask)
18−{
19− XA_STATE_ORDER(xas, xa, index, folio_order(folio));
20−
21−retry:
22− xas_lock(&xas);
23− for (;;) {
24− xas_store(&xas, folio);
25− if (!xas_error(&xas))
26− break;
27− xas_unlock(&xas);
28− if (!xas_nomem(&xas, gfp_mask))
29− return xas_error(&xas);
30− goto retry;
31− }
32−
33− if (flags & NETFS_FLAG_PUT_MARK)
34− xas_set_mark(&xas, NETFS_BUF_PUT_MARK);
35− if (flags & NETFS_FLAG_PAGECACHE_MARK)
36− xas_set_mark(&xas, NETFS_BUF_PAGECACHE_MARK);
37− xas_unlock(&xas);
38− return xas_error(&xas);
39−}
40−
41−/*
42− * Create the specified range of folios in the buffer attached to the read
43− * request. The folios are marked with NETFS_BUF_PUT_MARK so that we know that
44− * these need freeing later.
45− */
46−int netfs_add_folios_to_buffer(struct xarray *buffer,
47− struct address_space *mapping,
48− pgoff_t index, pgoff_t to, gfp_t gfp_mask)
49−{
50− struct folio *folio;
51− int ret;
52−
53− if (to + 1 == index) /* Page range is inclusive */
54− return 0;
55−
56− do {
57− /* TODO: Figure out what order folio can be allocated here */
58− folio = filemap_alloc_folio(readahead_gfp_mask(mapping), 0);
59− if (!folio)
60− return -ENOMEM;
61− folio->index = index;
62− ret = netfs_xa_store_and_mark(buffer, index, folio,
63− NETFS_FLAG_PUT_MARK, gfp_mask);
64− if (ret < 0) {
65− folio_put(folio);
66− return ret;
67− }
68−
69− index += folio_nr_pages(folio);
70− } while (index <= to && index != 0);
71−
72− return 0;
73−}
74−
75−/*
76− * Clear an xarray buffer, putting a ref on the folios that have
77− * NETFS_BUF_PUT_MARK set.
78− */
79−void netfs_clear_buffer(struct xarray *buffer)
80−{
81− struct folio *folio;
82− XA_STATE(xas, buffer, 0);
83−
84− rcu_read_lock();
85− xas_for_each_marked(&xas, folio, ULONG_MAX, NETFS_BUF_PUT_MARK) {
86− folio_put(folio);
87− }
88− rcu_read_unlock();
89− xa_destroy(buffer);
90−}
91−
9211 /**
9312 * netfs_dirty_folio - Mark folio dirty and pin a cache object for writeback
9413 * @mapping: The mapping the folio belongs to.
fs/netfs/write_issue.c+1−1
@@ -483,7 +483,7 @@ static int netfs_write_folio(struct netfs_io_request *wreq, · 482 unmodified lines
483483 if (!debug)
484484 kdebug("R=%x: No submit", wreq->debug_id);
485485
486− if (flen < fsize)
486+ if (foff + flen < fsize)
487487 for (int s = 0; s < NR_IO_STREAMS; s++)
488488 netfs_issue_write(wreq, &wreq->io_streams[s]);
489489
fs/nfsd/nfsctl.c+2−0
@@ -2169,6 +2169,8 @@ static __net_init int nfsd_net_init(struct net *net) · 2168 unmodified lines
21692169 nn->nfsd_svcstats.program = &nfsd_program;
21702170 nn->nfsd_versions = NULL;
21712171 nn->nfsd4_minorversions = NULL;
2172+ nn->nfsd_info.mutex = &nfsd_mutex;
2173+ nn->nfsd_serv = NULL;
21722174 nfsd4_init_leases_net(nn);
21732175 get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key));
21742176 seqlock_init(&nn->writeverf_lock);
fs/nfsd/nfssvc.c+0−1
@@ -672,7 +672,6 @@ int nfsd_create_serv(struct net *net) · 671 unmodified lines
672672 return error;
673673 }
674674 spin_lock(&nfsd_notifier_lock);
675− nn->nfsd_info.mutex = &nfsd_mutex;
676675 nn->nfsd_serv = serv;
677676 spin_unlock(&nfsd_notifier_lock);
678677
fs/nilfs2/alloc.c+15−4
@@ -377,11 +377,12 @@ void *nilfs_palloc_block_get_entry(const struct inode *inode, __u64 nr, · 376 unmodified lines
377377 * @target: offset number of an entry in the group (start point)
378378 * @bsize: size in bits
379379 * @lock: spin lock protecting @bitmap
380+ * @wrap: whether to wrap around
380381 */
381382 static int nilfs_palloc_find_available_slot(unsigned char *bitmap,
382383 unsigned long target,
383384 unsigned int bsize,
384− spinlock_t *lock)
385+ spinlock_t *lock, bool wrap)
385386 {
386387 int pos, end = bsize;
387388
@@ -397,6 +398,8 @@ static int nilfs_palloc_find_available_slot(unsigned char *bitmap, · 9 unmodified lines
397398
398399 end = target;
399400 }
401+ if (!wrap)
402+ return -ENOSPC;
400403
401404 /* wrap around */
402405 for (pos = 0; pos < end; pos++) {
@@ -495,9 +498,10 @@ int nilfs_palloc_count_max_entries(struct inode *inode, u64 nused, u64 *nmaxp) · 92 unmodified lines
495498 * nilfs_palloc_prepare_alloc_entry - prepare to allocate a persistent object
496499 * @inode: inode of metadata file using this allocator
497500 * @req: nilfs_palloc_req structure exchanged for the allocation
501+ * @wrap: whether to wrap around
498502 */
499503 int nilfs_palloc_prepare_alloc_entry(struct inode *inode,
500− struct nilfs_palloc_req *req)
504+ struct nilfs_palloc_req *req, bool wrap)
501505 {
502506 struct buffer_head *desc_bh, *bitmap_bh;
503507 struct nilfs_palloc_group_desc *desc;
@@ -516,7 +520,7 @@ int nilfs_palloc_prepare_alloc_entry(struct inode *inode, · 12 unmodified lines
516520 entries_per_group = nilfs_palloc_entries_per_group(inode);
517521
518522 for (i = 0; i < ngroups; i += n) {
519− if (group >= ngroups) {
523+ if (group >= ngroups && wrap) {
520524 /* wrap around */
521525 group = 0;
522526 maxgroup = nilfs_palloc_group(inode, req->pr_entry_nr,
@@ -550,7 +554,14 @@ int nilfs_palloc_prepare_alloc_entry(struct inode *inode, · 27 unmodified lines
550554 bitmap_kaddr = kmap_local_page(bitmap_bh->b_page);
551555 bitmap = bitmap_kaddr + bh_offset(bitmap_bh);
552556 pos = nilfs_palloc_find_available_slot(
553− bitmap, group_offset, entries_per_group, lock);
557+ bitmap, group_offset, entries_per_group, lock,
558+ wrap);
559+ /*
560+ * Since the search for a free slot in the second and
561+ * subsequent bitmap blocks always starts from the
562+ * beginning, the wrap flag only has an effect on the
563+ * first search.
564+ */
554565 kunmap_local(bitmap_kaddr);
555566 if (pos >= 0)
556567 goto found;
fs/nilfs2/alloc.h+2−2
@@ -50,8 +50,8 @@ struct nilfs_palloc_req { · 49 unmodified lines
5050 struct buffer_head *pr_entry_bh;
5151 };
5252
53−int nilfs_palloc_prepare_alloc_entry(struct inode *,
54− struct nilfs_palloc_req *);
53+int nilfs_palloc_prepare_alloc_entry(struct inode *inode,
54+ struct nilfs_palloc_req *req, bool wrap);
5555 void nilfs_palloc_commit_alloc_entry(struct inode *,
5656 struct nilfs_palloc_req *);
5757 void nilfs_palloc_abort_alloc_entry(struct inode *, struct nilfs_palloc_req *);
fs/nilfs2/dat.c+1−1
@@ -75,7 +75,7 @@ int nilfs_dat_prepare_alloc(struct inode *dat, struct nilfs_palloc_req *req) · 74 unmodified lines
7575 {
7676 int ret;
7777
78− ret = nilfs_palloc_prepare_alloc_entry(dat, req);
78+ ret = nilfs_palloc_prepare_alloc_entry(dat, req, true);
7979 if (ret < 0)
8080 return ret;
8181
fs/nilfs2/dir.c+6−0
@@ -135,6 +135,9 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr) · 134 unmodified lines
135135 goto Enamelen;
136136 if (((offs + rec_len - 1) ^ offs) & ~(chunk_size-1))
137137 goto Espan;
138+ if (unlikely(p->inode &&
139+ NILFS_PRIVATE_INODE(le64_to_cpu(p->inode))))
140+ goto Einumber;
138141 }
139142 if (offs != limit)
140143 goto Eend;
@@ -160,6 +163,9 @@ Enamelen: · 19 unmodified lines
160163 goto bad_entry;
161164 Espan:
162165 error = "directory entry across blocks";
166+ goto bad_entry;
167+Einumber:
168+ error = "disallowed inode number";
163169 bad_entry:
164170 nilfs_error(sb,
165171 "bad entry in directory #%lu: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
fs/nilfs2/ifile.c+2−5
@@ -56,13 +56,10 @@ int nilfs_ifile_create_inode(struct inode *ifile, ino_t *out_ino, · 55 unmodified lines
5656 struct nilfs_palloc_req req;
5757 int ret;
5858
59− req.pr_entry_nr = 0; /*
60− * 0 says find free inode from beginning
61− * of a group. dull code!!
62− */
59+ req.pr_entry_nr = NILFS_FIRST_INO(ifile->i_sb);
6360 req.pr_entry_bh = NULL;
6461
65− ret = nilfs_palloc_prepare_alloc_entry(ifile, &req);
62+ ret = nilfs_palloc_prepare_alloc_entry(ifile, &req, false);
6663 if (!ret) {
6764 ret = nilfs_palloc_get_entry_block(ifile, req.pr_entry_nr, 1,
6865 &req.pr_entry_bh);
fs/nilfs2/nilfs.h+8−2
@@ -116,9 +116,15 @@ enum { · 115 unmodified lines
116116 #define NILFS_FIRST_INO(sb) (((struct the_nilfs *)sb->s_fs_info)->ns_first_ino)
117117
118118 #define NILFS_MDT_INODE(sb, ino) \
119− ((ino) < NILFS_FIRST_INO(sb) && (NILFS_MDT_INO_BITS & BIT(ino)))
119+ ((ino) < NILFS_USER_INO && (NILFS_MDT_INO_BITS & BIT(ino)))
120120 #define NILFS_VALID_INODE(sb, ino) \
121− ((ino) >= NILFS_FIRST_INO(sb) || (NILFS_SYS_INO_BITS & BIT(ino)))
121+ ((ino) >= NILFS_FIRST_INO(sb) || \
122+ ((ino) < NILFS_USER_INO && (NILFS_SYS_INO_BITS & BIT(ino))))
123+
124+#define NILFS_PRIVATE_INODE(ino) ({ \
125+ ino_t __ino = (ino); \
126+ ((__ino) < NILFS_USER_INO && (__ino) != NILFS_ROOT_INO && \
127+ (__ino) != NILFS_SKETCH_INO); })
122128
123129 /**
124130 * struct nilfs_transaction_info: context information for synchronization
fs/nilfs2/the_nilfs.c+6−0
@@ -452,6 +452,12 @@ static int nilfs_store_disk_layout(struct the_nilfs *nilfs, · 451 unmodified lines
452452 }
453453
454454 nilfs->ns_first_ino = le32_to_cpu(sbp->s_first_ino);
455+ if (nilfs->ns_first_ino < NILFS_USER_INO) {
456+ nilfs_err(nilfs->ns_sb,
457+ "too small lower limit for non-reserved inode numbers: %u",
458+ nilfs->ns_first_ino);
459+ return -EINVAL;
460+ }
455461
456462 nilfs->ns_blocks_per_segment = le32_to_cpu(sbp->s_blocks_per_segment);
457463 if (nilfs->ns_blocks_per_segment < NILFS_SEG_MIN_BLOCKS) {
fs/nilfs2/the_nilfs.h+1−1
@@ -182,7 +182,7 @@ struct the_nilfs { · 181 unmodified lines
182182 unsigned long ns_nrsvsegs;
183183 unsigned long ns_first_data_block;
184184 int ns_inode_size;
185− int ns_first_ino;
185+ unsigned int ns_first_ino;
186186 u32 ns_crc_seed;
187187
188188 /* /sys/fs/<nilfs>/<device> */
fs/open.c+17−9
@@ -202,13 +202,13 @@ long do_sys_ftruncate(unsigned int fd, loff_t length, int small) · 201 unmodified lines
202202 return error;
203203 }
204204
205−SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
205+SYSCALL_DEFINE2(ftruncate, unsigned int, fd, off_t, length)
206206 {
207207 return do_sys_ftruncate(fd, length, 1);
208208 }
209209
210210 #ifdef CONFIG_COMPAT
211−COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_ulong_t, length)
211+COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_off_t, length)
212212 {
213213 return do_sys_ftruncate(fd, length, 1);
214214 }
@@ -1004,11 +1004,6 @@ static int do_dentry_open(struct file *f, · 789 unmodified lines
10041004 }
10051005 }
10061006
1007− /*
1008− * Once we return a file with FMODE_OPENED, __fput() will call
1009− * fsnotify_close(), so we need fsnotify_open() here for symmetry.
1010− */
1011− fsnotify_open(f);
10121007 return 0;
10131008
10141009 cleanup_all:
@@ -1085,8 +1080,19 @@ EXPORT_SYMBOL(file_path); · 70 unmodified lines
10851080 */
10861081 int vfs_open(const struct path *path, struct file *file)
10871082 {
1083+ int ret;
1084+
10881085 file->f_path = *path;
1089− return do_dentry_open(file, NULL);
1086+ ret = do_dentry_open(file, NULL);
1087+ if (!ret) {
1088+ /*
1089+ * Once we return a file with FMODE_OPENED, __fput() will call
1090+ * fsnotify_close(), so we need fsnotify_open() here for
1091+ * symmetry.
1092+ */
1093+ fsnotify_open(file);
1094+ }
1095+ return ret;
10901096 }
10911097
10921098 struct file *dentry_open(const struct path *path, int flags,
@@ -1177,8 +1183,10 @@ struct file *kernel_file_open(const struct path *path, int flags, · 84 unmodified lines
11771183 error = do_dentry_open(f, NULL);
11781184 if (error) {
11791185 fput(f);
1180− f = ERR_PTR(error);
1186+ return ERR_PTR(error);
11811187 }
1188+
1189+ fsnotify_open(f);
11821190 return f;
11831191 }
11841192 EXPORT_SYMBOL_GPL(kernel_file_open);
fs/super.c+10−1
@@ -1502,8 +1502,17 @@ static int fs_bdev_thaw(struct block_device *bdev) · 1501 unmodified lines
15021502
15031503 lockdep_assert_held(&bdev->bd_fsfreeze_mutex);
15041504
1505+ /*
1506+ * The block device may have been frozen before it was claimed by a
1507+ * filesystem. Concurrently another process might try to mount that
1508+ * frozen block device and has temporarily claimed the block device for
1509+ * that purpose causing a concurrent fs_bdev_thaw() to end up here. The
1510+ * mounter is already about to abort mounting because they still saw an
1511+ * elevanted bdev->bd_fsfreeze_count so get_bdev_super() will return
1512+ * NULL in that case.
1513+ */
15051514 sb = get_bdev_super(bdev);
1506− if (WARN_ON_ONCE(!sb))
1515+ if (!sb)
15071516 return -EINVAL;
15081517
15091518 if (sb->s_op->thaw_super)
fs/xfs/libxfs/xfs_bmap.c+27−4
@@ -4058,20 +4058,32 @@ xfs_bmapi_reserve_delalloc( · 4057 unmodified lines
40584058 xfs_extlen_t indlen;
40594059 uint64_t fdblocks;
40604060 int error;
4061− xfs_fileoff_t aoff = off;
4061+ xfs_fileoff_t aoff;
4062+ bool use_cowextszhint =
4063+ whichfork == XFS_COW_FORK && !prealloc;
40624064
4065+retry:
40634066 /*
40644067 * Cap the alloc length. Keep track of prealloc so we know whether to
40654068 * tag the inode before we return.
40664069 */
4070+ aoff = off;
40674071 alen = XFS_FILBLKS_MIN(len + prealloc, XFS_MAX_BMBT_EXTLEN);
40684072 if (!eof)
40694073 alen = XFS_FILBLKS_MIN(alen, got->br_startoff - aoff);
40704074 if (prealloc && alen >= len)
40714075 prealloc = alen - len;
40724076
4073− /* Figure out the extent size, adjust alen */
4074− if (whichfork == XFS_COW_FORK) {
4077+ /*
4078+ * If we're targetting the COW fork but aren't creating a speculative
4079+ * posteof preallocation, try to expand the reservation to align with
4080+ * the COW extent size hint if there's sufficient free space.
4081+ *
4082+ * Unlike the data fork, the CoW cancellation functions will free all
4083+ * the reservations at inactivation, so we don't require that every
4084+ * delalloc reservation have a dirty pagecache.
4085+ */
4086+ if (use_cowextszhint) {
40754087 struct xfs_bmbt_irec prev;
40764088 xfs_extlen_t extsz = xfs_get_cowextsz_hint(ip);
40774089
@@ -4090,7 +4102,7 @@ xfs_bmapi_reserve_delalloc( · 12 unmodified lines
40904102 */
40914103 error = xfs_quota_reserve_blkres(ip, alen);
40924104 if (error)
4093− return error;
4105+ goto out;
40944106
40954107 /*
40964108 * Split changing sb for alen and indlen since they could be coming
@@ -4140,6 +4152,17 @@ out_unreserve_frextents: · 43 unmodified lines
41404152 out_unreserve_quota:
41414153 if (XFS_IS_QUOTA_ON(mp))
41424154 xfs_quota_unreserve_blkres(ip, alen);
4155+out:
4156+ if (error == -ENOSPC || error == -EDQUOT) {
4157+ trace_xfs_delalloc_enospc(ip, off, len);
4158+
4159+ if (prealloc || use_cowextszhint) {
4160+ /* retry without any preallocation */
4161+ use_cowextszhint = false;
4162+ prealloc = 0;
4163+ goto retry;
4164+ }
4165+ }
41434166 return error;
41444167 }
41454168
fs/xfs/libxfs/xfs_fs.h+1−1
@@ -996,7 +996,7 @@ struct xfs_getparents_by_handle { · 995 unmodified lines
996996 #define XFS_IOC_FSGEOMETRY _IOR ('X', 126, struct xfs_fsop_geom)
997997 #define XFS_IOC_BULKSTAT _IOR ('X', 127, struct xfs_bulkstat_req)
998998 #define XFS_IOC_INUMBERS _IOR ('X', 128, struct xfs_inumbers_req)
999−#define XFS_IOC_EXCHANGE_RANGE _IOWR('X', 129, struct xfs_exchange_range)
999+#define XFS_IOC_EXCHANGE_RANGE _IOW ('X', 129, struct xfs_exchange_range)
10001000 /* XFS_IOC_GETFSUUID ---------- deprecated 140 */
10011001
10021002
fs/xfs/libxfs/xfs_inode_buf.c+18−5
@@ -379,10 +379,13 @@ xfs_dinode_verify_fork( · 378 unmodified lines
379379 /*
380380 * A directory small enough to fit in the inode must be stored
381381 * in local format. The directory sf <-> extents conversion
382− * code updates the directory size accordingly.
382+ * code updates the directory size accordingly. Directories
383+ * being truncated have zero size and are not subject to this
384+ * check.
383385 */
384386 if (S_ISDIR(mode)) {
385− if (be64_to_cpu(dip->di_size) <= fork_size &&
387+ if (dip->di_size &&
388+ be64_to_cpu(dip->di_size) <= fork_size &&
386389 fork_format != XFS_DINODE_FMT_LOCAL)
387390 return __this_address;
388391 }
@@ -528,9 +531,19 @@ xfs_dinode_verify( · 139 unmodified lines
528531 if (mode && xfs_mode_to_ftype(mode) == XFS_DIR3_FT_UNKNOWN)
529532 return __this_address;
530533
531− /* No zero-length symlinks/dirs. */
532− if ((S_ISLNK(mode) || S_ISDIR(mode)) && di_size == 0)
533− return __this_address;
534+ /*
535+ * No zero-length symlinks/dirs unless they're unlinked and hence being
536+ * inactivated.
537+ */
538+ if ((S_ISLNK(mode) || S_ISDIR(mode)) && di_size == 0) {
539+ if (dip->di_version > 1) {
540+ if (dip->di_nlink)
541+ return __this_address;
542+ } else {
543+ if (dip->di_onlink)
544+ return __this_address;
545+ }
546+ }
534547
535548 fa = xfs_dinode_verify_nrext64(mp, dip);
536549 if (fa)
fs/xfs/xfs_bmap_util.c+22−8
@@ -486,13 +486,11 @@ out_unlock: · 485 unmodified lines
486486
487487 /*
488488 * Test whether it is appropriate to check an inode for and free post EOF
489− * blocks. The 'force' parameter determines whether we should also consider
490− * regular files that are marked preallocated or append-only.
489+ * blocks.
491490 */
492491 bool
493492 xfs_can_free_eofblocks(
494− struct xfs_inode *ip,
495− bool force)
493+ struct xfs_inode *ip)
496494 {
497495 struct xfs_bmbt_irec imap;
498496 struct xfs_mount *mp = ip->i_mount;
@@ -526,11 +524,11 @@ xfs_can_free_eofblocks( · 27 unmodified lines
526524 return false;
527525
528526 /*
529− * Do not free real preallocated or append-only files unless the file
530− * has delalloc blocks and we are forced to remove them.
527+ * Only free real extents for inodes with persistent preallocations or
528+ * the append-only flag.
531529 */
532530 if (ip->i_diflags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND))
533− if (!force || ip->i_delayed_blks == 0)
531+ if (ip->i_delayed_blks == 0)
534532 return false;
535533
536534 /*
@@ -584,6 +582,22 @@ xfs_free_eofblocks( · 47 unmodified lines
584582 /* Wait on dio to ensure i_size has settled. */
585583 inode_dio_wait(VFS_I(ip));
586584
585+ /*
586+ * For preallocated files only free delayed allocations.
587+ *
588+ * Note that this means we also leave speculative preallocations in
589+ * place for preallocated files.
590+ */
591+ if (ip->i_diflags & (XFS_DIFLAG_PREALLOC | XFS_DIFLAG_APPEND)) {
592+ if (ip->i_delayed_blks) {
593+ xfs_bmap_punch_delalloc_range(ip,
594+ round_up(XFS_ISIZE(ip), mp->m_sb.sb_blocksize),
595+ LLONG_MAX);
596+ }
597+ xfs_inode_clear_eofblocks_tag(ip);
598+ return 0;
599+ }
600+
587601 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp);
588602 if (error) {
589603 ASSERT(xfs_is_shutdown(mp));
@@ -891,7 +905,7 @@ xfs_prepare_shift( · 301 unmodified lines
891905 * Trim eofblocks to avoid shifting uninitialized post-eof preallocation
892906 * into the accessible region of the file.
893907 */
894− if (xfs_can_free_eofblocks(ip, true)) {
908+ if (xfs_can_free_eofblocks(ip)) {
895909 error = xfs_free_eofblocks(ip);
896910 if (error)
897911 return error;
fs/xfs/xfs_bmap_util.h+1−1
@@ -63,7 +63,7 @@ int xfs_insert_file_space(struct xfs_inode *, xfs_off_t offset, · 62 unmodified lines
6363 xfs_off_t len);
6464
6565 /* EOF block manipulation functions */
66−bool xfs_can_free_eofblocks(struct xfs_inode *ip, bool force);
66+bool xfs_can_free_eofblocks(struct xfs_inode *ip);
6767 int xfs_free_eofblocks(struct xfs_inode *ip);
6868
6969 int xfs_swap_extents(struct xfs_inode *ip, struct xfs_inode *tip,
fs/xfs/xfs_icache.c+1−1
@@ -1155,7 +1155,7 @@ xfs_inode_free_eofblocks( · 1154 unmodified lines
11551155 }
11561156 *lockflags |= XFS_IOLOCK_EXCL;
11571157
1158− if (xfs_can_free_eofblocks(ip, false))
1158+ if (xfs_can_free_eofblocks(ip))
11591159 return xfs_free_eofblocks(ip);
11601160
11611161 /* inode could be preallocated or append-only */
fs/xfs/xfs_inode.c+13−11
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include "xfs_pnfs.h"
4343 #include "xfs_parent.h"
4444 #include "xfs_xattr.h"
45+#include "xfs_sb.h"
4546
4647 struct kmem_cache *xfs_inode_cache;
4748
@@ -870,9 +871,16 @@ xfs_init_new_inode( · 822 unmodified lines
870871 * this saves us from needing to run a separate transaction to set the
871872 * fork offset in the immediate future.
872873 */
873− if (init_xattrs && xfs_has_attr(mp)) {
874+ if (init_xattrs) {
874875 ip->i_forkoff = xfs_default_attroffset(ip) >> 3;
875876 xfs_ifork_init_attr(ip, XFS_DINODE_FMT_EXTENTS, 0);
877+
878+ if (!xfs_has_attr(mp)) {
879+ spin_lock(&mp->m_sb_lock);
880+ xfs_add_attr(mp);
881+ spin_unlock(&mp->m_sb_lock);
882+ xfs_log_sb(tp);
883+ }
876884 }
877885
878886 /*
@@ -1595,7 +1603,7 @@ xfs_release( · 716 unmodified lines
15951603 if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL))
15961604 return 0;
15971605
1598− if (xfs_can_free_eofblocks(ip, false)) {
1606+ if (xfs_can_free_eofblocks(ip)) {
15991607 /*
16001608 * Check if the inode is being opened, written and closed
16011609 * frequently and we have delayed allocation blocks outstanding
@@ -1856,15 +1864,13 @@ xfs_inode_needs_inactive( · 254 unmodified lines
18561864
18571865 /*
18581866 * This file isn't being freed, so check if there are post-eof blocks
1859− * to free. @force is true because we are evicting an inode from the
1860− * cache. Post-eof blocks must be freed, lest we end up with broken
1861− * free space accounting.
1867+ * to free.
18621868 *
18631869 * Note: don't bother with iolock here since lockdep complains about
18641870 * acquiring it in reclaim context. We have the only reference to the
18651871 * inode at this point anyways.
18661872 */
1867− return xfs_can_free_eofblocks(ip, true);
1873+ return xfs_can_free_eofblocks(ip);
18681874 }
18691875
18701876 /*
@@ -1947,15 +1953,11 @@ xfs_inactive( · 76 unmodified lines
19471953
19481954 if (VFS_I(ip)->i_nlink != 0) {
19491955 /*
1950− * force is true because we are evicting an inode from the
1951− * cache. Post-eof blocks must be freed, lest we end up with
1952− * broken free space accounting.
1953− *
19541956 * Note: don't bother with iolock here since lockdep complains
19551957 * about acquiring it in reclaim context. We have the only
19561958 * reference to the inode at this point anyways.
19571959 */
1958− if (xfs_can_free_eofblocks(ip, true))
1960+ if (xfs_can_free_eofblocks(ip))
19591961 error = xfs_free_eofblocks(ip);
19601962
19611963 goto out;
fs/xfs/xfs_iomap.c+12−22
@@ -1148,33 +1148,23 @@ xfs_buffered_write_iomap_begin( · 1147 unmodified lines
11481148 }
11491149 }
11501150
1151−retry:
1152− error = xfs_bmapi_reserve_delalloc(ip, allocfork, offset_fsb,
1153− end_fsb - offset_fsb, prealloc_blocks,
1154− allocfork == XFS_DATA_FORK ? &imap : &cmap,
1155− allocfork == XFS_DATA_FORK ? &icur : &ccur,
1156− allocfork == XFS_DATA_FORK ? eof : cow_eof);
1157− switch (error) {
1158− case 0:
1159− break;
1160− case -ENOSPC:
1161− case -EDQUOT:
1162− /* retry without any preallocation */
1163− trace_xfs_delalloc_enospc(ip, offset, count);
1164− if (prealloc_blocks) {
1165− prealloc_blocks = 0;
1166− goto retry;
1167− }
1168− fallthrough;
1169− default:
1170− goto out_unlock;
1171− }
1172−
11731151 if (allocfork == XFS_COW_FORK) {
1152+ error = xfs_bmapi_reserve_delalloc(ip, allocfork, offset_fsb,
1153+ end_fsb - offset_fsb, prealloc_blocks, &cmap,
1154+ &ccur, cow_eof);
1155+ if (error)
1156+ goto out_unlock;
1157+
11741158 trace_xfs_iomap_alloc(ip, offset, count, allocfork, &cmap);
11751159 goto found_cow;
11761160 }
11771161
1162+ error = xfs_bmapi_reserve_delalloc(ip, allocfork, offset_fsb,
1163+ end_fsb - offset_fsb, prealloc_blocks, &imap, &icur,
1164+ eof);
1165+ if (error)
1166+ goto out_unlock;
1167+
11781168 /*
11791169 * Flag newly allocated delalloc blocks with IOMAP_F_NEW so we punch
11801170 * them out if the write happens to fail.
include/asm-generic/syscalls.h+1−1
@@ -19,7 +19,7 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, · 18 unmodified lines
1919 #ifndef sys_mmap
2020 asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
2121 unsigned long prot, unsigned long flags,
22− unsigned long fd, off_t pgoff);
22+ unsigned long fd, unsigned long off);
2323 #endif
2424
2525 #ifndef sys_rt_sigreturn
include/linux/closure.h+23−0
@@ -284,6 +284,21 @@ static inline void closure_get(struct closure *cl) · 283 unmodified lines
284284 #endif
285285 }
286286
287+/**
288+ * closure_get_not_zero
289+ */
290+static inline bool closure_get_not_zero(struct closure *cl)
291+{
292+ unsigned old = atomic_read(&cl->remaining);
293+ do {
294+ if (!(old & CLOSURE_REMAINING_MASK))
295+ return false;
296+
297+ } while (!atomic_try_cmpxchg_acquire(&cl->remaining, &old, old + 1));
298+
299+ return true;
300+}
301+
287302 /**
288303 * closure_init - Initialize a closure, setting the refcount to 1
289304 * @cl: closure to initialize
@@ -310,6 +325,12 @@ static inline void closure_init_stack(struct closure *cl) · 20 unmodified lines
310325 atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER);
311326 }
312327
328+static inline void closure_init_stack_release(struct closure *cl)
329+{
330+ memset(cl, 0, sizeof(struct closure));
331+ atomic_set_release(&cl->remaining, CLOSURE_REMAINING_INITIALIZER);
332+}
333+
313334 /**
314335 * closure_wake_up - wake up all closures on a wait list,
315336 * with memory barrier
@@ -355,6 +376,8 @@ do { \ · 39 unmodified lines
355376 */
356377 #define closure_return(_cl) continue_at((_cl), NULL, NULL)
357378
379+void closure_return_sync(struct closure *cl);
380+
358381 /**
359382 * continue_at_nobarrier - jump to another function without barrier
360383 *
include/linux/compat.h+1−1
@@ -608,7 +608,7 @@ asmlinkage long compat_sys_fstatfs(unsigned int fd, · 607 unmodified lines
608608 asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
609609 struct compat_statfs64 __user *buf);
610610 asmlinkage long compat_sys_truncate(const char __user *, compat_off_t);
611−asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t);
611+asmlinkage long compat_sys_ftruncate(unsigned int, compat_off_t);
612612 /* No generic prototype for truncate64, ftruncate64, fallocate */
613613 asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
614614 int flags, umode_t mode);
include/linux/filter.h+7−7
@@ -1313,18 +1313,18 @@ static inline bool bpf_jit_kallsyms_enabled(void) · 1312 unmodified lines
13131313 return false;
13141314 }
13151315
1316−const char *__bpf_address_lookup(unsigned long addr, unsigned long *size,
1316+int __bpf_address_lookup(unsigned long addr, unsigned long *size,
13171317 unsigned long *off, char *sym);
13181318 bool is_bpf_text_address(unsigned long addr);
13191319 int bpf_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
13201320 char *sym);
13211321 struct bpf_prog *bpf_prog_ksym_find(unsigned long addr);
13221322
1323−static inline const char *
1323+static inline int
13241324 bpf_address_lookup(unsigned long addr, unsigned long *size,
13251325 unsigned long *off, char **modname, char *sym)
13261326 {
1327− const char *ret = __bpf_address_lookup(addr, size, off, sym);
1327+ int ret = __bpf_address_lookup(addr, size, off, sym);
13281328
13291329 if (ret && modname)
13301330 *modname = NULL;
@@ -1368,11 +1368,11 @@ static inline bool bpf_jit_kallsyms_enabled(void) · 37 unmodified lines
13681368 return false;
13691369 }
13701370
1371−static inline const char *
1371+static inline int
13721372 __bpf_address_lookup(unsigned long addr, unsigned long *size,
13731373 unsigned long *off, char *sym)
13741374 {
1375− return NULL;
1375+ return 0;
13761376 }
13771377
13781378 static inline bool is_bpf_text_address(unsigned long addr)
@@ -1391,11 +1391,11 @@ static inline struct bpf_prog *bpf_prog_ksym_find(unsigned long addr) · 12 unmodified lines
13911391 return NULL;
13921392 }
13931393
1394−static inline const char *
1394+static inline int
13951395 bpf_address_lookup(unsigned long addr, unsigned long *size,
13961396 unsigned long *off, char **modname, char *sym)
13971397 {
1398− return NULL;
1398+ return 0;
13991399 }
14001400
14011401 static inline void bpf_prog_kallsyms_add(struct bpf_prog *fp)
include/linux/fsnotify.h+7−1
@@ -112,7 +112,13 @@ static inline int fsnotify_file(struct file *file, __u32 mask) · 111 unmodified lines
112112 {
113113 const struct path *path;
114114
115− if (file->f_mode & FMODE_NONOTIFY)
115+ /*
116+ * FMODE_NONOTIFY are fds generated by fanotify itself which should not
117+ * generate new events. We also don't want to generate events for
118+ * FMODE_PATH fds (involves open & close events) as they are just
119+ * handle creation / destruction events and not "real" file events.
120+ */
121+ if (file->f_mode & (FMODE_NONOTIFY | FMODE_PATH))
116122 return 0;
117123
118124 path = &file->f_path;
include/linux/ftrace.h+3−3
@@ -86,15 +86,15 @@ struct ftrace_hash; · 85 unmodified lines
8686
8787 #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \
8888 defined(CONFIG_DYNAMIC_FTRACE)
89−const char *
89+int
9090 ftrace_mod_address_lookup(unsigned long addr, unsigned long *size,
9191 unsigned long *off, char **modname, char *sym);
9292 #else
93−static inline const char *
93+static inline int
9494 ftrace_mod_address_lookup(unsigned long addr, unsigned long *size,
9595 unsigned long *off, char **modname, char *sym)
9696 {
97− return NULL;
97+ return 0;
9898 }
9999 #endif
100100
include/linux/io_uring_types.h+0−1
@@ -207,7 +207,6 @@ struct io_submit_state { · 206 unmodified lines
207207 bool need_plug;
208208 bool cq_flush;
209209 unsigned short submit_nr;
210− unsigned int cqes_count;
211210 struct blk_plug plug;
212211 };
213212
include/linux/libata.h+1−0
@@ -1249,6 +1249,7 @@ extern int ata_slave_link_init(struct ata_port *ap); · 1248 unmodified lines
12491249 extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
12501250 struct ata_port_info *, struct Scsi_Host *);
12511251 extern void ata_port_probe(struct ata_port *ap);
1252+extern void ata_port_free(struct ata_port *ap);
12521253 extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap);
12531254 extern void ata_sas_tport_delete(struct ata_port *ap);
12541255 int ata_sas_device_configure(struct scsi_device *sdev, struct queue_limits *lim,
include/linux/mlx5/mlx5_ifc.h+5−1
@@ -2036,7 +2036,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { · 2035 unmodified lines
20362036 u8 min_mkey_log_entity_size_fixed_buffer_valid[0x1];
20372037 u8 reserved_at_402[0x1e];
20382038
2039− u8 reserved_at_420[0x3e0];
2039+ u8 reserved_at_420[0x20];
2040+
2041+ u8 reserved_at_440[0x8];
2042+ u8 max_num_eqs_24b[0x18];
2043+ u8 reserved_at_460[0x3a0];
20402044 };
20412045
20422046 enum mlx5_ifc_flow_destination_type {
include/linux/module.h+7−7
@@ -931,11 +931,11 @@ int module_kallsyms_on_each_symbol(const char *modname, · 930 unmodified lines
931931 * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
932932 * found, otherwise NULL.
933933 */
934−const char *module_address_lookup(unsigned long addr,
935− unsigned long *symbolsize,
936− unsigned long *offset,
937− char **modname, const unsigned char **modbuildid,
938− char *namebuf);
934+int module_address_lookup(unsigned long addr,
935+ unsigned long *symbolsize,
936+ unsigned long *offset,
937+ char **modname, const unsigned char **modbuildid,
938+ char *namebuf);
939939 int lookup_module_symbol_name(unsigned long addr, char *symname);
940940 int lookup_module_symbol_attrs(unsigned long addr,
941941 unsigned long *size,
@@ -964,14 +964,14 @@ static inline int module_kallsyms_on_each_symbol(const char *modname, · 22 unmodified lines
964964 }
965965
966966 /* For kallsyms to ask for address resolution. NULL means not found. */
967−static inline const char *module_address_lookup(unsigned long addr,
967+static inline int module_address_lookup(unsigned long addr,
968968 unsigned long *symbolsize,
969969 unsigned long *offset,
970970 char **modname,
971971 const unsigned char **modbuildid,
972972 char *namebuf)
973973 {
974− return NULL;
974+ return 0;
975975 }
976976
977977 static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
include/linux/nvme.h+4−2
@@ -85,10 +85,11 @@ enum { · 84 unmodified lines
8585 enum {
8686 NVMF_RDMA_QPTYPE_CONNECTED = 1, /* Reliable Connected */
8787 NVMF_RDMA_QPTYPE_DATAGRAM = 2, /* Reliable Datagram */
88+ NVMF_RDMA_QPTYPE_INVALID = 0xff,
8889 };
8990
90−/* RDMA QP Service Type codes for Discovery Log Page entry TSAS
91− * RDMA_QPTYPE field
91+/* RDMA Provider Type codes for Discovery Log Page entry TSAS
92+ * RDMA_PRTYPE field
9293 */
9394 enum {
9495 NVMF_RDMA_PRTYPE_NOT_SPECIFIED = 1, /* No Provider Specified */
@@ -110,6 +111,7 @@ enum { · 15 unmodified lines
110111 NVMF_TCP_SECTYPE_NONE = 0, /* No Security */
111112 NVMF_TCP_SECTYPE_TLS12 = 1, /* TLSv1.2, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
112113 NVMF_TCP_SECTYPE_TLS13 = 2, /* TLSv1.3, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
114+ NVMF_TCP_SECTYPE_INVALID = 0xff,
113115 };
114116
115117 #define NVME_AQ_DEPTH 32
include/linux/phy.h+1−1
@@ -1126,7 +1126,7 @@ struct phy_driver { · 1125 unmodified lines
11261126 u8 index, enum led_brightness value);
11271127
11281128 /**
1129− * @led_blink_set: Set a PHY LED brightness. Index indicates
1129+ * @led_blink_set: Set a PHY LED blinking. Index indicates
11301130 * which of the PHYs led should be configured to blink. Delays
11311131 * are in milliseconds and if both are zero then a sensible
11321132 * default should be chosen. The call should adjust the
include/linux/printk.h+0−3
@@ -60,9 +60,6 @@ static inline const char *printk_skip_headers(const char *buffer) · 59 unmodified lines
6060 #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT
6161 #define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET
6262
63−int add_preferred_console_match(const char *match, const char *name,
64− const short idx);
65−
6663 extern int console_printk[];
6764
6865 #define console_loglevel (console_printk[0])
include/linux/serial_core.h+19−2
@@ -811,8 +811,7 @@ enum UART_TX_FLAGS { · 810 unmodified lines
811811 if (pending < WAKEUP_CHARS) { \
812812 uart_write_wakeup(__port); \
813813 \
814− if (!((flags) & UART_TX_NOSTOP) && pending == 0 && \
815− __port->ops->tx_empty(__port)) \
814+ if (!((flags) & UART_TX_NOSTOP) && pending == 0) \
816815 __port->ops->stop_tx(__port); \
817816 } \
818817 \
@@ -851,6 +850,24 @@ enum UART_TX_FLAGS { · 32 unmodified lines
851850 __count--); \
852851 })
853852
853+/**
854+ * uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags
855+ * @port: uart port
856+ * @ch: variable to store a character to be written to the HW
857+ * @flags: %UART_TX_NOSTOP or similar
858+ * @count: a limit of characters to send
859+ * @tx_ready: can HW accept more data function
860+ * @put_char: function to write a character
861+ * @tx_done: function to call after the loop is done
862+ *
863+ * See uart_port_tx_limited() for more details.
864+ */
865+#define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \
866+ unsigned int __count = (count); \
867+ __uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \
868+ __count--); \
869+})
870+
854871 /**
855872 * uart_port_tx -- transmit helper for uart_port
856873 * @port: uart port
include/linux/syscalls.h+16−10
@@ -322,13 +322,13 @@ asmlinkage long sys_io_pgetevents(aio_context_t ctx_id, · 321 unmodified lines
322322 long nr,
323323 struct io_event __user *events,
324324 struct __kernel_timespec __user *timeout,
325− const struct __aio_sigset *sig);
325+ const struct __aio_sigset __user *sig);
326326 asmlinkage long sys_io_pgetevents_time32(aio_context_t ctx_id,
327327 long min_nr,
328328 long nr,
329329 struct io_event __user *events,
330330 struct old_timespec32 __user *timeout,
331− const struct __aio_sigset *sig);
331+ const struct __aio_sigset __user *sig);
332332 asmlinkage long sys_io_uring_setup(u32 entries,
333333 struct io_uring_params __user *p);
334334 asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit,
@@ -418,7 +418,7 @@ asmlinkage long sys_listmount(const struct mnt_id_req __user *req, · 83 unmodified lines
418418 u64 __user *mnt_ids, size_t nr_mnt_ids,
419419 unsigned int flags);
420420 asmlinkage long sys_truncate(const char __user *path, long length);
421−asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
421+asmlinkage long sys_ftruncate(unsigned int fd, off_t length);
422422 #if BITS_PER_LONG == 32
423423 asmlinkage long sys_truncate64(const char __user *path, loff_t length);
424424 asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length);
@@ -441,7 +441,7 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group); · 16 unmodified lines
441441 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
442442 umode_t mode);
443443 asmlinkage long sys_openat2(int dfd, const char __user *filename,
444− struct open_how *how, size_t size);
444+ struct open_how __user *how, size_t size);
445445 asmlinkage long sys_close(unsigned int fd);
446446 asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd,
447447 unsigned int flags);
@@ -555,7 +555,7 @@ asmlinkage long sys_get_robust_list(int pid, · 107 unmodified lines
555555 asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
556556 size_t len);
557557
558−asmlinkage long sys_futex_waitv(struct futex_waitv *waiters,
558+asmlinkage long sys_futex_waitv(struct futex_waitv __user *waiters,
559559 unsigned int nr_futexes, unsigned int flags,
560560 struct __kernel_timespec __user *timeout, clockid_t clockid);
561561
@@ -859,9 +859,15 @@ asmlinkage long sys_prlimit64(pid_t pid, unsigned int resource, · 297 unmodified lines
859859 const struct rlimit64 __user *new_rlim,
860860 struct rlimit64 __user *old_rlim);
861861 asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags);
862+#if defined(CONFIG_ARCH_SPLIT_ARG64)
863+asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
864+ unsigned int mask_1, unsigned int mask_2,
865+ int dfd, const char __user * pathname);
866+#else
862867 asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
863868 u64 mask, int fd,
864869 const char __user *pathname);
870+#endif
865871 asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
866872 struct file_handle __user *handle,
867873 int __user *mnt_id, int flag);
@@ -907,7 +913,7 @@ asmlinkage long sys_seccomp(unsigned int op, unsigned int flags, · 39 unmodified lines
907913 asmlinkage long sys_getrandom(char __user *buf, size_t count,
908914 unsigned int flags);
909915 asmlinkage long sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
910−asmlinkage long sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
916+asmlinkage long sys_bpf(int cmd, union bpf_attr __user *attr, unsigned int size);
911917 asmlinkage long sys_execveat(int dfd, const char __user *filename,
912918 const char __user *const __user *argv,
913919 const char __user *const __user *envp, int flags);
@@ -960,11 +966,11 @@ asmlinkage long sys_cachestat(unsigned int fd, · 46 unmodified lines
960966 struct cachestat_range __user *cstat_range,
961967 struct cachestat __user *cstat, unsigned int flags);
962968 asmlinkage long sys_map_shadow_stack(unsigned long addr, unsigned long size, unsigned int flags);
963−asmlinkage long sys_lsm_get_self_attr(unsigned int attr, struct lsm_ctx *ctx,
964− u32 *size, u32 flags);
965−asmlinkage long sys_lsm_set_self_attr(unsigned int attr, struct lsm_ctx *ctx,
969+asmlinkage long sys_lsm_get_self_attr(unsigned int attr, struct lsm_ctx __user *ctx,
970+ u32 __user *size, u32 flags);
971+asmlinkage long sys_lsm_set_self_attr(unsigned int attr, struct lsm_ctx __user *ctx,
966972 u32 size, u32 flags);
967−asmlinkage long sys_lsm_list_modules(u64 *ids, u32 *size, u32 flags);
973+asmlinkage long sys_lsm_list_modules(u64 __user *ids, u32 __user *size, u32 flags);
968974
969975 /*
970976 * Architecture-specific system calls
include/net/bluetooth/hci.h+11−0
@@ -324,6 +324,17 @@ enum { · 323 unmodified lines
324324 * claim to support it.
325325 */
326326 HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE,
327+
328+ /*
329+ * When this quirk is set, the reserved bits of Primary/Secondary_PHY
330+ * inside the LE Extended Advertising Report events are discarded.
331+ * This is required for some Apple/Broadcom controllers which
332+ * abuse these reserved bits for unrelated flags.
333+ *
334+ * This quirk can be set before hci_register_dev is called or
335+ * during the hdev->setup vendor callback.
336+ */
337+ HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY,
327338 };
328339
329340 /* HCI device flags */
include/net/bluetooth/hci_sync.h+2−0
@@ -38,6 +38,8 @@ int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, · 37 unmodified lines
3838 int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
3939 const void *param, u8 event, u32 timeout,
4040 struct sock *sk);
41+int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
42+ const void *param, u32 timeout);
4143
4244 void hci_cmd_sync_init(struct hci_dev *hdev);
4345 void hci_cmd_sync_clear(struct hci_dev *hdev);
include/net/mac80211.h+1−1
@@ -396,7 +396,7 @@ enum ieee80211_bss_change { · 395 unmodified lines
396396 BSS_CHANGED_HE_OBSS_PD = 1<<28,
397397 BSS_CHANGED_HE_BSS_COLOR = 1<<29,
398398 BSS_CHANGED_FILS_DISCOVERY = 1<<30,
399− BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = 1<<31,
399+ BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT_ULL(31),
400400 BSS_CHANGED_MLD_VALID_LINKS = BIT_ULL(33),
401401 BSS_CHANGED_MLD_TTLM = BIT_ULL(34),
402402 BSS_CHANGED_TPE = BIT_ULL(35),
include/uapi/asm-generic/unistd.h+1−1
@@ -737,7 +737,7 @@ __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) · 736 unmodified lines
737737 #define __NR_ppoll_time64 414
738738 __SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64)
739739 #define __NR_io_pgetevents_time64 416
740−__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
740+__SC_COMP(__NR_io_pgetevents_time64, sys_io_pgetevents, compat_sys_io_pgetevents_time64)
741741 #define __NR_recvmmsg_time64 417
742742 __SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64)
743743 #define __NR_mq_timedsend_time64 418
include/uapi/linux/trace_mmap.h+1−1
@@ -43,6 +43,6 @@ struct trace_buffer_meta { · 42 unmodified lines
4343 __u64 Reserved2;
4444 };
4545
46−#define TRACE_MMAP_IOCTL_GET_READER _IO('T', 0x1)
46+#define TRACE_MMAP_IOCTL_GET_READER _IO('R', 0x20)
4747
4848 #endif /* _TRACE_MMAP_H_ */
io_uring/io_uring.c+2−2
@@ -1259,8 +1259,8 @@ static void io_req_normal_work_add(struct io_kiocb *req) · 1258 unmodified lines
12591259 if (ctx->flags & IORING_SETUP_SQPOLL) {
12601260 struct io_sq_data *sqd = ctx->sq_data;
12611261
1262− if (wq_has_sleeper(&sqd->wait))
1263− wake_up(&sqd->wait);
1262+ if (sqd->thread)
1263+ __set_notify_signal(sqd->thread);
12641264 return;
12651265 }
12661266
io_uring/net.c+6−4
@@ -1127,16 +1127,18 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags) · 1126 unmodified lines
11271127 flags |= MSG_DONTWAIT;
11281128
11291129 retry_multishot:
1130− kmsg->msg.msg_inq = -1;
1131− kmsg->msg.msg_flags = 0;
1132−
11331130 if (io_do_buffer_select(req)) {
11341131 ret = io_recv_buf_select(req, kmsg, &len, issue_flags);
1135− if (unlikely(ret))
1132+ if (unlikely(ret)) {
1133+ kmsg->msg.msg_inq = -1;
11361134 goto out_free;
1135+ }
11371136 sr->buf = NULL;
11381137 }
11391138
1139+ kmsg->msg.msg_flags = 0;
1140+ kmsg->msg.msg_inq = -1;
1141+
11401142 if (flags & MSG_WAITALL)
11411143 min_ret = iov_iter_count(&kmsg->msg.msg_iter);
11421144
kernel/bpf/core.c+3−4
@@ -736,11 +736,11 @@ static struct bpf_ksym *bpf_ksym_find(unsigned long addr) · 735 unmodified lines
736736 return n ? container_of(n, struct bpf_ksym, tnode) : NULL;
737737 }
738738
739−const char *__bpf_address_lookup(unsigned long addr, unsigned long *size,
739+int __bpf_address_lookup(unsigned long addr, unsigned long *size,
740740 unsigned long *off, char *sym)
741741 {
742742 struct bpf_ksym *ksym;
743− char *ret = NULL;
743+ int ret = 0;
744744
745745 rcu_read_lock();
746746 ksym = bpf_ksym_find(addr);
@@ -748,9 +748,8 @@ const char *__bpf_address_lookup(unsigned long addr, unsigned long *size, · 1 unmodified line
748748 unsigned long symbol_start = ksym->start;
749749 unsigned long symbol_end = ksym->end;
750750
751− strscpy(sym, ksym->name, KSYM_NAME_LEN);
751+ ret = strscpy(sym, ksym->name, KSYM_NAME_LEN);
752752
753− ret = sym;
754753 if (size)
755754 *size = symbol_end - symbol_start;
756755 if (off)
kernel/cpu.c+7−4
@@ -1859,6 +1859,9 @@ static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return fals · 1858 unmodified lines
18591859
18601860 void __init bringup_nonboot_cpus(unsigned int max_cpus)
18611861 {
1862+ if (!max_cpus)
1863+ return;
1864+
18621865 /* Try parallel bringup optimization if enabled */
18631866 if (cpuhp_bringup_cpus_parallel(max_cpus))
18641867 return;
@@ -2446,7 +2449,7 @@ EXPORT_SYMBOL_GPL(__cpuhp_state_add_instance); · 581 unmodified lines
24462449 * The caller needs to hold cpus read locked while calling this function.
24472450 * Return:
24482451 * On success:
2449− * Positive state number if @state is CPUHP_AP_ONLINE_DYN;
2452+ * Positive state number if @state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN;
24502453 * 0 for all other states
24512454 * On failure: proper (negative) error code
24522455 */
@@ -2469,7 +2472,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, · 16 unmodified lines
24692472 ret = cpuhp_store_callbacks(state, name, startup, teardown,
24702473 multi_instance);
24712474
2472− dynstate = state == CPUHP_AP_ONLINE_DYN;
2475+ dynstate = state == CPUHP_AP_ONLINE_DYN || state == CPUHP_BP_PREPARE_DYN;
24732476 if (ret > 0 && dynstate) {
24742477 state = ret;
24752478 ret = 0;
@@ -2500,8 +2503,8 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, · 24 unmodified lines
25002503 out:
25012504 mutex_unlock(&cpuhp_state_mutex);
25022505 /*
2503− * If the requested state is CPUHP_AP_ONLINE_DYN, return the
2504− * dynamically allocated state in case of success.
2506+ * If the requested state is CPUHP_AP_ONLINE_DYN or CPUHP_BP_PREPARE_DYN,
2507+ * return the dynamically allocated state in case of success.
25052508 */
25062509 if (!ret && dynstate)
25072510 return state;
kernel/exit.c+2−0
@@ -484,6 +484,8 @@ retry: · 483 unmodified lines
484484 * Search through everything else, we should not get here often.
485485 */
486486 for_each_process(g) {
487+ if (atomic_read(&mm->mm_users) <= 1)
488+ break;
487489 if (g->flags & PF_KTHREAD)
488490 continue;
489491 for_each_thread(g, c) {
kernel/kallsyms.c+12−11
@@ -388,12 +388,12 @@ int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize, · 387 unmodified lines
388388 !!__bpf_address_lookup(addr, symbolsize, offset, namebuf);
389389 }
390390
391−static const char *kallsyms_lookup_buildid(unsigned long addr,
391+static int kallsyms_lookup_buildid(unsigned long addr,
392392 unsigned long *symbolsize,
393393 unsigned long *offset, char **modname,
394394 const unsigned char **modbuildid, char *namebuf)
395395 {
396− const char *ret;
396+ int ret;
397397
398398 namebuf[KSYM_NAME_LEN - 1] = 0;
399399 namebuf[0] = 0;
@@ -410,7 +410,7 @@ static const char *kallsyms_lookup_buildid(unsigned long addr, · 10 unmodified lines
410410 if (modbuildid)
411411 *modbuildid = NULL;
412412
413− ret = namebuf;
413+ ret = strlen(namebuf);
414414 goto found;
415415 }
416416
@@ -442,8 +442,13 @@ const char *kallsyms_lookup(unsigned long addr, · 25 unmodified lines
442442 unsigned long *offset,
443443 char **modname, char *namebuf)
444444 {
445− return kallsyms_lookup_buildid(addr, symbolsize, offset, modname,
446− NULL, namebuf);
445+ int ret = kallsyms_lookup_buildid(addr, symbolsize, offset, modname,
446+ NULL, namebuf);
447+
448+ if (!ret)
449+ return NULL;
450+
451+ return namebuf;
447452 }
448453
449454 int lookup_symbol_name(unsigned long addr, char *symname)
@@ -478,19 +483,15 @@ static int __sprint_symbol(char *buffer, unsigned long address, · 28 unmodified lines
478483 {
479484 char *modname;
480485 const unsigned char *buildid;
481− const char *name;
482486 unsigned long offset, size;
483487 int len;
484488
485489 address += symbol_offset;
486− name = kallsyms_lookup_buildid(address, &size, &offset, &modname, &buildid,
490+ len = kallsyms_lookup_buildid(address, &size, &offset, &modname, &buildid,
487491 buffer);
488− if (!name)
492+ if (!len)
489493 return sprintf(buffer, "0x%lx", address - symbol_offset);
490494
491− if (name != buffer)
492− strcpy(buffer, name);
493− len = strlen(buffer);
494495 offset -= symbol_offset;
495496
496497 if (add_offset)
kernel/module/kallsyms.c+12−13
@@ -321,14 +321,15 @@ void * __weak dereference_module_function_descriptor(struct module *mod, · 320 unmodified lines
321321 * For kallsyms to ask for address resolution. NULL means not found. Careful
322322 * not to lock to avoid deadlock on oopses, simply disable preemption.
323323 */
324−const char *module_address_lookup(unsigned long addr,
325− unsigned long *size,
326− unsigned long *offset,
327− char **modname,
328− const unsigned char **modbuildid,
329− char *namebuf)
324+int module_address_lookup(unsigned long addr,
325+ unsigned long *size,
326+ unsigned long *offset,
327+ char **modname,
328+ const unsigned char **modbuildid,
329+ char *namebuf)
330330 {
331− const char *ret = NULL;
331+ const char *sym;
332+ int ret = 0;
332333 struct module *mod;
333334
334335 preempt_disable();
@@ -344,12 +345,10 @@ const char *module_address_lookup(unsigned long addr, · 9 unmodified lines
344345 #endif
345346 }
346347
347− ret = find_kallsyms_symbol(mod, addr, size, offset);
348− }
349− /* Make a copy in here where it's safe */
350− if (ret) {
351− strscpy(namebuf, ret, KSYM_NAME_LEN);
352− ret = namebuf;
348+ sym = find_kallsyms_symbol(mod, addr, size, offset);
349+
350+ if (sym)
351+ ret = strscpy(namebuf, sym, KSYM_NAME_LEN);
353352 }
354353 preempt_enable();
355354
kernel/printk/Makefile+1−1
@@ -1,5 +1,5 @@
11 # SPDX-License-Identifier: GPL-2.0-only
2−obj-y = printk.o conopt.o
2+obj-y = printk.o
33 obj-$(CONFIG_PRINTK) += printk_safe.o nbcon.o
44 obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o
55 obj-$(CONFIG_PRINTK_INDEX) += index.o
kernel/printk/conopt.c+0−146
@@ -1,146 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−/*
3− * Kernel command line console options for hardware based addressing
4− *
5− * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
6− * Author: Tony Lindgren <tony@atomide.com>
7− */
8−
9−#include <linux/console.h>
10−#include <linux/init.h>
11−#include <linux/string.h>
12−#include <linux/types.h>
13−
14−#include <asm/errno.h>
15−
16−#include "console_cmdline.h"
17−
18−/*
19− * Allow longer DEVNAME:0.0 style console naming such as abcd0000.serial:0.0
20− * in addition to the legacy ttyS0 style naming.
21− */
22−#define CONSOLE_NAME_MAX 32
23−
24−#define CONSOLE_OPT_MAX 16
25−#define CONSOLE_BRL_OPT_MAX 16
26−
27−struct console_option {
28− char name[CONSOLE_NAME_MAX];
29− char opt[CONSOLE_OPT_MAX];
30− char brl_opt[CONSOLE_BRL_OPT_MAX];
31− u8 has_brl_opt:1;
32−};
33−
34−/* Updated only at console_setup() time, no locking needed */
35−static struct console_option conopt[MAX_CMDLINECONSOLES];
36−
37−/**
38− * console_opt_save - Saves kernel command line console option for driver use
39− * @str: Kernel command line console name and option
40− * @brl_opt: Braille console options
41− *
42− * Saves a kernel command line console option for driver subsystems to use for
43− * adding a preferred console during init. Called from console_setup() only.
44− *
45− * Return: 0 on success, negative error code on failure.
46− */
47−int __init console_opt_save(const char *str, const char *brl_opt)
48−{
49− struct console_option *con;
50− size_t namelen, optlen;
51− const char *opt;
52− int i;
53−
54− namelen = strcspn(str, ",");
55− if (namelen == 0 || namelen >= CONSOLE_NAME_MAX)
56− return -EINVAL;
57−
58− opt = str + namelen;
59− if (*opt == ',')
60− opt++;
61−
62− optlen = strlen(opt);
63− if (optlen >= CONSOLE_OPT_MAX)
64− return -EINVAL;
65−
66− for (i = 0; i < MAX_CMDLINECONSOLES; i++) {
67− con = &conopt[i];
68−
69− if (con->name[0]) {
70− if (!strncmp(str, con->name, namelen))
71− return 0;
72− continue;
73− }
74−
75− /*
76− * The name isn't terminated, only opt is. Empty opt is fine,
77− * but brl_opt can be either empty or NULL. For more info, see
78− * _braille_console_setup().
79− */
80− strscpy(con->name, str, namelen + 1);
81− strscpy(con->opt, opt, CONSOLE_OPT_MAX);
82− if (brl_opt) {
83− strscpy(con->brl_opt, brl_opt, CONSOLE_BRL_OPT_MAX);
84− con->has_brl_opt = 1;
85− }
86−
87− return 0;
88− }
89−
90− return -ENOMEM;
91−}
92−
93−static struct console_option *console_opt_find(const char *name)
94−{
95− struct console_option *con;
96− int i;
97−
98− for (i = 0; i < MAX_CMDLINECONSOLES; i++) {
99− con = &conopt[i];
100− if (!strcmp(name, con->name))
101− return con;
102− }
103−
104− return NULL;
105−}
106−
107−/**
108− * add_preferred_console_match - Adds a preferred console if a match is found
109− * @match: Expected console on kernel command line, such as console=DEVNAME:0.0
110− * @name: Name of the console character device to add such as ttyS
111− * @idx: Index for the console
112− *
113− * Allows driver subsystems to add a console after translating the command
114− * line name to the character device name used for the console. Options are
115− * added automatically based on the kernel command line. Duplicate preferred
116− * consoles are ignored by __add_preferred_console().
117− *
118− * Return: 0 on success, negative error code on failure.
119− */
120−int add_preferred_console_match(const char *match, const char *name,
121− const short idx)
122−{
123− struct console_option *con;
124− char *brl_opt = NULL;
125−
126− if (!match || !strlen(match) || !name || !strlen(name) ||
127− idx < 0)
128− return -EINVAL;
129−
130− con = console_opt_find(match);
131− if (!con)
132− return -ENOENT;
133−
134− /*
135− * See __add_preferred_console(). It checks for NULL brl_options to set
136− * the preferred_console flag. Empty brl_opt instead of NULL leads into
137− * the preferred_console flag not set, and CON_CONSDEV not being set,
138− * and the boot console won't get disabled at the end of console_setup().
139− */
140− if (con->has_brl_opt)
141− brl_opt = con->brl_opt;
142−
143− console_opt_add_preferred_console(name, idx, con->opt, brl_opt);
144−
145− return 0;
146−}
kernel/printk/console_cmdline.h+0−6
@@ -2,12 +2,6 @@ · 1 unmodified line
22 #ifndef _CONSOLE_CMDLINE_H
33 #define _CONSOLE_CMDLINE_H
44
5−#define MAX_CMDLINECONSOLES 8
6−
7−int console_opt_save(const char *str, const char *brl_opt);
8−int console_opt_add_preferred_console(const char *name, const short idx,
9− char *options, char *brl_options);
10−
115 struct console_cmdline
126 {
137 char name[16]; /* Name of the driver */
kernel/printk/printk.c+4−19
@@ -383,6 +383,9 @@ static int console_locked; · 382 unmodified lines
383383 /*
384384 * Array of consoles built from command line options (console=)
385385 */
386+
387+#define MAX_CMDLINECONSOLES 8
388+
386389 static struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES];
387390
388391 static int preferred_console = -1;
@@ -2500,17 +2503,6 @@ static int __init console_setup(char *str) · 2111 unmodified lines
25002503 if (_braille_console_setup(&str, &brl_options))
25012504 return 1;
25022505
2503− /* Save the console for driver subsystem use */
2504− if (console_opt_save(str, brl_options))
2505− return 1;
2506−
2507− /* Flag register_console() to not call try_enable_default_console() */
2508− console_set_on_cmdline = 1;
2509−
2510− /* Don't attempt to parse a DEVNAME:0.0 style console */
2511− if (strchr(str, ':'))
2512− return 1;
2513−
25142506 /*
25152507 * Decode str into name, index, options.
25162508 */
@@ -2541,13 +2533,6 @@ static int __init console_setup(char *str) · 24 unmodified lines
25412533 }
25422534 __setup("console=", console_setup);
25432535
2544−/* Only called from add_preferred_console_match() */
2545−int console_opt_add_preferred_console(const char *name, const short idx,
2546− char *options, char *brl_options)
2547−{
2548− return __add_preferred_console(name, idx, options, brl_options, true);
2549−}
2550−
25512536 /**
25522537 * add_preferred_console - add a device to the list of preferred consoles.
25532538 * @name: device name
@@ -3522,7 +3507,7 @@ void register_console(struct console *newcon) · 968 unmodified lines
35223507 * Note that a console with tty binding will have CON_CONSDEV
35233508 * flag set and will be first in the list.
35243509 */
3525− if (preferred_console < 0 && !console_set_on_cmdline) {
3510+ if (preferred_console < 0) {
35263511 if (hlist_empty(&console_list) || !console_first()->device ||
35273512 console_first()->flags & CON_BOOT) {
35283513 try_enable_default_console(newcon);
kernel/sys_ni.c+1−1
@@ -46,8 +46,8 @@ COND_SYSCALL(io_getevents_time32); · 45 unmodified lines
4646 COND_SYSCALL(io_getevents);
4747 COND_SYSCALL(io_pgetevents_time32);
4848 COND_SYSCALL(io_pgetevents);
49−COND_SYSCALL_COMPAT(io_pgetevents_time32);
5049 COND_SYSCALL_COMPAT(io_pgetevents);
50+COND_SYSCALL_COMPAT(io_pgetevents_time64);
5151 COND_SYSCALL(io_uring_setup);
5252 COND_SYSCALL(io_uring_enter);
5353 COND_SYSCALL(io_uring_register);
kernel/time/hrtimer.c+2−0
@@ -1285,6 +1285,8 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, · 1284 unmodified lines
12851285 struct hrtimer_clock_base *base;
12861286 unsigned long flags;
12871287
1288+ if (WARN_ON_ONCE(!timer->function))
1289+ return;
12881290 /*
12891291 * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft
12901292 * match on CONFIG_PREEMPT_RT = n. With PREEMPT_RT check the hard
kernel/trace/ftrace.c+5−8
@@ -6969,7 +6969,7 @@ allocate_ftrace_mod_map(struct module *mod, · 6968 unmodified lines
69696969 return mod_map;
69706970 }
69716971
6972−static const char *
6972+static int
69736973 ftrace_func_address_lookup(struct ftrace_mod_map *mod_map,
69746974 unsigned long addr, unsigned long *size,
69756975 unsigned long *off, char *sym)
@@ -6990,21 +6990,18 @@ ftrace_func_address_lookup(struct ftrace_mod_map *mod_map, · 14 unmodified lines
69906990 *size = found_func->size;
69916991 if (off)
69926992 *off = addr - found_func->ip;
6993− if (sym)
6994− strscpy(sym, found_func->name, KSYM_NAME_LEN);
6995−
6996− return found_func->name;
6993+ return strscpy(sym, found_func->name, KSYM_NAME_LEN);
69976994 }
69986995
6999− return NULL;
6996+ return 0;
70006997 }
70016998
7002−const char *
6999+int
70037000 ftrace_mod_address_lookup(unsigned long addr, unsigned long *size,
70047001 unsigned long *off, char **modname, char *sym)
70057002 {
70067003 struct ftrace_mod_map *mod_map;
7007− const char *ret = NULL;
7004+ int ret = 0;
70087005
70097006 /* mod_map is freed via call_rcu() */
70107007 preempt_disable();
lib/closure.c+46−6
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/seq_file.h>
1414 #include <linux/sched/debug.h>
1515
16−static inline void closure_put_after_sub(struct closure *cl, int flags)
16+static inline void closure_put_after_sub_checks(int flags)
1717 {
1818 int r = flags & CLOSURE_REMAINING_MASK;
1919
@@ -22,12 +22,17 @@ static inline void closure_put_after_sub(struct closure *cl, int flags) · 2 unmodified lines
2222 flags & CLOSURE_GUARD_MASK, (unsigned) __fls(r)))
2323 r &= ~CLOSURE_GUARD_MASK;
2424
25− if (!r) {
26− smp_acquire__after_ctrl_dep();
25+ WARN(!r && (flags & ~CLOSURE_DESTRUCTOR),
26+ "closure ref hit 0 with incorrect flags set: %x (%u)",
27+ flags & ~CLOSURE_DESTRUCTOR, (unsigned) __fls(flags));
28+}
29+
30+static inline void closure_put_after_sub(struct closure *cl, int flags)
31+{
32+ closure_put_after_sub_checks(flags);
2733
28− WARN(flags & ~CLOSURE_DESTRUCTOR,
29− "closure ref hit 0 with incorrect flags set: %x (%u)",
30− flags & ~CLOSURE_DESTRUCTOR, (unsigned) __fls(flags));
34+ if (!(flags & CLOSURE_REMAINING_MASK)) {
35+ smp_acquire__after_ctrl_dep();
3136
3237 cl->closure_get_happened = false;
3338
@@ -145,6 +150,41 @@ void __sched __closure_sync(struct closure *cl) · 111 unmodified lines
145150 }
146151 EXPORT_SYMBOL(__closure_sync);
147152
153+/*
154+ * closure_return_sync - finish running a closure, synchronously (i.e. waiting
155+ * for outstanding get()s to finish) and returning once closure refcount is 0.
156+ *
157+ * Unlike closure_sync() this doesn't reinit the ref to 1; subsequent
158+ * closure_get_not_zero() calls waill fail.
159+ */
160+void __sched closure_return_sync(struct closure *cl)
161+{
162+ struct closure_syncer s = { .task = current };
163+
164+ cl->s = &s;
165+ set_closure_fn(cl, closure_sync_fn, NULL);
166+
167+ unsigned flags = atomic_sub_return_release(1 + CLOSURE_RUNNING - CLOSURE_DESTRUCTOR,
168+ &cl->remaining);
169+
170+ closure_put_after_sub_checks(flags);
171+
172+ if (unlikely(flags & CLOSURE_REMAINING_MASK)) {
173+ while (1) {
174+ set_current_state(TASK_UNINTERRUPTIBLE);
175+ if (s.done)
176+ break;
177+ schedule();
178+ }
179+
180+ __set_current_state(TASK_RUNNING);
181+ }
182+
183+ if (cl->parent)
184+ closure_put(cl->parent);
185+}
186+EXPORT_SYMBOL(closure_return_sync);
187+
148188 int __sched __closure_sync_timeout(struct closure *cl, unsigned long timeout)
149189 {
150190 struct closure_syncer s = { .task = current };
lib/string_helpers_kunit.c+1−0
@@ -625,4 +625,5 @@ static struct kunit_suite string_helpers_test_suite = { · 624 unmodified lines
625625
626626 kunit_test_suites(&string_helpers_test_suite);
627627
628+MODULE_DESCRIPTION("Test cases for string helpers module");
628629 MODULE_LICENSE("Dual BSD/GPL");
lib/string_kunit.c+1−0
@@ -633,4 +633,5 @@ static struct kunit_suite string_test_suite = { · 632 unmodified lines
633633
634634 kunit_test_suites(&string_test_suite);
635635
636+MODULE_DESCRIPTION("Test cases for string functions");
636637 MODULE_LICENSE("GPL v2");
mm/page-writeback.c+27−5
@@ -415,13 +415,20 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc) · 414 unmodified lines
415415 else
416416 bg_thresh = (bg_ratio * available_memory) / PAGE_SIZE;
417417
418− if (bg_thresh >= thresh)
419− bg_thresh = thresh / 2;
420418 tsk = current;
421419 if (rt_task(tsk)) {
422420 bg_thresh += bg_thresh / 4 + global_wb_domain.dirty_limit / 32;
423421 thresh += thresh / 4 + global_wb_domain.dirty_limit / 32;
424422 }
423+ /*
424+ * Dirty throttling logic assumes the limits in page units fit into
425+ * 32-bits. This gives 16TB dirty limits max which is hopefully enough.
426+ */
427+ if (thresh > UINT_MAX)
428+ thresh = UINT_MAX;
429+ /* This makes sure bg_thresh is within 32-bits as well */
430+ if (bg_thresh >= thresh)
431+ bg_thresh = thresh / 2;
425432 dtc->thresh = thresh;
426433 dtc->bg_thresh = bg_thresh;
427434
@@ -471,7 +478,11 @@ static unsigned long node_dirty_limit(struct pglist_data *pgdat) · 43 unmodified lines
471478 if (rt_task(tsk))
472479 dirty += dirty / 4;
473480
474− return dirty;
481+ /*
482+ * Dirty throttling logic assumes the limits in page units fit into
483+ * 32-bits. This gives 16TB dirty limits max which is hopefully enough.
484+ */
485+ return min_t(unsigned long, dirty, UINT_MAX);
475486 }
476487
477488 /**
@@ -508,10 +519,17 @@ static int dirty_background_bytes_handler(struct ctl_table *table, int write, · 30 unmodified lines
508519 void *buffer, size_t *lenp, loff_t *ppos)
509520 {
510521 int ret;
522+ unsigned long old_bytes = dirty_background_bytes;
511523
512524 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
513− if (ret == 0 && write)
525+ if (ret == 0 && write) {
526+ if (DIV_ROUND_UP(dirty_background_bytes, PAGE_SIZE) >
527+ UINT_MAX) {
528+ dirty_background_bytes = old_bytes;
529+ return -ERANGE;
530+ }
514531 dirty_background_ratio = 0;
532+ }
515533 return ret;
516534 }
517535
@@ -537,6 +555,10 @@ static int dirty_bytes_handler(struct ctl_table *table, int write, · 19 unmodified lines
537555
538556 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
539557 if (ret == 0 && write && vm_dirty_bytes != old_bytes) {
558+ if (DIV_ROUND_UP(vm_dirty_bytes, PAGE_SIZE) > UINT_MAX) {
559+ vm_dirty_bytes = old_bytes;
560+ return -ERANGE;
561+ }
540562 writeback_set_ratelimit();
541563 vm_dirty_ratio = 0;
542564 }
@@ -1660,7 +1682,7 @@ static inline void wb_dirty_limits(struct dirty_throttle_control *dtc) · 1117 unmodified lines
16601682 */
16611683 dtc->wb_thresh = __wb_calc_thresh(dtc, dtc->thresh);
16621684 dtc->wb_bg_thresh = dtc->thresh ?
1663− div64_u64(dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0;
1685+ div_u64((u64)dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0;
16641686
16651687 /*
16661688 * In order to avoid the stacked BDI deadlock we need
net/bluetooth/hci_conn.c+12−3
@@ -899,8 +899,8 @@ static int hci_conn_hash_alloc_unset(struct hci_dev *hdev) · 898 unmodified lines
899899 U16_MAX, GFP_ATOMIC);
900900 }
901901
902−struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
903− u8 role, u16 handle)
902+static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
903+ u8 role, u16 handle)
904904 {
905905 struct hci_conn *conn;
906906
@@ -1041,7 +1041,16 @@ struct hci_conn *hci_conn_add_unset(struct hci_dev *hdev, int type, · 134 unmodified lines
10411041 if (unlikely(handle < 0))
10421042 return ERR_PTR(-ECONNREFUSED);
10431043
1044− return hci_conn_add(hdev, type, dst, role, handle);
1044+ return __hci_conn_add(hdev, type, dst, role, handle);
1045+}
1046+
1047+struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
1048+ u8 role, u16 handle)
1049+{
1050+ if (handle > HCI_CONN_HANDLE_MAX)
1051+ return ERR_PTR(-EINVAL);
1052+
1053+ return __hci_conn_add(hdev, type, dst, role, handle);
10451054 }
10461055
10471056 static void hci_conn_cleanup_child(struct hci_conn *conn, u8 reason)
net/bluetooth/hci_core.c+22−54
@@ -63,50 +63,6 @@ DEFINE_MUTEX(hci_cb_list_lock); · 62 unmodified lines
6363 /* HCI ID Numbering */
6464 static DEFINE_IDA(hci_index_ida);
6565
66−static int hci_scan_req(struct hci_request *req, unsigned long opt)
67−{
68− __u8 scan = opt;
69−
70− BT_DBG("%s %x", req->hdev->name, scan);
71−
72− /* Inquiry and Page scans */
73− hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
74− return 0;
75−}
76−
77−static int hci_auth_req(struct hci_request *req, unsigned long opt)
78−{
79− __u8 auth = opt;
80−
81− BT_DBG("%s %x", req->hdev->name, auth);
82−
83− /* Authentication */
84− hci_req_add(req, HCI_OP_WRITE_AUTH_ENABLE, 1, &auth);
85− return 0;
86−}
87−
88−static int hci_encrypt_req(struct hci_request *req, unsigned long opt)
89−{
90− __u8 encrypt = opt;
91−
92− BT_DBG("%s %x", req->hdev->name, encrypt);
93−
94− /* Encryption */
95− hci_req_add(req, HCI_OP_WRITE_ENCRYPT_MODE, 1, &encrypt);
96− return 0;
97−}
98−
99−static int hci_linkpol_req(struct hci_request *req, unsigned long opt)
100−{
101− __le16 policy = cpu_to_le16(opt);
102−
103− BT_DBG("%s %x", req->hdev->name, policy);
104−
105− /* Default link policy */
106− hci_req_add(req, HCI_OP_WRITE_DEF_LINK_POLICY, 2, &policy);
107− return 0;
108−}
109−
11066 /* Get HCI device by index.
11167 * Device is held on return. */
11268 struct hci_dev *hci_dev_get(int index)
@@ -735,6 +691,7 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg) · 622 unmodified lines
735691 {
736692 struct hci_dev *hdev;
737693 struct hci_dev_req dr;
694+ __le16 policy;
738695 int err = 0;
739696
740697 if (copy_from_user(&dr, arg, sizeof(dr)))
@@ -761,8 +718,8 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg) · 20 unmodified lines
761718
762719 switch (cmd) {
763720 case HCISETAUTH:
764− err = hci_req_sync(hdev, hci_auth_req, dr.dev_opt,
765− HCI_INIT_TIMEOUT, NULL);
721+ err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_AUTH_ENABLE,
722+ 1, &dr.dev_opt, HCI_CMD_TIMEOUT);
766723 break;
767724
768725 case HCISETENCRYPT:
@@ -773,19 +730,23 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg) · 4 unmodified lines
773730
774731 if (!test_bit(HCI_AUTH, &hdev->flags)) {
775732 /* Auth must be enabled first */
776− err = hci_req_sync(hdev, hci_auth_req, dr.dev_opt,
777− HCI_INIT_TIMEOUT, NULL);
733+ err = __hci_cmd_sync_status(hdev,
734+ HCI_OP_WRITE_AUTH_ENABLE,
735+ 1, &dr.dev_opt,
736+ HCI_CMD_TIMEOUT);
778737 if (err)
779738 break;
780739 }
781740
782− err = hci_req_sync(hdev, hci_encrypt_req, dr.dev_opt,
783− HCI_INIT_TIMEOUT, NULL);
741+ err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_ENCRYPT_MODE,
742+ 1, &dr.dev_opt,
743+ HCI_CMD_TIMEOUT);
784744 break;
785745
786746 case HCISETSCAN:
787− err = hci_req_sync(hdev, hci_scan_req, dr.dev_opt,
788− HCI_INIT_TIMEOUT, NULL);
747+ err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_SCAN_ENABLE,
748+ 1, &dr.dev_opt,
749+ HCI_CMD_TIMEOUT);
789750
790751 /* Ensure that the connectable and discoverable states
791752 * get correctly modified as this was a non-mgmt change.
@@ -795,8 +756,11 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg) · 3 unmodified lines
795756 break;
796757
797758 case HCISETLINKPOL:
798− err = hci_req_sync(hdev, hci_linkpol_req, dr.dev_opt,
799− HCI_INIT_TIMEOUT, NULL);
759+ policy = cpu_to_le16(dr.dev_opt);
760+
761+ err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_DEF_LINK_POLICY,
762+ 2, &policy,
763+ HCI_CMD_TIMEOUT);
800764 break;
801765
802766 case HCISETLINKMODE:
@@ -2751,7 +2715,11 @@ void hci_unregister_dev(struct hci_dev *hdev) · 1948 unmodified lines
27512715 list_del(&hdev->list);
27522716 write_unlock(&hci_dev_list_lock);
27532717
2718+ cancel_work_sync(&hdev->rx_work);
2719+ cancel_work_sync(&hdev->cmd_work);
2720+ cancel_work_sync(&hdev->tx_work);
27542721 cancel_work_sync(&hdev->power_on);
2722+ cancel_work_sync(&hdev->error_reset);
27552723
27562724 hci_cmd_sync_clear(hdev);
27572725
net/bluetooth/hci_event.c+30−3
@@ -6311,6 +6311,13 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, void *data, · 6310 unmodified lines
63116311
63126312 evt_type = __le16_to_cpu(info->type) & LE_EXT_ADV_EVT_TYPE_MASK;
63136313 legacy_evt_type = ext_evt_type_to_legacy(hdev, evt_type);
6314+
6315+ if (test_bit(HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY,
6316+ &hdev->quirks)) {
6317+ info->primary_phy &= 0x1f;
6318+ info->secondary_phy &= 0x1f;
6319+ }
6320+
63146321 if (legacy_evt_type != LE_ADV_INVALID) {
63156322 process_adv_report(hdev, legacy_evt_type, &info->bdaddr,
63166323 info->bdaddr_type, NULL, 0,
@@ -6660,6 +6667,7 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data, · 343 unmodified lines
66606667 struct bt_iso_qos *qos;
66616668 bool pending = false;
66626669 u16 handle = __le16_to_cpu(ev->handle);
6670+ u32 c_sdu_interval, p_sdu_interval;
66636671
66646672 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status);
66656673
@@ -6684,12 +6692,25 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data, · 18 unmodified lines
66846692
66856693 pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, &conn->flags);
66866694
6687− /* Convert ISO Interval (1.25 ms slots) to SDU Interval (us) */
6688− qos->ucast.in.interval = le16_to_cpu(ev->interval) * 1250;
6689− qos->ucast.out.interval = qos->ucast.in.interval;
6695+ /* BLUETOOTH CORE SPECIFICATION Version 5.4 | Vol 6, Part G
6696+ * page 3075:
6697+ * Transport_Latency_C_To_P = CIG_Sync_Delay + (FT_C_To_P) ×
6698+ * ISO_Interval + SDU_Interval_C_To_P
6699+ * ...
6700+ * SDU_Interval = (CIG_Sync_Delay + (FT) x ISO_Interval) -
6701+ * Transport_Latency
6702+ */
6703+ c_sdu_interval = (get_unaligned_le24(ev->cig_sync_delay) +
6704+ (ev->c_ft * le16_to_cpu(ev->interval) * 1250)) -
6705+ get_unaligned_le24(ev->c_latency);
6706+ p_sdu_interval = (get_unaligned_le24(ev->cig_sync_delay) +
6707+ (ev->p_ft * le16_to_cpu(ev->interval) * 1250)) -
6708+ get_unaligned_le24(ev->p_latency);
66906709
66916710 switch (conn->role) {
66926711 case HCI_ROLE_SLAVE:
6712+ qos->ucast.in.interval = c_sdu_interval;
6713+ qos->ucast.out.interval = p_sdu_interval;
66936714 /* Convert Transport Latency (us) to Latency (msec) */
66946715 qos->ucast.in.latency =
66956716 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
@@ -6703,6 +6724,8 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data, · 7 unmodified lines
67036724 qos->ucast.out.phy = ev->p_phy;
67046725 break;
67056726 case HCI_ROLE_MASTER:
6727+ qos->ucast.in.interval = p_sdu_interval;
6728+ qos->ucast.out.interval = c_sdu_interval;
67066729 /* Convert Transport Latency (us) to Latency (msec) */
67076730 qos->ucast.out.latency =
67086731 DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
@@ -6893,6 +6916,10 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data, · 184 unmodified lines
68936916
68946917 bis = hci_conn_hash_lookup_handle(hdev, handle);
68956918 if (!bis) {
6919+ if (handle > HCI_CONN_HANDLE_MAX) {
6920+ bt_dev_dbg(hdev, "ignore too large handle %u", handle);
6921+ continue;
6922+ }
68966923 bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
68976924 HCI_ROLE_SLAVE, handle);
68986925 if (IS_ERR(bis))
net/bluetooth/hci_sync.c+13−0
@@ -280,6 +280,19 @@ int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen, · 279 unmodified lines
280280 }
281281 EXPORT_SYMBOL(__hci_cmd_sync_status);
282282
283+int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
284+ const void *param, u32 timeout)
285+{
286+ int err;
287+
288+ hci_req_sync_lock(hdev);
289+ err = __hci_cmd_sync_status(hdev, opcode, plen, param, timeout);
290+ hci_req_sync_unlock(hdev);
291+
292+ return err;
293+}
294+EXPORT_SYMBOL(hci_cmd_sync_status);
295+
283296 static void hci_cmd_sync_work(struct work_struct *work)
284297 {
285298 struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_sync_work);
net/bluetooth/iso.c+1−2
@@ -1356,8 +1356,7 @@ static int iso_sock_recvmsg(struct socket *sock, struct msghdr *msg, · 1355 unmodified lines
13561356 lock_sock(sk);
13571357 switch (sk->sk_state) {
13581358 case BT_CONNECT2:
1359− if (pi->conn->hcon &&
1360− test_bit(HCI_CONN_PA_SYNC, &pi->conn->hcon->flags)) {
1359+ if (test_bit(BT_SK_PA_SYNC, &pi->flags)) {
13611360 iso_conn_big_sync(sk);
13621361 sk->sk_state = BT_LISTEN;
13631362 } else {
net/bluetooth/l2cap_core.c+3−0
@@ -6761,6 +6761,8 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, · 6760 unmodified lines
67616761
67626762 BT_DBG("chan %p, len %d", chan, skb->len);
67636763
6764+ l2cap_chan_lock(chan);
6765+
67646766 if (chan->state != BT_BOUND && chan->state != BT_CONNECTED)
67656767 goto drop;
67666768
@@ -6777,6 +6779,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, · 10 unmodified lines
67776779 }
67786780
67796781 drop:
6782+ l2cap_chan_unlock(chan);
67806783 l2cap_chan_put(chan);
67816784 free_skb:
67826785 kfree_skb(skb);
net/bluetooth/l2cap_sock.c+11−3
@@ -1239,6 +1239,10 @@ static void l2cap_sock_kill(struct sock *sk) · 1238 unmodified lines
12391239
12401240 BT_DBG("sk %p state %s", sk, state_to_string(sk->sk_state));
12411241
1242+ /* Sock is dead, so set chan data to NULL, avoid other task use invalid
1243+ * sock pointer.
1244+ */
1245+ l2cap_pi(sk)->chan->data = NULL;
12421246 /* Kill poor orphan */
12431247
12441248 l2cap_chan_put(l2cap_pi(sk)->chan);
@@ -1481,12 +1485,16 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan) · 236 unmodified lines
14811485
14821486 static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
14831487 {
1484− struct sock *sk = chan->data;
1485− struct l2cap_pinfo *pi = l2cap_pi(sk);
1488+ struct sock *sk;
1489+ struct l2cap_pinfo *pi;
14861490 int err;
14871491
1488− lock_sock(sk);
1492+ sk = chan->data;
1493+ if (!sk)
1494+ return -ENXIO;
14891495
1496+ pi = l2cap_pi(sk);
1497+ lock_sock(sk);
14901498 if (chan->mode == L2CAP_MODE_ERTM && !list_empty(&pi->rx_busy)) {
14911499 err = -ENOMEM;
14921500 goto done;
net/core/datagram.c+13−6
@@ -416,15 +416,22 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset, · 415 unmodified lines
416416
417417 end = start + skb_frag_size(frag);
418418 if ((copy = end - offset) > 0) {
419− struct page *page = skb_frag_page(frag);
420− u8 *vaddr = kmap(page);
419+ u32 p_off, p_len, copied;
420+ struct page *p;
421+ u8 *vaddr;
421422
422423 if (copy > len)
423424 copy = len;
424− n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
425− vaddr + skb_frag_off(frag) + offset - start,
426− copy, data, to);
427− kunmap(page);
425+
426+ skb_frag_foreach_page(frag,
427+ skb_frag_off(frag) + offset - start,
428+ copy, p, p_off, p_len, copied) {
429+ vaddr = kmap_local_page(p);
430+ n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
431+ vaddr + p_off, p_len, data, to);
432+ kunmap_local(vaddr);
433+ }
434+
428435 offset += n;
429436 if (n != copy)
430437 goto short_copy;
net/ipv4/inet_diag.c+2−0
@@ -1383,6 +1383,7 @@ static int inet_diag_dump_compat(struct sk_buff *skb, · 1382 unmodified lines
13831383 req.sdiag_family = AF_UNSPEC; /* compatibility */
13841384 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type);
13851385 req.idiag_ext = rc->idiag_ext;
1386+ req.pad = 0;
13861387 req.idiag_states = rc->idiag_states;
13871388 req.id = rc->id;
13881389
@@ -1398,6 +1399,7 @@ static int inet_diag_get_exact_compat(struct sk_buff *in_skb, · 9 unmodified lines
13981399 req.sdiag_family = rc->idiag_family;
13991400 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type);
14001401 req.idiag_ext = rc->idiag_ext;
1402+ req.pad = 0;
14011403 req.idiag_states = rc->idiag_states;
14021404 req.id = rc->id;
14031405
net/ipv4/tcp_input.c+8−1
@@ -3077,7 +3077,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una, · 3076 unmodified lines
30773077 return;
30783078
30793079 if (tcp_try_undo_dsack(sk))
3080− tcp_try_keep_open(sk);
3080+ tcp_try_to_open(sk, flag);
30813081
30823082 tcp_identify_packet_loss(sk, ack_flag);
30833083 if (icsk->icsk_ca_state != TCP_CA_Recovery) {
@@ -4227,6 +4227,13 @@ void tcp_parse_options(const struct net *net, · 1143 unmodified lines
42274227 * checked (see tcp_v{4,6}_rcv()).
42284228 */
42294229 break;
4230+#endif
4231+#ifdef CONFIG_TCP_AO
4232+ case TCPOPT_AO:
4233+ /* TCP AO has already been checked
4234+ * (see tcp_inbound_ao_hash()).
4235+ */
4236+ break;
42304237 #endif
42314238 case TCPOPT_FASTOPEN:
42324239 tcp_parse_fastopen_option(
net/ipv4/tcp_metrics.c+1−0
@@ -619,6 +619,7 @@ static const struct nla_policy tcp_metrics_nl_policy[TCP_METRICS_ATTR_MAX + 1] = · 618 unmodified lines
619619 [TCP_METRICS_ATTR_ADDR_IPV4] = { .type = NLA_U32, },
620620 [TCP_METRICS_ATTR_ADDR_IPV6] = { .type = NLA_BINARY,
621621 .len = sizeof(struct in6_addr), },
622+ [TCP_METRICS_ATTR_SADDR_IPV4] = { .type = NLA_U32, },
622623 /* Following attributes are not received for GET/DEL,
623624 * we keep them for reference
624625 */
net/mac802154/main.c+8−6
@@ -161,8 +161,10 @@ void ieee802154_configure_durations(struct wpan_phy *phy, · 160 unmodified lines
161161 }
162162
163163 phy->symbol_duration = duration;
164− phy->lifs_period = (IEEE802154_LIFS_PERIOD * phy->symbol_duration) / NSEC_PER_SEC;
165− phy->sifs_period = (IEEE802154_SIFS_PERIOD * phy->symbol_duration) / NSEC_PER_SEC;
164+ phy->lifs_period =
165+ (IEEE802154_LIFS_PERIOD * phy->symbol_duration) / NSEC_PER_USEC;
166+ phy->sifs_period =
167+ (IEEE802154_SIFS_PERIOD * phy->symbol_duration) / NSEC_PER_USEC;
166168 }
167169 EXPORT_SYMBOL(ieee802154_configure_durations);
168170
@@ -184,10 +186,10 @@ static void ieee802154_setup_wpan_phy_pib(struct wpan_phy *wpan_phy) · 15 unmodified lines
184186 * Should be done when all drivers sets this value.
185187 */
186188
187− wpan_phy->lifs_period =
188− (IEEE802154_LIFS_PERIOD * wpan_phy->symbol_duration) / 1000;
189− wpan_phy->sifs_period =
190− (IEEE802154_SIFS_PERIOD * wpan_phy->symbol_duration) / 1000;
189+ wpan_phy->lifs_period = (IEEE802154_LIFS_PERIOD *
190+ wpan_phy->symbol_duration) / NSEC_PER_USEC;
191+ wpan_phy->sifs_period = (IEEE802154_SIFS_PERIOD *
192+ wpan_phy->symbol_duration) / NSEC_PER_USEC;
191193 }
192194
193195 int ieee802154_register_hw(struct ieee802154_hw *hw)
net/mac802154/tx.c+4−4
@@ -34,8 +34,8 @@ void ieee802154_xmit_sync_worker(struct work_struct *work) · 33 unmodified lines
3434 if (res)
3535 goto err_tx;
3636
37− dev->stats.tx_packets++;
38− dev->stats.tx_bytes += skb->len;
37+ DEV_STATS_INC(dev, tx_packets);
38+ DEV_STATS_ADD(dev, tx_bytes, skb->len);
3939
4040 ieee802154_xmit_complete(&local->hw, skb, false);
4141
@@ -90,8 +90,8 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) · 48 unmodified lines
9090 if (ret)
9191 goto err_wake_netif_queue;
9292
93− dev->stats.tx_packets++;
94− dev->stats.tx_bytes += len;
93+ DEV_STATS_INC(dev, tx_packets);
94+ DEV_STATS_ADD(dev, tx_bytes, len);
9595 } else {
9696 local->tx_skb = skb;
9797 queue_work(local->workqueue, &local->sync_tx_work);
net/netfilter/nf_tables_api.c+1−2
@@ -11552,8 +11552,7 @@ static int nft_rcv_nl_event(struct notifier_block *this, unsigned long event, · 11551 unmodified lines
1155211552
1155311553 gc_seq = nft_gc_seq_begin(nft_net);
1155411554
11555− if (!list_empty(&nf_tables_destroy_list))
11556− nf_tables_trans_destroy_flush_work();
11555+ nf_tables_trans_destroy_flush_work();
1155711556 again:
1155811557 list_for_each_entry(table, &nft_net->tables, list) {
1155911558 if (nft_table_has_owner(table) &&
net/sunrpc/svc.c+4−1
@@ -1557,9 +1557,11 @@ out_drop: · 1556 unmodified lines
15571557 */
15581558 void svc_process_bc(struct rpc_rqst *req, struct svc_rqst *rqstp)
15591559 {
1560+ struct rpc_timeout timeout = {
1561+ .to_increment = 0,
1562+ };
15601563 struct rpc_task *task;
15611564 int proc_error;
1562− struct rpc_timeout timeout;
15631565
15641566 /* Build the svc_rqst used by the common processing routine */
15651567 rqstp->rq_xid = req->rq_xid;
@@ -1612,6 +1614,7 @@ void svc_process_bc(struct rpc_rqst *req, struct svc_rqst *rqstp) · 46 unmodified lines
16121614 timeout.to_initval = req->rq_xprt->timeout->to_initval;
16131615 timeout.to_retries = req->rq_xprt->timeout->to_retries;
16141616 }
1617+ timeout.to_maxval = timeout.to_initval;
16151618 memcpy(&req->rq_snd_buf, &rqstp->rq_res, sizeof(req->rq_snd_buf));
16161619 task = rpc_run_bc_task(req, &timeout);
16171620
net/sunrpc/svc_xprt.c+3−5
@@ -1421,13 +1421,12 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos) · 1420 unmodified lines
14211421
14221422 dprintk("svc_pool_stats_start, *pidx=%u\n", pidx);
14231423
1424− if (!si->serv)
1425− return NULL;
1426−
14271424 mutex_lock(si->mutex);
14281425
14291426 if (!pidx)
14301427 return SEQ_START_TOKEN;
1428+ if (!si->serv)
1429+ return NULL;
14311430 return pidx > si->serv->sv_nrpools ? NULL
14321431 : &si->serv->sv_pools[pidx - 1];
14331432 }
@@ -1459,8 +1458,7 @@ static void svc_pool_stats_stop(struct seq_file *m, void *p) · 25 unmodified lines
14591458 {
14601459 struct svc_info *si = m->private;
14611460
1462− if (si->serv)
1463− mutex_unlock(si->mutex);
1461+ mutex_unlock(si->mutex);
14641462 }
14651463
14661464 static int svc_pool_stats_show(struct seq_file *m, void *p)
net/unix/garbage.c+5−4
@@ -470,6 +470,7 @@ prev_vertex: · 469 unmodified lines
470470 }
471471
472472 if (vertex->index == vertex->scc_index) {
473+ struct unix_vertex *v;
473474 struct list_head scc;
474475 bool scc_dead = true;
475476
@@ -480,15 +481,15 @@ prev_vertex: · 4 unmodified lines
480481 */
481482 __list_cut_position(&scc, &vertex_stack, &vertex->scc_entry);
482483
483− list_for_each_entry_reverse(vertex, &scc, scc_entry) {
484+ list_for_each_entry_reverse(v, &scc, scc_entry) {
484485 /* Don't restart DFS from this vertex in unix_walk_scc(). */
485− list_move_tail(&vertex->entry, &unix_visited_vertices);
486+ list_move_tail(&v->entry, &unix_visited_vertices);
486487
487488 /* Mark vertex as off-stack. */
488− vertex->index = unix_vertex_grouped_index;
489+ v->index = unix_vertex_grouped_index;
489490
490491 if (scc_dead)
491− scc_dead = unix_vertex_dead(vertex);
492+ scc_dead = unix_vertex_dead(v);
492493 }
493494
494495 if (scc_dead)
scripts/Makefile.dtbinst+1−1
@@ -17,7 +17,7 @@ include $(srctree)/scripts/Kbuild.include · 16 unmodified lines
1717 dst := $(INSTALL_DTBS_PATH)
1818
1919 quiet_cmd_dtb_install = INSTALL $@
20− cmd_dtb_install = install -D $< $@
20+ cmd_dtb_install = install -D -m 0644 $< $@
2121
2222 $(dst)/%: $(obj)/%
2323 $(call cmd,dtb_install)
scripts/Makefile.host+1−1
@@ -146,7 +146,7 @@ $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) · 145 unmodified lines
146146 # Create .o file from a single .cc (C++) file
147147 quiet_cmd_host-cxxobjs = HOSTCXX $@
148148 cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
149−$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
149+$(host-cxxobjs): $(obj)/%.o: $(obj)/%.cc FORCE
150150 $(call if_changed_dep,host-cxxobjs)
151151
152152 # Create executable from a single Rust crate (which may consist of
scripts/Makefile.package+1−1
@@ -103,7 +103,7 @@ debian-orig: private version = $(shell dpkg-parsechangelog -S Version | sed 's/- · 102 unmodified lines
103103 debian-orig: private orig-name = $(source)_$(version).orig.tar$(debian-orig-suffix)
104104 debian-orig: mkdebian-opts = --need-source
105105 debian-orig: linux.tar$(debian-orig-suffix) debian
106− $(Q)if [ "$(df --output=target .. 2>/dev/null)" = "$(df --output=target $< 2>/dev/null)" ]; then \
106+ $(Q)if [ "$$(df --output=target .. 2>/dev/null)" = "$$(df --output=target $< 2>/dev/null)" ]; then \
107107 ln -f $< ../$(orig-name); \
108108 else \
109109 cp $< ../$(orig-name); \
scripts/gdb/linux/Makefile+1−1
@@ -5,7 +5,7 @@ ifdef building_out_of_srctree · 4 unmodified lines
55 symlinks := $(patsubst $(src)/%,%,$(wildcard $(src)/*.py))
66
77 quiet_cmd_symlink = SYMLINK $@
8− cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(src)/%,$@) $@
8+ cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(src))/%,$@) $@
99
1010 always-y += $(symlinks)
1111 $(addprefix $(obj)/, $(symlinks)): FORCE
scripts/package/kernel.spec+3−5
@@ -57,7 +57,8 @@ patch -p1 < %{SOURCE2} · 56 unmodified lines
5757 %install
5858 mkdir -p %{buildroot}/lib/modules/%{KERNELRELEASE}
5959 cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEASE}/vmlinuz
60−%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} modules_install
60+# DEPMOD=true makes depmod no-op. We do not package depmod-generated files.
61+%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} DEPMOD=true modules_install
6162 %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
6263 cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE}
6364 cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config
@@ -70,10 +71,7 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA · 6 unmodified lines
7071 %endif
7172
7273 {
73− for x in System.map config kernel modules.builtin \
74− modules.builtin.modinfo modules.order vmlinuz; do
75− echo "/lib/modules/%{KERNELRELEASE}/${x}"
76− done
74+ echo "/lib/modules/%{KERNELRELEASE}"
7775
7876 for x in alias alias.bin builtin.alias.bin builtin.bin dep dep.bin \
7977 devname softdep symbols symbols.bin; do
tools/power/x86/turbostat/Makefile+5−1
@@ -14,6 +14,7 @@ turbostat : turbostat.c · 13 unmodified lines
1414 override CFLAGS += -O2 -Wall -Wextra -I../../../include
1515 override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
1616 override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
17+override CFLAGS += -DBUILD_BUG_HEADER='"../../../../include/linux/build_bug.h"'
1718 override CFLAGS += -D_FILE_OFFSET_BITS=64
1819 override CFLAGS += -D_FORTIFY_SOURCE=2
1920
@@ -44,10 +45,13 @@ snapshot: turbostat · 24 unmodified lines
4445 @echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
4546 @echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
4647
48+ @echo '#define BUILD_BUG_ON(cond) do { enum { compile_time_check ## __COUNTER__ = 1/(!(cond)) }; } while (0)' > $(SNAPSHOT)/build_bug.h
49+
4750 @echo PWD=. > $(SNAPSHOT)/Makefile
4851 @echo "CFLAGS += -DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile
4952 @echo "CFLAGS += -DINTEL_FAMILY_HEADER='\"intel-family.h\"'" >> $(SNAPSHOT)/Makefile
50− @sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
53+ @echo "CFLAGS += -DBUILD_BUG_HEADER='\"build_bug.h\"'" >> $(SNAPSHOT)/Makefile
54+ @sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' -e's/.*BUILD_BUG_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
5155
5256 @rm -f $(SNAPSHOT).tar.gz
5357 tar cvzf $(SNAPSHOT).tar.gz $(SNAPSHOT)
tools/power/x86/turbostat/turbostat.c+10−10
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #define _GNU_SOURCE
1111 #include MSRHEADER
1212 #include INTEL_FAMILY_HEADER
13+#include BUILD_BUG_HEADER
1314 #include <stdarg.h>
1415 #include <stdio.h>
1516 #include <err.h>
@@ -38,7 +39,6 @@ · 22 unmodified lines
3839 #include <stdbool.h>
3940 #include <assert.h>
4041 #include <linux/kernel.h>
41−#include <linux/build_bug.h>
4242
4343 #define UNUSED(x) (void)(x)
4444
@@ -5695,9 +5695,6 @@ static void probe_intel_uncore_frequency_cluster(void) · 5650 unmodified lines
56955695 if (access("/sys/devices/system/cpu/intel_uncore_frequency/uncore00/current_freq_khz", R_OK))
56965696 return;
56975697
5698− if (quiet)
5699− return;
5700−
57015698 for (uncore_max_id = 0;; ++uncore_max_id) {
57025699
57035700 sprintf(path_base, "/sys/devices/system/cpu/intel_uncore_frequency/uncore%02d", uncore_max_id);
@@ -5727,6 +5724,14 @@ static void probe_intel_uncore_frequency_cluster(void) · 23 unmodified lines
57275724 sprintf(path, "%s/fabric_cluster_id", path_base);
57285725 cluster_id = read_sysfs_int(path);
57295726
5727+ sprintf(path, "%s/current_freq_khz", path_base);
5728+ sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id);
5729+
5730+ add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
5731+
5732+ if (quiet)
5733+ continue;
5734+
57305735 sprintf(path, "%s/min_freq_khz", path_base);
57315736 k = read_sysfs_int(path);
57325737 sprintf(path, "%s/max_freq_khz", path_base);
@@ -5743,11 +5748,6 @@ static void probe_intel_uncore_frequency_cluster(void) · 10 unmodified lines
57435748 sprintf(path, "%s/current_freq_khz", path_base);
57445749 k = read_sysfs_int(path);
57455750 fprintf(outf, " %d MHz\n", k / 1000);
5746−
5747− sprintf(path, "%s/current_freq_khz", path_base);
5748− sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id);
5749−
5750− add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
57515751 }
57525752 }
57535753
@@ -8424,7 +8424,7 @@ void cmdline(int argc, char **argv) · 2670 unmodified lines
84248424 * Parse some options early, because they may make other options invalid,
84258425 * like adding the MSR counter with --add and at the same time using --no-msr.
84268426 */
8427− while ((opt = getopt_long_only(argc, argv, "MP", long_options, &option_index)) != -1) {
8427+ while ((opt = getopt_long_only(argc, argv, "MPn:", long_options, &option_index)) != -1) {
84288428 switch (opt) {
84298429 case 'M':
84308430 no_msr = 1;
tools/testing/cxl/test/cxl.c+4−0
@@ -630,11 +630,15 @@ static struct cxl_hdm *mock_cxl_setup_hdm(struct cxl_port *port, · 629 unmodified lines
630630 struct cxl_endpoint_dvsec_info *info)
631631 {
632632 struct cxl_hdm *cxlhdm = devm_kzalloc(&port->dev, sizeof(*cxlhdm), GFP_KERNEL);
633+ struct device *dev = &port->dev;
633634
634635 if (!cxlhdm)
635636 return ERR_PTR(-ENOMEM);
636637
637638 cxlhdm->port = port;
639+ cxlhdm->interleave_mask = ~0U;
640+ cxlhdm->iw_cap_mask = ~0UL;
641+ dev_set_drvdata(dev, cxlhdm);
638642 return cxlhdm;
639643 }
640644
tools/testing/selftests/kselftest_harness.h+24−19
@@ -66,8 +66,6 @@ · 65 unmodified lines
6666 #include <sys/wait.h>
6767 #include <unistd.h>
6868 #include <setjmp.h>
69−#include <syscall.h>
70−#include <linux/sched.h>
7169
7270 #include "kselftest.h"
7371
@@ -82,17 +80,6 @@ · 8 unmodified lines
8280 # define TH_LOG_ENABLED 1
8381 #endif
8482
85−/* Wait for the child process to end but without sharing memory mapping. */
86−static inline pid_t clone3_vfork(void)
87−{
88− struct clone_args args = {
89− .flags = CLONE_VFORK,
90− .exit_signal = SIGCHLD,
91− };
92−
93− return syscall(__NR_clone3, &args, sizeof(args));
94−}
95−
9683 /**
9784 * TH_LOG()
9885 *
@@ -437,7 +424,7 @@ static inline pid_t clone3_vfork(void) · 338 unmodified lines
437424 } \
438425 if (setjmp(_metadata->env) == 0) { \
439426 /* _metadata and potentially self are shared with all forks. */ \
440− child = clone3_vfork(); \
427+ child = fork(); \
441428 if (child == 0) { \
442429 fixture_name##_setup(_metadata, self, variant->data); \
443430 /* Let setup failure terminate early. */ \
@@ -1016,7 +1003,14 @@ void __wait_for_test(struct __test_metadata *t) · 572 unmodified lines
10161003 .sa_flags = SA_SIGINFO,
10171004 };
10181005 struct sigaction saved_action;
1019− int status;
1006+ /*
1007+ * Sets status so that WIFEXITED(status) returns true and
1008+ * WEXITSTATUS(status) returns KSFT_FAIL. This safe default value
1009+ * should never be evaluated because of the waitpid(2) check and
1010+ * SIGALRM handling.
1011+ */
1012+ int status = KSFT_FAIL << 8;
1013+ int child;
10201014
10211015 if (sigaction(SIGALRM, &action, &saved_action)) {
10221016 t->exit_code = KSFT_FAIL;
@@ -1028,7 +1022,15 @@ void __wait_for_test(struct __test_metadata *t) · 5 unmodified lines
10281022 __active_test = t;
10291023 t->timed_out = false;
10301024 alarm(t->timeout);
1031− waitpid(t->pid, &status, 0);
1025+ child = waitpid(t->pid, &status, 0);
1026+ if (child == -1 && errno != EINTR) {
1027+ t->exit_code = KSFT_FAIL;
1028+ fprintf(TH_LOG_STREAM,
1029+ "# %s: Failed to wait for PID %d (errno: %d)\n",
1030+ t->name, t->pid, errno);
1031+ return;
1032+ }
1033+
10321034 alarm(0);
10331035 if (sigaction(SIGALRM, &saved_action, NULL)) {
10341036 t->exit_code = KSFT_FAIL;
@@ -1083,6 +1085,7 @@ void __wait_for_test(struct __test_metadata *t) · 48 unmodified lines
10831085 WTERMSIG(status));
10841086 }
10851087 } else {
1088+ t->exit_code = KSFT_FAIL;
10861089 fprintf(TH_LOG_STREAM,
10871090 "# %s: Test ended in some other way [%u]\n",
10881091 t->name,
@@ -1218,6 +1221,7 @@ void __run_test(struct __fixture_metadata *f, · 129 unmodified lines
12181221 struct __test_xfail *xfail;
12191222 char test_name[1024];
12201223 const char *diagnostic;
1224+ int child;
12211225
12221226 /* reset test struct */
12231227 t->exit_code = KSFT_PASS;
@@ -1236,15 +1240,16 @@ void __run_test(struct __fixture_metadata *f, · 12 unmodified lines
12361240 fflush(stdout);
12371241 fflush(stderr);
12381242
1239− t->pid = clone3_vfork();
1240− if (t->pid < 0) {
1243+ child = fork();
1244+ if (child < 0) {
12411245 ksft_print_msg("ERROR SPAWNING TEST CHILD\n");
12421246 t->exit_code = KSFT_FAIL;
1243− } else if (t->pid == 0) {
1247+ } else if (child == 0) {
12441248 setpgrp();
12451249 t->fn(t, variant);
12461250 _exit(t->exit_code);
12471251 } else {
1252+ t->pid = child;
12481253 __wait_for_test(t);
12491254 }
12501255 ksft_print_msg(" %4s %s\n",
tools/testing/selftests/net/af_unix/scm_rights.c+23−2
@@ -14,12 +14,12 @@ · 13 unmodified lines
1414
1515 FIXTURE(scm_rights)
1616 {
17− int fd[16];
17+ int fd[32];
1818 };
1919
2020 FIXTURE_VARIANT(scm_rights)
2121 {
22− char name[16];
22+ char name[32];
2323 int type;
2424 int flags;
2525 bool test_listener;
@@ -172,6 +172,8 @@ static void __create_sockets(struct __test_metadata *_metadata, · 146 unmodified lines
172172 const FIXTURE_VARIANT(scm_rights) *variant,
173173 int n)
174174 {
175+ ASSERT_LE(n * 2, sizeof(self->fd) / sizeof(self->fd[0]));
176+
175177 if (variant->test_listener)
176178 create_listeners(_metadata, self, n);
177179 else
@@ -283,4 +285,23 @@ TEST_F(scm_rights, cross_edge) · 105 unmodified lines
283285 close_sockets(8);
284286 }
285287
288+TEST_F(scm_rights, backtrack_from_scc)
289+{
290+ create_sockets(10);
291+
292+ send_fd(0, 1);
293+ send_fd(0, 4);
294+ send_fd(1, 2);
295+ send_fd(2, 3);
296+ send_fd(3, 1);
297+
298+ send_fd(5, 6);
299+ send_fd(5, 9);
300+ send_fd(6, 7);
301+ send_fd(7, 8);
302+ send_fd(8, 6);
303+
304+ close_sockets(10);
305+}
306+
286307 TEST_HARNESS_MAIN
tools/testing/selftests/net/msg_zerocopy.c+12−2
@@ -85,6 +85,7 @@ static bool cfg_rx; · 84 unmodified lines
8585 static int cfg_runtime_ms = 4200;
8686 static int cfg_verbose;
8787 static int cfg_waittime_ms = 500;
88+static int cfg_notification_limit = 32;
8889 static bool cfg_zerocopy;
8990
9091 static socklen_t cfg_alen;
@@ -95,6 +96,7 @@ static char payload[IP_MAXPACKET]; · 4 unmodified lines
9596 static long packets, bytes, completions, expected_completions;
9697 static int zerocopied = -1;
9798 static uint32_t next_completion;
99+static uint32_t sends_since_notify;
98100
99101 static unsigned long gettimeofday_ms(void)
100102 {
@@ -208,6 +210,7 @@ static bool do_sendmsg(int fd, struct msghdr *msg, bool do_zerocopy, int domain) · 107 unmodified lines
208210 error(1, errno, "send");
209211 if (cfg_verbose && ret != len)
210212 fprintf(stderr, "send: ret=%u != %u\n", ret, len);
213+ sends_since_notify++;
211214
212215 if (len) {
213216 packets++;
@@ -435,7 +438,7 @@ static bool do_recv_completion(int fd, int domain) · 221 unmodified lines
435438 /* Detect notification gaps. These should not happen often, if at all.
436439 * Gaps can occur due to drops, reordering and retransmissions.
437440 */
438− if (lo != next_completion)
441+ if (cfg_verbose && lo != next_completion)
439442 fprintf(stderr, "gap: %u..%u does not append to %u\n",
440443 lo, hi, next_completion);
441444 next_completion = hi + 1;
@@ -460,6 +463,7 @@ static bool do_recv_completion(int fd, int domain) · 18 unmodified lines
460463 static void do_recv_completions(int fd, int domain)
461464 {
462465 while (do_recv_completion(fd, domain)) {}
466+ sends_since_notify = 0;
463467 }
464468
465469 /* Wait for all remaining completions on the errqueue */
@@ -549,6 +553,9 @@ static void do_tx(int domain, int type, int protocol) · 83 unmodified lines
549553 else
550554 do_sendmsg(fd, &msg, cfg_zerocopy, domain);
551555
556+ if (cfg_zerocopy && sends_since_notify >= cfg_notification_limit)
557+ do_recv_completions(fd, domain);
558+
552559 while (!do_poll(fd, POLLOUT)) {
553560 if (cfg_zerocopy)
554561 do_recv_completions(fd, domain);
@@ -708,7 +715,7 @@ static void parse_opts(int argc, char **argv) · 153 unmodified lines
708715
709716 cfg_payload_len = max_payload_len;
710717
711− while ((c = getopt(argc, argv, "46c:C:D:i:mp:rs:S:t:vz")) != -1) {
718+ while ((c = getopt(argc, argv, "46c:C:D:i:l:mp:rs:S:t:vz")) != -1) {
712719 switch (c) {
713720 case '4':
714721 if (cfg_family != PF_UNSPEC)
@@ -736,6 +743,9 @@ static void parse_opts(int argc, char **argv) · 21 unmodified lines
736743 if (cfg_ifindex == 0)
737744 error(1, errno, "invalid iface: %s", optarg);
738745 break;
746+ case 'l':
747+ cfg_notification_limit = strtoul(optarg, NULL, 0);
748+ break;
739749 case 'm':
740750 cfg_cork_mixed = true;
741751 break;
tools/testing/selftests/resctrl/cat_test.c+22−10
@@ -291,11 +291,30 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param · 290 unmodified lines
291291 return ret;
292292 }
293293
294+static bool arch_supports_noncont_cat(const struct resctrl_test *test)
295+{
296+ unsigned int eax, ebx, ecx, edx;
297+
298+ /* AMD always supports non-contiguous CBM. */
299+ if (get_vendor() == ARCH_AMD)
300+ return true;
301+
302+ /* Intel support for non-contiguous CBM needs to be discovered. */
303+ if (!strcmp(test->resource, "L3"))
304+ __cpuid_count(0x10, 1, eax, ebx, ecx, edx);
305+ else if (!strcmp(test->resource, "L2"))
306+ __cpuid_count(0x10, 2, eax, ebx, ecx, edx);
307+ else
308+ return false;
309+
310+ return ((ecx >> 3) & 1);
311+}
312+
294313 static int noncont_cat_run_test(const struct resctrl_test *test,
295314 const struct user_params *uparams)
296315 {
297316 unsigned long full_cache_mask, cont_mask, noncont_mask;
298− unsigned int eax, ebx, ecx, edx, sparse_masks;
317+ unsigned int sparse_masks;
299318 int bit_center, ret;
300319 char schemata[64];
301320
@@ -304,15 +323,8 @@ static int noncont_cat_run_test(const struct resctrl_test *test, · 2 unmodified lines
304323 if (ret)
305324 return ret;
306325
307− if (!strcmp(test->resource, "L3"))
308− __cpuid_count(0x10, 1, eax, ebx, ecx, edx);
309− else if (!strcmp(test->resource, "L2"))
310− __cpuid_count(0x10, 2, eax, ebx, ecx, edx);
311− else
312− return -EINVAL;
313−
314− if (sparse_masks != ((ecx >> 3) & 1)) {
315− ksft_print_msg("CPUID output doesn't match 'sparse_masks' file content!\n");
326+ if (arch_supports_noncont_cat(test) != sparse_masks) {
327+ ksft_print_msg("Hardware and kernel differ on non-contiguous CBM support!\n");
316328 return 1;
317329 }
318330

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

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

Repository code

Go to file
t