History

ASoC: Intel: avs: Fixes and cleanups for 6.10

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>: Set of changes targeting the avs-driver only. No new features, patchset either fixes or fortifies existing code. Patchset starts off with a fix for debugbility on ICL+ platforms which I have forgotten to fixup when providing support for these initially. The next two address copier module initialization, most importantly, silence the gcc 'field-spanning write' false-positive. The following four: 6/13 ASoC: Intel: avs: Replace risky functions with safer variants 7/13 ASoC: Intel: avs: Fix potential integer overflow 8/13 ASoC: Intel: avs: Test result of avs_get_module_entry() 9/13 ASoC: Intel: avs: Remove dead code address problems found out by Coverity static analysis tool. The last two worth mentioning are: recommendation from the firmware team to wake subsystem from D0ix when starting any pipeline -and- shielding against invalid period/buffer sizes. Audio format shall be taken into consideration when calculating either of these. Amadeusz Sławiński (2): ASoC: Intel: avs: Restore stream decoupling on prepare ASoC: Intel: avs: Add assert_static to guarantee ABI sizes Cezary Rojewski (11): ASoC: Intel: avs: Fix debug-slot offset calculation ASoC: Intel: avs: Silence false-positive memcpy() warnings ASoC: Intel: avs: Fix config_length for config-less copiers ASoC: Intel: avs: Fix ASRC module initialization ASoC: Intel: avs: Replace risky functions with safer variants ASoC: Intel: avs: Fix potential integer overflow ASoC: Intel: avs: Test result of avs_get_module_entry() ASoC: Intel: avs: Remove dead code ASoC: Intel: avs: Wake from D0ix when starting streaming ASoC: Intel: avs: Init debugfs before booting firmware ASoC: Intel: avs: Rule invalid buffer and period sizes out sound/soc/intel/avs/avs.h | 1 + sound/soc/intel/avs/cldma.c | 2 +- sound/soc/intel/avs/core.c | 4 +-- sound/soc/intel/avs/icl.c | 12 ++++++--- sound/soc/intel/avs/loader.c | 6 +++-- sound/soc/intel/avs/messages.h | 47 ++++++++++++++++++++++++++++++++-- sound/soc/intel/avs/path.c | 13 ++++------ sound/soc/intel/avs/pcm.c | 34 +++++++++++++++++++++++- sound/soc/intel/avs/probes.c | 14 ++++++---- 9 files changed, 109 insertions(+), 24 deletions(-) -- 2.25.1

Mark Brown committed 2 years ago

Commit 3018fdf2 parents 716778b 9a38599412 files · +3581 −1914Browse files

Unified · Split

412 files
  1. .mailmap +4 −2
  2. Documentation/arch/x86/resctrl.rst +1 −1
  3. Documentation/kbuild/llvm.rst +1 −1
  4. MAINTAINERS +61 −17
  5. Makefile +1 −1
  6. arch/arm/include/asm/mman.h +14 −0
  7. arch/arm64/net/bpf_jit_comp.c +2 −2
  8. arch/hexagon/kernel/vmlinux.lds.S +1 −0
  9. arch/mips/Kconfig +9 −9
  10. arch/parisc/include/asm/mman.h +14 −0
  11. arch/riscv/net/bpf_jit_comp64.c +16 −0
  12. arch/s390/net/bpf_jit_comp.c +20 −26
  13. arch/x86/Kbuild +1 −1
  14. arch/x86/Kconfig +2 −0
  15. arch/x86/Makefile +0 −2
  16. arch/x86/boot/compressed/efi_mixed.S +15 −5
  17. arch/x86/entry/vdso/Makefile +1 −0
  18. arch/x86/events/amd/core.c +34 −5
  19. arch/x86/events/amd/lbr.c +10 −6
  20. arch/x86/include/asm/asm-prototypes.h +1 −0
  21. arch/x86/include/asm/cpufeature.h +4 −2
  22. arch/x86/include/asm/cpufeatures.h +9 −1
  23. arch/x86/include/asm/crash_reserve.h +2 −0
  24. arch/x86/include/asm/disabled-features.h +2 −1
  25. arch/x86/include/asm/nospec-branch.h +16 −5
  26. arch/x86/include/asm/required-features.h +2 −1
  27. arch/x86/include/asm/sev.h +2 −2
  28. arch/x86/include/asm/x86_init.h +2 −1
  29. arch/x86/kernel/cpu/scattered.c +1 −0
  30. arch/x86/kernel/eisa.c +2 −1
  31. arch/x86/kernel/nmi.c +14 −10
  32. arch/x86/kernel/probe_roms.c +0 −10
  33. arch/x86/kernel/setup.c +1 −2
  34. arch/x86/kernel/sev.c +12 −15
  35. arch/x86/kernel/x86_init.c +2 −0
  36. arch/x86/lib/retpoline.S +6 −5
  37. arch/x86/mm/ident_map.c +5 −18
  38. arch/x86/mm/mem_encrypt_amd.c +18 −0
  39. arch/x86/virt/Makefile +1 −1
  40. block/blk-merge.c +1 −1
  41. block/blk-mq.c +2 −7
  42. block/blk-settings.c +1 −2
  43. block/blk.h +0 −1
  44. crypto/asymmetric_keys/mscode_parser.c +3 −0
  45. crypto/asymmetric_keys/pkcs7_parser.c +4 −0
  46. crypto/asymmetric_keys/public_key.c +2 −1
  47. crypto/asymmetric_keys/signature.c +1 −1
  48. crypto/asymmetric_keys/x509_cert_parser.c +8 −0
  49. crypto/testmgr.h +80 −0
  50. drivers/acpi/acpica/dbnames.c +6 −2
  51. drivers/acpi/apei/einj-core.c +1 −1
  52. drivers/ata/libata-eh.c +4 −1
  53. drivers/ata/libata-scsi.c +9 −0
  54. drivers/crypto/intel/iaa/iaa_crypto_main.c +7 −3
  55. drivers/cxl/Kconfig +0 −13
  56. drivers/dma-buf/st-dma-fence-chain.c +3 −3
  57. drivers/dpll/Kconfig +1 −1
  58. drivers/firmware/efi/libstub/randomalloc.c +1 −1
  59. drivers/firmware/efi/libstub/x86-stub.c +1 −0
  60. drivers/gpio/gpiolib-cdev.c +32 −6
  61. drivers/gpio/gpiolib.c +18 −14
  62. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 −0
  63. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 −0
  64. drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +29 −17
  65. drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c +10 −2
  66. drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h +10 −10
  67. drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +6 −0
  68. drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c +5 −2
  69. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 −2
  70. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c +2 −1
  71. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c +2 −1
  72. drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c +2 −1
  73. drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 −1
  74. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 −5
  75. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +5 −3
  76. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h +1 −1
  77. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +6 −1
  78. drivers/gpu/drm/amd/display/dc/core/dc.c +4 −2
  79. drivers/gpu/drm/amd/display/dc/dce110/Makefile +1 −1
  80. drivers/gpu/drm/amd/display/dc/dce112/Makefile +1 −1
  81. drivers/gpu/drm/amd/display/dc/dce120/Makefile +1 −1
  82. drivers/gpu/drm/amd/display/dc/dce60/Makefile +1 −1
  83. drivers/gpu/drm/amd/display/dc/dce80/Makefile +1 −1
  84. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c +32 −22
  85. drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h +7 −7
  86. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c +2 −3
  87. drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c +2 −2
  88. drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c +84 −19
  89. drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +1 −5
  90. drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +2 −1
  91. drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c +0 −41
  92. drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +0 −41
  93. drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +0 −41
  94. drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c +1 −1
  95. drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c +8 −3
  96. drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +5 −8
  97. drivers/gpu/drm/amd/include/umsch_mm_4_0_api_def.h +11 −2
  98. drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v14_0_0_ppsmc.h +14 −14
  99. drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +10 −0
  100. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +44 −6
  101. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +14 −7
  102. drivers/gpu/drm/display/drm_dp_helper.c +7 −0
  103. drivers/gpu/drm/i915/Makefile +3 −3
  104. drivers/gpu/drm/i915/display/g4x_dp.c +0 −2
  105. drivers/gpu/drm/i915/display/icl_dsi.c +2 −1
  106. drivers/gpu/drm/i915/display/intel_bios.c +40 −6
  107. drivers/gpu/drm/i915/display/intel_cursor.c +1 −3
  108. drivers/gpu/drm/i915/display/intel_display_types.h +1 −0
  109. drivers/gpu/drm/i915/display/intel_dp.c +2 −10
  110. drivers/gpu/drm/i915/display/intel_dpll_mgr.c +1 −1
  111. drivers/gpu/drm/i915/display/intel_drrs.c +11 −3
  112. drivers/gpu/drm/i915/display/intel_drrs.h +3 −0
  113. drivers/gpu/drm/i915/display/intel_dsb.c +14 −0
  114. drivers/gpu/drm/i915/display/intel_fb_pin.c +10 −0
  115. drivers/gpu/drm/i915/display/intel_sdvo.c +0 −4
  116. drivers/gpu/drm/i915/display/intel_vrr.c +4 −3
  117. drivers/gpu/drm/i915/display/skl_universal_plane.c +3 −0
  118. drivers/gpu/drm/i915/gt/intel_engine_pm.c +0 −3
  119. drivers/gpu/drm/i915/gt/intel_execlists_submission.c +3 −0
  120. drivers/gpu/drm/i915/gt/intel_workarounds.c +1 −0
  121. drivers/gpu/drm/i915/i915_driver.c +1 −1
  122. drivers/gpu/drm/i915/i915_hwmon.c +19 −18
  123. drivers/gpu/drm/i915/i915_memcpy.c +2 −0
  124. drivers/gpu/drm/i915/i915_reg.h +1 −1
  125. drivers/gpu/drm/i915/i915_vma.c +43 −7
  126. drivers/gpu/drm/nouveau/nouveau_dmem.c +6 −6
  127. drivers/gpu/drm/qxl/qxl_cmd.c +0 −2
  128. drivers/gpu/drm/qxl/qxl_ioctl.c +1 −3
  129. drivers/gpu/drm/rockchip/rockchip_vop2_reg.c +0 −2
  130. drivers/gpu/drm/scheduler/sched_entity.c +9 −3
  131. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +9 −6
  132. drivers/gpu/drm/xe/Makefile +2 −2
  133. drivers/gpu/drm/xe/xe_bo.c +9 −50
  134. drivers/gpu/drm/xe/xe_bo_types.h +0 −19
  135. drivers/gpu/drm/xe/xe_device.h +2 −2
  136. drivers/gpu/drm/xe/xe_exec_queue.c +1 −1
  137. drivers/gpu/drm/xe/xe_guc_submit.c +1 −1
  138. drivers/gpu/drm/xe/xe_lrc.c +9 −11
  139. drivers/gpu/drm/xe/xe_query.c +1 −1
  140. drivers/i2c/busses/i2c-i801.c +4 −3
  141. drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +25 −13
  142. drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +2 −0
  143. drivers/iommu/iommu.c +10 −1
  144. drivers/irqchip/irq-armada-370-xp.c +1 −1
  145. drivers/md/dm-integrity.c +1 −1
  146. drivers/md/dm-vdo/murmurhash3.c +8 −25
  147. drivers/mmc/core/block.c +2 −2
  148. drivers/mmc/host/sdhci-of-dwcmshc.c +17 −11
  149. drivers/mmc/host/sdhci-omap.c +3 −0
  150. drivers/net/dsa/mt7530.c +3 −2
  151. drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +20 −23
  152. drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c +1 −1
  153. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +17 −2
  154. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +4 −0
  155. drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +2 −1
  156. drivers/net/ethernet/intel/ice/ice_lag.c +2 −2
  157. drivers/net/ethernet/intel/ice/ice_lib.c +9 −9
  158. drivers/net/ethernet/intel/ice/ice_switch.c +14 −10
  159. drivers/net/ethernet/intel/ice/ice_switch.h +2 −2
  160. drivers/net/ethernet/intel/igc/igc_main.c +0 −4
  161. drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +8 −8
  162. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +5 −0
  163. drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +14 −7
  164. drivers/net/ethernet/microchip/lan743x_main.c +18 −0
  165. drivers/net/ethernet/microchip/lan743x_main.h +4 −0
  166. drivers/net/ethernet/renesas/sh_eth.c +1 −1
  167. drivers/net/ethernet/xilinx/ll_temac_main.c +1 −1
  168. drivers/net/phy/qcom/at803x.c +3 −1
  169. drivers/net/wireless/intel/iwlwifi/fw/dbg.c +8 −7
  170. drivers/net/wireless/intel/iwlwifi/mvm/d3.c +9 −7
  171. drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +7 −4
  172. drivers/net/wireless/intel/iwlwifi/mvm/link.c +45 −14
  173. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +8 −1
  174. drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +6 −1
  175. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +4 −0
  176. drivers/net/wireless/intel/iwlwifi/mvm/rfi.c +6 −2
  177. drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +8 −12
  178. drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +2 −3
  179. drivers/net/wireless/intel/iwlwifi/queue/tx.c +1 −1
  180. drivers/net/wireless/realtek/rtw89/rtw8922a.c +1 −1
  181. drivers/net/wwan/t7xx/t7xx_cldma.c +2 −2
  182. drivers/net/wwan/t7xx/t7xx_hif_cldma.c +5 −4
  183. drivers/net/wwan/t7xx/t7xx_pcie_mac.c +4 −4
  184. drivers/pinctrl/aspeed/Makefile +1 −1
  185. drivers/pinctrl/pinctrl-amd.c +1 −1
  186. drivers/pwm/pwm-img.c +2 −2
  187. drivers/ras/amd/fmpm.c +39 −18
  188. drivers/ras/debugfs.h +4 −0
  189. drivers/s390/net/qeth_core_main.c +36 −2
  190. drivers/scsi/bnx2fc/bnx2fc_tgt.c +0 −2
  191. drivers/scsi/ch.c +10 −10
  192. drivers/scsi/cxlflash/main.c +10 −7
  193. drivers/scsi/hosts.c +4 −3
  194. drivers/scsi/libsas/sas_expander.c +34 −17
  195. drivers/scsi/lpfc/lpfc.h +1 −1
  196. drivers/scsi/lpfc/lpfc_attr.c +2 −2
  197. drivers/scsi/lpfc/lpfc_bsg.c +20 −20
  198. drivers/scsi/lpfc/lpfc_debugfs.c +6 −6
  199. drivers/scsi/lpfc/lpfc_els.c +21 −24
  200. drivers/scsi/lpfc/lpfc_hbadisc.c +16 −17
  201. drivers/scsi/lpfc/lpfc_init.c +8 −5
  202. drivers/scsi/lpfc/lpfc_mbox.c +10 −20
  203. drivers/scsi/lpfc/lpfc_nportdisc.c +6 −6
  204. drivers/scsi/lpfc/lpfc_nvme.c +2 −2
  205. drivers/scsi/lpfc/lpfc_nvmet.c +1 −1
  206. drivers/scsi/lpfc/lpfc_scsi.c +4 −19
  207. drivers/scsi/lpfc/lpfc_sli.c +49 −50
  208. drivers/scsi/lpfc/lpfc_sli.h +24 −6
  209. drivers/scsi/lpfc/lpfc_sli4.h +4 −3
  210. drivers/scsi/lpfc/lpfc_version.h +1 −1
  211. drivers/scsi/lpfc/lpfc_vport.c +5 −5
  212. drivers/scsi/mpi3mr/mpi3mr_app.c +1 −1
  213. drivers/scsi/pmcraid.c +11 −9
  214. drivers/scsi/qla2xxx/qla_attr.c +12 −2
  215. drivers/scsi/qla2xxx/qla_def.h +1 −1
  216. drivers/scsi/qla2xxx/qla_gbl.h +1 −1
  217. drivers/scsi/qla2xxx/qla_init.c +65 −63
  218. drivers/scsi/qla2xxx/qla_iocb.c +44 −24
  219. drivers/scsi/qla2xxx/qla_mbx.c +1 −1
  220. drivers/scsi/qla2xxx/qla_os.c +2 −1
  221. drivers/scsi/qla2xxx/qla_target.c +10 −0
  222. drivers/scsi/qla2xxx/qla_version.h +2 −2
  223. drivers/scsi/scsi_scan.c +34 −0
  224. drivers/scsi/sd.c +19 −4
  225. drivers/scsi/sg.c +12 −10
  226. drivers/scsi/st.c +2 −2
  227. drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +3 −2
  228. drivers/target/iscsi/iscsi_target_erl1.c +1 −2
  229. drivers/thermal/devfreq_cooling.c +1 −1
  230. drivers/thermal/thermal_trip.c +2 −17
  231. drivers/ufs/core/ufs-mcq.c +1 −1
  232. drivers/ufs/host/ufs-qcom.c +4 −2
  233. drivers/uio/uio.c +1 −1
  234. drivers/uio/uio_dmem_genirq.c +2 −2
  235. drivers/uio/uio_pruss.c +1 −1
  236. drivers/usb/class/cdc-wdm.c +5 −1
  237. drivers/usb/core/hub.c +16 −7
  238. drivers/usb/core/hub.h +2 −0
  239. drivers/usb/core/port.c +34 −4
  240. drivers/usb/core/sysfs.c +13 −3
  241. drivers/usb/dwc2/core.h +14 −0
  242. drivers/usb/dwc2/core_intr.c +48 −24
  243. drivers/usb/dwc2/gadget.c +10 −0
  244. drivers/usb/dwc2/hcd.c +40 −9
  245. drivers/usb/dwc2/hcd_ddma.c +11 −6
  246. drivers/usb/dwc2/hw.h +1 −1
  247. drivers/usb/dwc2/platform.c +1 −1
  248. drivers/usb/dwc3/core.c +2 −0
  249. drivers/usb/dwc3/core.h +2 −0
  250. drivers/usb/dwc3/dwc3-pci.c +0 −2
  251. drivers/usb/dwc3/gadget.c +10 −0
  252. drivers/usb/dwc3/host.c +11 −0
  253. drivers/usb/gadget/udc/core.c +3 −1
  254. drivers/usb/misc/usb-ljca.c +9 −13
  255. drivers/usb/phy/phy-generic.c +0 −7
  256. drivers/usb/storage/uas.c +13 −15
  257. drivers/usb/typec/class.c +6 −1
  258. drivers/usb/typec/tcpm/tcpm.c +3 −3
  259. drivers/usb/typec/ucsi/ucsi.c +72 −18
  260. drivers/usb/typec/ucsi/ucsi.h +3 −2
  261. drivers/usb/typec/ucsi/ucsi_acpi.c +33 −42
  262. drivers/usb/typec/ucsi/ucsi_glink.c +14 −0
  263. drivers/video/fbdev/Kconfig +3 −0
  264. fs/9p/vfs_inode.c +10 −6
  265. fs/9p/vfs_inode_dotl.c +1 −5
  266. fs/binfmt_elf_fdpic.c +1 −1
  267. fs/btrfs/block-group.c +2 −1
  268. fs/btrfs/extent_io.c +13 −0
  269. fs/btrfs/extent_map.c +8 −8
  270. fs/btrfs/scrub.c +11 −1
  271. fs/btrfs/volumes.c +22 −5
  272. fs/btrfs/zoned.c +7 −7
  273. fs/erofs/super.c +0 −1
  274. fs/exec.c +1 −0
  275. fs/gfs2/bmap.c +3 −2
  276. fs/nfsd/nfs4state.c +25 −11
  277. fs/nfsd/vfs.c +2 −1
  278. fs/proc/Makefile +1 −1
  279. fs/smb/client/dir.c +7 −0
  280. fs/smb/client/fscache.c +15 −1
  281. fs/smb/client/inode.c +2 −0
  282. fs/smb/client/trace.h +3 −1
  283. fs/xfs/libxfs/xfs_sb.c +31 −9
  284. fs/xfs/libxfs/xfs_sb.h +3 −2
  285. fs/xfs/scrub/common.c +1 −3
  286. fs/xfs/xfs_aops.c +0 −7
  287. fs/xfs/xfs_icache.c +5 −3
  288. fs/xfs/xfs_trans.h +1 −8
  289. include/asm-generic/export.h +0 −11
  290. include/linux/framer/framer.h +2 −2
  291. include/linux/gpio/driver.h +15 −2
  292. include/linux/interrupt.h +3 −0
  293. include/linux/libata.h +1 −0
  294. include/linux/mman.h +8 −0
  295. include/linux/oid_registry.h +4 −0
  296. include/linux/pagevec.h +2 −2
  297. include/linux/skbuff.h +1 −6
  298. include/net/cfg80211.h +2 −0
  299. include/net/inet_connection_sock.h +1 −0
  300. include/net/sock.h +7 −0
  301. include/net/xdp_sock.h +2 −0
  302. include/scsi/scsi_driver.h +1 −0
  303. include/scsi/scsi_host.h +1 −0
  304. include/sound/intel-nhlt.h +10 −0
  305. include/uapi/linux/kfd_ioctl.h +14 −3
  306. include/uapi/scsi/scsi_bsg_mpi3mr.h +1 −1
  307. include/ufs/ufshcd.h +1 −0
  308. init/initramfs.c +1 −1
  309. kernel/bpf/Makefile +1 −1
  310. kernel/bpf/arena.c +18 −7
  311. kernel/bpf/bloom_filter.c +13 −0
  312. kernel/bpf/helpers.c +1 −1
  313. kernel/bpf/verifier.c +24 −3
  314. kernel/crash_reserve.c +7 −0
  315. kernel/irq/manage.c +7 −2
  316. kernel/module/Kconfig +5 −0
  317. kernel/printk/printk.c +6 −0
  318. kernel/sys.c +5 −2
  319. kernel/time/posix-clock.c +9 −7
  320. kernel/trace/trace_probe.c +1 −1
  321. mm/Makefile +1 −2
  322. mm/filemap.c +16 −0
  323. mm/gup.c +8 −6
  324. mm/memory.c +3 −1
  325. mm/page_owner.c +23 −10
  326. mm/shmem_quota.c +7 −3
  327. mm/userfaultfd.c +2 −1
  328. mm/zswap.c +39 −6
  329. net/core/sock.c +2 −2
  330. net/hsr/hsr_slave.c +2 −1
  331. net/ipv4/inet_connection_sock.c +14 −0
  332. net/ipv4/inet_fragment.c +57 −13
  333. net/ipv4/ip_fragment.c +1 −1
  334. net/ipv4/netfilter/Kconfig +1 −0
  335. net/ipv4/nexthop.c +3 −1
  336. net/ipv4/tcp.c +2 −0
  337. net/ipv6/addrconf.c +3 −2
  338. net/ipv6/netfilter/nf_conntrack_reasm.c +1 −1
  339. net/mac80211/cfg.c +2 −3
  340. net/mac80211/debug.h +1 −1
  341. net/mac80211/ieee80211_i.h +2 −2
  342. net/mac80211/mlme.c +12 −3
  343. net/netfilter/nf_tables_api.c +42 −8
  344. net/nfc/nci/core.c +5 −0
  345. net/sunrpc/auth_gss/gss_krb5_crypto.c +8 −6
  346. net/tls/tls_sw.c +5 −2
  347. net/wireless/trace.h +1 −1
  348. net/wireless/wext-core.c +5 −2
  349. scripts/Makefile.extrawarn +3 −7
  350. scripts/Makefile.modfinal +1 −1
  351. scripts/bpf_doc.py +2 −2
  352. scripts/kconfig/conf.c +0 −5
  353. scripts/kconfig/lkc.h +1 −1
  354. scripts/kconfig/lxdialog/checklist.c +1 −1
  355. scripts/kconfig/lxdialog/dialog.h +6 −6
  356. scripts/kconfig/lxdialog/inputbox.c +1 −1
  357. scripts/kconfig/lxdialog/menubox.c +1 −1
  358. scripts/kconfig/lxdialog/textbox.c +1 −1
  359. scripts/kconfig/lxdialog/util.c +1 −1
  360. scripts/kconfig/lxdialog/yesno.c +1 −1
  361. scripts/kconfig/mconf.c +2 −2
  362. scripts/kconfig/menu.c +16 −6
  363. scripts/kconfig/parser.y +1 −1
  364. scripts/mod/modpost.c +5 −2
  365. sound/aoa/soundbus/i2sbus/core.c +1 −1
  366. sound/hda/intel-nhlt.c +26 −0
  367. sound/pci/hda/cs35l56_hda.c +4 −4
  368. sound/pci/hda/tas2781_hda_i2c.c +77 −41
  369. sound/sh/aica.c +14 −3
  370. sound/soc/intel/avs/avs.h +1 −0
  371. sound/soc/intel/avs/cldma.c +1 −1
  372. sound/soc/intel/avs/core.c +2 −2
  373. sound/soc/intel/avs/icl.c +9 −3
  374. sound/soc/intel/avs/loader.c +4 −2
  375. sound/soc/intel/avs/messages.h +45 −2
  376. sound/soc/intel/avs/path.c +5 −8
  377. sound/soc/intel/avs/pcm.c +33 −1
  378. sound/soc/intel/avs/probes.c +9 −5
  379. sound/soc/sof/ipc4-topology.c +16 −3
  380. tools/Makefile +6 −7
  381. tools/bpf/bpftool/gen.c +1 −1
  382. tools/lib/bpf/libbpf.c +7 −3
  383. tools/net/ynl/ynl-gen-c.py +5 −2
  384. tools/objtool/check.c +1 −1
  385. tools/testing/kunit/configs/all_tests.config +3 −0
  386. tools/testing/selftests/bpf/bpf_arena_common.h +1 −1
  387. tools/testing/selftests/bpf/prog_tests/arena_htab.c +5 −3
  388. tools/testing/selftests/bpf/prog_tests/arena_list.c +5 −2
  389. tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c +6 −0
  390. tools/testing/selftests/bpf/prog_tests/verifier.c +2 −0
  391. tools/testing/selftests/bpf/progs/arena_htab.c +1 −1
  392. tools/testing/selftests/bpf/progs/arena_list.c +5 −5
  393. tools/testing/selftests/bpf/progs/verifier_arena.c +7 −3
  394. tools/testing/selftests/bpf/progs/verifier_arena_large.c +68 −0
  395. tools/testing/selftests/dmabuf-heaps/config +3 −0
  396. tools/testing/selftests/drivers/net/netdevsim/settings +1 −0
  397. tools/testing/selftests/exec/Makefile +2 −2
  398. tools/testing/selftests/exec/binfmt_script.py +9 −1
  399. tools/testing/selftests/exec/execveat.c +7 −5
  400. tools/testing/selftests/exec/load_address.c +15 −19
  401. tools/testing/selftests/exec/recursion-depth.c +26 −27
  402. tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc +1 −1
  403. tools/testing/selftests/mm/gup_test.c +1 −1
  404. tools/testing/selftests/mm/protection_keys.c +5 −1
  405. tools/testing/selftests/mm/soft-dirty.c +1 −1
  406. tools/testing/selftests/mm/split_huge_page_test.c +1 −1
  407. tools/testing/selftests/mm/uffd-common.c +3 −0
  408. tools/testing/selftests/mm/uffd-common.h +2 −0
  409. tools/testing/selftests/mm/uffd-unit-tests.c +12 −1
  410. tools/testing/selftests/net/test_vxlan_mdb.sh +128 −77
  411. tools/testing/selftests/net/tls.c +34 −0
  412. tools/testing/selftests/seccomp/settings +1 −1
.mailmap+4−2
@@ -340,7 +340,8 @@ Lee Jones <lee@kernel.org> <joneslee@google.com> · 339 unmodified lines
340340 Lee Jones <lee@kernel.org> <lee.jones@canonical.com>
341341 Lee Jones <lee@kernel.org> <lee.jones@linaro.org>
342342 Lee Jones <lee@kernel.org> <lee@ubuntu.com>
343−Leonard Crestez <leonard.crestez@nxp.com> Leonard Crestez <cdleonard@gmail.com>
343+Leonard Crestez <cdleonard@gmail.com> <leonard.crestez@nxp.com>
344+Leonard Crestez <cdleonard@gmail.com> <leonard.crestez@intel.com>
344345 Leonardo Bras <leobras.c@gmail.com> <leonardo@linux.ibm.com>
345346 Leonard Göhrs <l.goehrs@pengutronix.de>
346347 Leonid I Ananiev <leonid.i.ananiev@intel.com>
@@ -497,7 +498,8 @@ Prasad Sodagudi <quic_psodagud@quicinc.com> <psodagud@codeaurora.org> · 150 unmodified lines
497498 Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com>
498499 Qais Yousef <qyousef@layalina.io> <qais.yousef@imgtec.com>
499500 Qais Yousef <qyousef@layalina.io> <qais.yousef@arm.com>
500−Quentin Monnet <quentin@isovalent.com> <quentin.monnet@netronome.com>
501+Quentin Monnet <qmo@kernel.org> <quentin.monnet@netronome.com>
502+Quentin Monnet <qmo@kernel.org> <quentin@isovalent.com>
501503 Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com>
502504 Rafael J. Wysocki <rjw@rjwysocki.net> <rjw@sisk.pl>
503505 Rajeev Nandan <quic_rajeevny@quicinc.com> <rajeevny@codeaurora.org>
Documentation/arch/x86/resctrl.rst+1−1
@@ -574,7 +574,7 @@ Memory b/w domain is L3 cache. · 573 unmodified lines
574574 MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;...
575575
576576 Memory bandwidth Allocation specified in MiBps
577−---------------------------------------------
577+----------------------------------------------
578578
579579 Memory bandwidth domain is L3 cache.
580580 ::
Documentation/kbuild/llvm.rst+1−1
@@ -178,7 +178,7 @@ yet. Bug reports are always welcome at the issue tracker below! · 177 unmodified lines
178178 - ``LLVM=1``
179179 * - s390
180180 - Maintained
181− - ``CC=clang``
181+ - ``LLVM=1`` (LLVM >= 18.1.0), ``CC=clang`` (LLVM < 18.1.0)
182182 * - um (User Mode)
183183 - Maintained
184184 - ``LLVM=1``
MAINTAINERS+61−17
@@ -3942,8 +3942,7 @@ F: kernel/bpf/ringbuf.c · 3941 unmodified lines
39423942
39433943 BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
39443944 M: KP Singh <kpsingh@kernel.org>
3945−R: Florent Revest <revest@chromium.org>
3946−R: Brendan Jackman <jackmanb@chromium.org>
3945+R: Matt Bobrowski <mattbobrowski@google.com>
39473946 L: bpf@vger.kernel.org
39483947 S: Maintained
39493948 F: Documentation/bpf/prog_lsm.rst
@@ -3968,7 +3967,7 @@ F: kernel/bpf/bpf_lru* · 18 unmodified lines
39683967 F: kernel/bpf/cgroup.c
39693968
39703969 BPF [TOOLING] (bpftool)
3971−M: Quentin Monnet <quentin@isovalent.com>
3970+M: Quentin Monnet <qmo@kernel.org>
39723971 L: bpf@vger.kernel.org
39733972 S: Maintained
39743973 F: kernel/bpf/disasm.*
@@ -6157,7 +6156,6 @@ DEVICE-MAPPER (LVM) · 2182 unmodified lines
61576156 M: Alasdair Kergon <agk@redhat.com>
61586157 M: Mike Snitzer <snitzer@kernel.org>
61596158 M: Mikulas Patocka <mpatocka@redhat.com>
6160−M: dm-devel@lists.linux.dev
61616159 L: dm-devel@lists.linux.dev
61626160 S: Maintained
61636161 Q: http://patchwork.kernel.org/project/dm-devel/list/
@@ -6173,7 +6171,6 @@ F: include/uapi/linux/dm-*.h · 9 unmodified lines
61736171
61746172 DEVICE-MAPPER VDO TARGET
61756173 M: Matthew Sakai <msakai@redhat.com>
6176−M: dm-devel@lists.linux.dev
61776174 L: dm-devel@lists.linux.dev
61786175 S: Maintained
61796176 F: Documentation/admin-guide/device-mapper/vdo*.rst
@@ -7941,6 +7938,7 @@ M: Gao Xiang <xiang@kernel.org> · 1761 unmodified lines
79417938 M: Chao Yu <chao@kernel.org>
79427939 R: Yue Hu <huyue2@coolpad.com>
79437940 R: Jeffle Xu <jefflexu@linux.alibaba.com>
7941+R: Sandeep Dhavale <dhavale@google.com>
79447942 L: linux-erofs@lists.ozlabs.org
79457943 S: Maintained
79467944 W: https://erofs.docs.kernel.org
@@ -9653,7 +9651,9 @@ L: linux-input@vger.kernel.org · 1706 unmodified lines
96539651 S: Maintained
96549652 F: drivers/hid/hid-logitech-hidpp.c
96559653
9656−HIGH-RESOLUTION TIMERS, CLOCKEVENTS
9654+HIGH-RESOLUTION TIMERS, TIMER WHEEL, CLOCKEVENTS
9655+M: Anna-Maria Behnsen <anna-maria@linutronix.de>
9656+M: Frederic Weisbecker <frederic@kernel.org>
96579657 M: Thomas Gleixner <tglx@linutronix.de>
96589658 L: linux-kernel@vger.kernel.org
96599659 S: Maintained
@@ -9661,9 +9661,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core · 1 unmodified line
96619661 F: Documentation/timers/
96629662 F: include/linux/clockchips.h
96639663 F: include/linux/hrtimer.h
9664+F: include/linux/timer.h
96649665 F: kernel/time/clockevents.c
96659666 F: kernel/time/hrtimer.c
9666−F: kernel/time/timer_*.c
9667+F: kernel/time/timer.c
9668+F: kernel/time/timer_list.c
9669+F: kernel/time/timer_migration.*
9670+F: tools/testing/selftests/timers/
96679671
96689672 HIGH-SPEED SCC DRIVER FOR AX.25
96699673 L: linux-hams@vger.kernel.org
@@ -13134,6 +13138,7 @@ F: drivers/net/ethernet/marvell/mvpp2/ · 3464 unmodified lines
1313413138
1313513139 MARVELL MWIFIEX WIRELESS DRIVER
1313613140 M: Brian Norris <briannorris@chromium.org>
13141+R: Francesco Dolcini <francesco@dolcini.it>
1313713142 L: linux-wireless@vger.kernel.org
1313813143 S: Odd Fixes
1313913144 F: drivers/net/wireless/marvell/mwifiex/
@@ -15627,9 +15632,10 @@ F: drivers/misc/nsm.c · 2487 unmodified lines
1562715632 F: include/uapi/linux/nsm.h
1562815633
1562915634 NOHZ, DYNTICKS SUPPORT
15635+M: Anna-Maria Behnsen <anna-maria@linutronix.de>
1563015636 M: Frederic Weisbecker <frederic@kernel.org>
15631−M: Thomas Gleixner <tglx@linutronix.de>
1563215637 M: Ingo Molnar <mingo@kernel.org>
15638+M: Thomas Gleixner <tglx@linutronix.de>
1563315639 L: linux-kernel@vger.kernel.org
1563415640 S: Maintained
1563515641 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/nohz
@@ -17590,15 +17596,20 @@ F: drivers/pnp/ · 1954 unmodified lines
1759017596 F: include/linux/pnp.h
1759117597
1759217598 POSIX CLOCKS and TIMERS
17599+M: Anna-Maria Behnsen <anna-maria@linutronix.de>
17600+M: Frederic Weisbecker <frederic@kernel.org>
1759317601 M: Thomas Gleixner <tglx@linutronix.de>
1759417602 L: linux-kernel@vger.kernel.org
1759517603 S: Maintained
1759617604 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
1759717605 F: fs/timerfd.c
1759817606 F: include/linux/time_namespace.h
17599−F: include/linux/timer*
17607+F: include/linux/timerfd.h
17608+F: include/uapi/linux/time.h
17609+F: include/uapi/linux/timerfd.h
1760017610 F: include/trace/events/timer*
17601−F: kernel/time/*timer*
17611+F: kernel/time/itimer.c
17612+F: kernel/time/posix-*
1760217613 F: kernel/time/namespace.c
1760317614
1760417615 POWER MANAGEMENT CORE
@@ -18645,18 +18656,21 @@ REALTEK WIRELESS DRIVER (rtlwifi family) · 1040 unmodified lines
1864518656 M: Ping-Ke Shih <pkshih@realtek.com>
1864618657 L: linux-wireless@vger.kernel.org
1864718658 S: Maintained
18659+T: git https://github.com/pkshih/rtw.git
1864818660 F: drivers/net/wireless/realtek/rtlwifi/
1864918661
1865018662 REALTEK WIRELESS DRIVER (rtw88)
1865118663 M: Ping-Ke Shih <pkshih@realtek.com>
1865218664 L: linux-wireless@vger.kernel.org
1865318665 S: Maintained
18666+T: git https://github.com/pkshih/rtw.git
1865418667 F: drivers/net/wireless/realtek/rtw88/
1865518668
1865618669 REALTEK WIRELESS DRIVER (rtw89)
1865718670 M: Ping-Ke Shih <pkshih@realtek.com>
1865818671 L: linux-wireless@vger.kernel.org
1865918672 S: Maintained
18673+T: git https://github.com/pkshih/rtw.git
1866018674 F: drivers/net/wireless/realtek/rtw89/
1866118675
1866218676 REDPINE WIRELESS DRIVER
@@ -18727,13 +18741,24 @@ S: Supported · 64 unmodified lines
1872718741 F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
1872818742 F: drivers/i2c/busses/i2c-emev2.c
1872918743
18730−RENESAS ETHERNET DRIVERS
18744+RENESAS ETHERNET AVB DRIVER
1873118745 R: Sergey Shtylyov <s.shtylyov@omp.ru>
1873218746 L: netdev@vger.kernel.org
1873318747 L: linux-renesas-soc@vger.kernel.org
18734−F: Documentation/devicetree/bindings/net/renesas,*.yaml
18735−F: drivers/net/ethernet/renesas/
18736−F: include/linux/sh_eth.h
18748+F: Documentation/devicetree/bindings/net/renesas,etheravb.yaml
18749+F: drivers/net/ethernet/renesas/Kconfig
18750+F: drivers/net/ethernet/renesas/Makefile
18751+F: drivers/net/ethernet/renesas/ravb*
18752+
18753+RENESAS ETHERNET SWITCH DRIVER
18754+R: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
18755+L: netdev@vger.kernel.org
18756+L: linux-renesas-soc@vger.kernel.org
18757+F: Documentation/devicetree/bindings/net/renesas,*ether-switch.yaml
18758+F: drivers/net/ethernet/renesas/Kconfig
18759+F: drivers/net/ethernet/renesas/Makefile
18760+F: drivers/net/ethernet/renesas/rcar_gen4*
18761+F: drivers/net/ethernet/renesas/rswitch*
1873718762
1873818763 RENESAS IDT821034 ASoC CODEC
1873918764 M: Herve Codina <herve.codina@bootlin.com>
@@ -18843,6 +18868,16 @@ S: Supported · 103 unmodified lines
1884318868 F: Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml
1884418869 F: drivers/i2c/busses/i2c-rzv2m.c
1884518870
18871+RENESAS SUPERH ETHERNET DRIVER
18872+R: Sergey Shtylyov <s.shtylyov@omp.ru>
18873+L: netdev@vger.kernel.org
18874+L: linux-renesas-soc@vger.kernel.org
18875+F: Documentation/devicetree/bindings/net/renesas,ether.yaml
18876+F: drivers/net/ethernet/renesas/Kconfig
18877+F: drivers/net/ethernet/renesas/Makefile
18878+F: drivers/net/ethernet/renesas/sh_eth*
18879+F: include/linux/sh_eth.h
18880+
1884618881 RENESAS USB PHY DRIVER
1884718882 M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
1884818883 L: linux-renesas-soc@vger.kernel.org
@@ -19186,12 +19221,14 @@ M: Hin-Tak Leung <hintak.leung@gmail.com> · 337 unmodified lines
1918619221 M: Larry Finger <Larry.Finger@lwfinger.net>
1918719222 L: linux-wireless@vger.kernel.org
1918819223 S: Maintained
19224+T: git https://github.com/pkshih/rtw.git
1918919225 F: drivers/net/wireless/realtek/rtl818x/rtl8187/
1919019226
1919119227 RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
1919219228 M: Jes Sorensen <Jes.Sorensen@gmail.com>
1919319229 L: linux-wireless@vger.kernel.org
1919419230 S: Maintained
19231+T: git https://github.com/pkshih/rtw.git
1919519232 F: drivers/net/wireless/realtek/rtl8xxxu/
1919619233
1919719234 RTRS TRANSPORT DRIVERS
@@ -22261,13 +22298,20 @@ S: Supported · 3063 unmodified lines
2226122298 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
2226222299 F: include/linux/clocksource.h
2226322300 F: include/linux/time.h
22301+F: include/linux/timekeeper_internal.h
22302+F: include/linux/timekeeping.h
2226422303 F: include/linux/timex.h
2226522304 F: include/uapi/linux/time.h
2226622305 F: include/uapi/linux/timex.h
2226722306 F: kernel/time/alarmtimer.c
22268−F: kernel/time/clocksource.c
22269−F: kernel/time/ntp.c
22270−F: kernel/time/time*.c
22307+F: kernel/time/clocksource*
22308+F: kernel/time/ntp*
22309+F: kernel/time/time.c
22310+F: kernel/time/timeconst.bc
22311+F: kernel/time/timeconv.c
22312+F: kernel/time/timecounter.c
22313+F: kernel/time/timekeeping*
22314+F: kernel/time/time_test.c
2227122315 F: tools/testing/selftests/timers/
2227222316
2227322317 TIPC NETWORK LAYER
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 6
33 PATCHLEVEL = 9
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc2
66 NAME = Hurr durr I'ma ninja sloth
77
88 # *DOCUMENTATION*
arch/arm/include/asm/mman.h+14−0
@@ -0,0 +1,14 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __ASM_MMAN_H__
3+#define __ASM_MMAN_H__
4+
5+#include <asm/system_info.h>
6+#include <uapi/asm/mman.h>
7+
8+static inline bool arch_memory_deny_write_exec_supported(void)
9+{
10+ return cpu_architecture() >= CPU_ARCH_ARMv6;
11+}
12+#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
13+
14+#endif /* __ASM_MMAN_H__ */
arch/arm64/net/bpf_jit_comp.c+2−2
@@ -943,7 +943,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, · 942 unmodified lines
943943 emit(A64_UXTH(is64, dst, dst), ctx);
944944 break;
945945 case 32:
946− emit(A64_REV32(is64, dst, dst), ctx);
946+ emit(A64_REV32(0, dst, dst), ctx);
947947 /* upper 32 bits already cleared */
948948 break;
949949 case 64:
@@ -1256,7 +1256,7 @@ emit_cond_jmp: · 306 unmodified lines
12561256 } else {
12571257 emit_a64_mov_i(1, tmp, off, ctx);
12581258 if (sign_extend)
1259− emit(A64_LDRSW(dst, src_adj, off_adj), ctx);
1259+ emit(A64_LDRSW(dst, src, tmp), ctx);
12601260 else
12611261 emit(A64_LDR32(dst, src, tmp), ctx);
12621262 }
arch/hexagon/kernel/vmlinux.lds.S+1−0
@@ -63,6 +63,7 @@ SECTIONS · 62 unmodified lines
6363 STABS_DEBUG
6464 DWARF_DEBUG
6565 ELF_DETAILS
66+ .hexagon.attributes 0 : { *(.hexagon.attributes) }
6667
6768 DISCARDS
6869 }
arch/mips/Kconfig+9−9
@@ -619,15 +619,6 @@ config MACH_EYEQ5 · 618 unmodified lines
619619
620620 bool
621621
622−config FIT_IMAGE_FDT_EPM5
623− bool "Include FDT for Mobileye EyeQ5 development platforms"
624− depends on MACH_EYEQ5
625− default n
626− help
627− Enable this to include the FDT for the EyeQ5 development platforms
628− from Mobileye in the FIT kernel image.
629− This requires u-boot on the platform.
630−
631622 config MACH_NINTENDO64
632623 bool "Nintendo 64 console"
633624 select CEVT_R4K
@@ -1011,6 +1002,15 @@ config CAVIUM_OCTEON_SOC · 377 unmodified lines
10111002
10121003 endchoice
10131004
1005+config FIT_IMAGE_FDT_EPM5
1006+ bool "Include FDT for Mobileye EyeQ5 development platforms"
1007+ depends on MACH_EYEQ5
1008+ default n
1009+ help
1010+ Enable this to include the FDT for the EyeQ5 development platforms
1011+ from Mobileye in the FIT kernel image.
1012+ This requires u-boot on the platform.
1013+
10141014 source "arch/mips/alchemy/Kconfig"
10151015 source "arch/mips/ath25/Kconfig"
10161016 source "arch/mips/ath79/Kconfig"
arch/parisc/include/asm/mman.h+14−0
@@ -0,0 +1,14 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __ASM_MMAN_H__
3+#define __ASM_MMAN_H__
4+
5+#include <uapi/asm/mman.h>
6+
7+/* PARISC cannot allow mdwe as it needs writable stacks */
8+static inline bool arch_memory_deny_write_exec_supported(void)
9+{
10+ return false;
11+}
12+#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
13+
14+#endif /* __ASM_MMAN_H__ */
arch/riscv/net/bpf_jit_comp64.c+16−0
@@ -1463,6 +1463,22 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx, · 1462 unmodified lines
14631463 if (ret < 0)
14641464 return ret;
14651465
1466+ if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
1467+ const struct btf_func_model *fm;
1468+ int idx;
1469+
1470+ fm = bpf_jit_find_kfunc_model(ctx->prog, insn);
1471+ if (!fm)
1472+ return -EINVAL;
1473+
1474+ for (idx = 0; idx < fm->nr_args; idx++) {
1475+ u8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx);
1476+
1477+ if (fm->arg_size[idx] == sizeof(int))
1478+ emit_sextw(reg, reg, ctx);
1479+ }
1480+ }
1481+
14661482 ret = emit_call(addr, fixed_addr, ctx);
14671483 if (ret)
14681484 return ret;
arch/s390/net/bpf_jit_comp.c+20−26
@@ -516,11 +516,12 @@ static void bpf_skip(struct bpf_jit *jit, int size) · 515 unmodified lines
516516 * PLT for hotpatchable calls. The calling convention is the same as for the
517517 * ftrace hotpatch trampolines: %r0 is return address, %r1 is clobbered.
518518 */
519−extern const char bpf_plt[];
520−extern const char bpf_plt_ret[];
521−extern const char bpf_plt_target[];
522−extern const char bpf_plt_end[];
523−#define BPF_PLT_SIZE 32
519+struct bpf_plt {
520+ char code[16];
521+ void *ret;
522+ void *target;
523+} __packed;
524+extern const struct bpf_plt bpf_plt;
524525 asm(
525526 ".pushsection .rodata\n"
526527 " .balign 8\n"
@@ -531,15 +532,14 @@ asm( · 4 unmodified lines
531532 " .balign 8\n"
532533 "bpf_plt_ret: .quad 0\n"
533534 "bpf_plt_target: .quad 0\n"
534− "bpf_plt_end:\n"
535535 " .popsection\n"
536536 );
537537
538−static void bpf_jit_plt(void *plt, void *ret, void *target)
538+static void bpf_jit_plt(struct bpf_plt *plt, void *ret, void *target)
539539 {
540− memcpy(plt, bpf_plt, BPF_PLT_SIZE);
541− *(void **)((char *)plt + (bpf_plt_ret - bpf_plt)) = ret;
542− *(void **)((char *)plt + (bpf_plt_target - bpf_plt)) = target ?: ret;
540+ memcpy(plt, &bpf_plt, sizeof(*plt));
541+ plt->ret = ret;
542+ plt->target = target;
543543 }
544544
545545 /*
@@ -662,9 +662,9 @@ static void bpf_jit_epilogue(struct bpf_jit *jit, u32 stack_depth) · 116 unmodified lines
662662 jit->prg = ALIGN(jit->prg, 8);
663663 jit->prologue_plt = jit->prg;
664664 if (jit->prg_buf)
665− bpf_jit_plt(jit->prg_buf + jit->prg,
665+ bpf_jit_plt((struct bpf_plt *)(jit->prg_buf + jit->prg),
666666 jit->prg_buf + jit->prologue_plt_ret, NULL);
667− jit->prg += BPF_PLT_SIZE;
667+ jit->prg += sizeof(struct bpf_plt);
668668 }
669669
670670 static int get_probe_mem_regno(const u8 *insn)
@@ -2040,9 +2040,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) · 1369 unmodified lines
20402040 struct bpf_jit jit;
20412041 int pass;
20422042
2043− if (WARN_ON_ONCE(bpf_plt_end - bpf_plt != BPF_PLT_SIZE))
2044− return orig_fp;
2045−
20462043 if (!fp->jit_requested)
20472044 return orig_fp;
20482045
@@ -2148,14 +2145,11 @@ bool bpf_jit_supports_far_kfunc_call(void) · 99 unmodified lines
21482145 int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
21492146 void *old_addr, void *new_addr)
21502147 {
2148+ struct bpf_plt expected_plt, current_plt, new_plt, *plt;
21512149 struct {
21522150 u16 opc;
21532151 s32 disp;
21542152 } __packed insn;
2155− char expected_plt[BPF_PLT_SIZE];
2156− char current_plt[BPF_PLT_SIZE];
2157− char new_plt[BPF_PLT_SIZE];
2158− char *plt;
21592153 char *ret;
21602154 int err;
21612155
@@ -2174,18 +2168,18 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t, · 12 unmodified lines
21742168 */
21752169 } else {
21762170 /* Verify the PLT. */
2177− plt = (char *)ip + (insn.disp << 1);
2178− err = copy_from_kernel_nofault(current_plt, plt, BPF_PLT_SIZE);
2171+ plt = ip + (insn.disp << 1);
2172+ err = copy_from_kernel_nofault(&current_plt, plt,
2173+ sizeof(current_plt));
21792174 if (err < 0)
21802175 return err;
21812176 ret = (char *)ip + 6;
2182− bpf_jit_plt(expected_plt, ret, old_addr);
2183− if (memcmp(current_plt, expected_plt, BPF_PLT_SIZE))
2177+ bpf_jit_plt(&expected_plt, ret, old_addr);
2178+ if (memcmp(&current_plt, &expected_plt, sizeof(current_plt)))
21842179 return -EINVAL;
21852180 /* Adjust the call address. */
2186− bpf_jit_plt(new_plt, ret, new_addr);
2187− s390_kernel_write(plt + (bpf_plt_target - bpf_plt),
2188− new_plt + (bpf_plt_target - bpf_plt),
2181+ bpf_jit_plt(&new_plt, ret, new_addr);
2182+ s390_kernel_write(&plt->target, &new_plt.target,
21892183 sizeof(void *));
21902184 }
21912185
arch/x86/Kbuild+1−1
@@ -28,7 +28,7 @@ obj-y += net/ · 27 unmodified lines
2828
2929 obj-$(CONFIG_KEXEC_FILE) += purgatory/
3030
31−obj-y += virt/svm/
31+obj-y += virt/
3232
3333 # for cleaning
3434 subdir- += boot tools
arch/x86/Kconfig+2−0
@@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT · 2438 unmodified lines
24392439 # with named address spaces - see GCC PR sanitizer/111736.
24402440 #
24412441 depends on !KASAN
2442+ # -fsanitize=thread (KCSAN) is also incompatible.
2443+ depends on !KCSAN
24422444
24432445 config CC_HAS_SLS
24442446 def_bool $(cc-option,-mharden-sls=all)
arch/x86/Makefile+0−2
@@ -251,8 +251,6 @@ archheaders: · 250 unmodified lines
251251
252252 libs-y += arch/x86/lib/
253253
254−core-y += arch/x86/virt/
255−
256254 # drivers-y are linked after core-y
257255 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
258256 drivers-$(CONFIG_PCI) += arch/x86/pci/
arch/x86/boot/compressed/efi_mixed.S+15−5
@@ -15,10 +15,12 @@ · 14 unmodified lines
1515 */
1616
1717 #include <linux/linkage.h>
18+#include <asm/asm-offsets.h>
1819 #include <asm/msr.h>
1920 #include <asm/page_types.h>
2021 #include <asm/processor-flags.h>
2122 #include <asm/segment.h>
23+#include <asm/setup.h>
2224
2325 .code64
2426 .text
@@ -149,6 +151,7 @@ SYM_FUNC_END(__efi64_thunk) · 124 unmodified lines
149151 SYM_FUNC_START(efi32_stub_entry)
150152 call 1f
151153 1: popl %ecx
154+ leal (efi32_boot_args - 1b)(%ecx), %ebx
152155
153156 /* Clear BSS */
154157 xorl %eax, %eax
@@ -163,6 +166,7 @@ SYM_FUNC_START(efi32_stub_entry) · 8 unmodified lines
163166 popl %ecx
164167 popl %edx
165168 popl %esi
169+ movl %esi, 8(%ebx)
166170 jmp efi32_entry
167171 SYM_FUNC_END(efi32_stub_entry)
168172 #endif
@@ -239,8 +243,6 @@ SYM_FUNC_END(efi_enter32) · 70 unmodified lines
239243 *
240244 * Arguments: %ecx image handle
241245 * %edx EFI system table pointer
242− * %esi struct bootparams pointer (or NULL when not using
243− * the EFI handover protocol)
244246 *
245247 * Since this is the point of no return for ordinary execution, no registers
246248 * are considered live except for the function parameters. [Note that the EFI
@@ -266,9 +268,18 @@ SYM_FUNC_START_LOCAL(efi32_entry) · 19 unmodified lines
266268 leal (efi32_boot_args - 1b)(%ebx), %ebx
267269 movl %ecx, 0(%ebx)
268270 movl %edx, 4(%ebx)
269− movl %esi, 8(%ebx)
270271 movb $0x0, 12(%ebx) // efi_is64
271272
273+ /*
274+ * Allocate some memory for a temporary struct boot_params, which only
275+ * needs the minimal pieces that startup_32() relies on.
276+ */
277+ subl $PARAM_SIZE, %esp
278+ movl %esp, %esi
279+ movl $PAGE_SIZE, BP_kernel_alignment(%esi)
280+ movl $_end - 1b, BP_init_size(%esi)
281+ subl $startup_32 - 1b, BP_init_size(%esi)
282+
272283 /* Disable paging */
273284 movl %cr0, %eax
274285 btrl $X86_CR0_PG_BIT, %eax
@@ -294,8 +305,7 @@ SYM_FUNC_START(efi32_pe_entry) · 19 unmodified lines
294305
295306 movl 8(%ebp), %ecx // image_handle
296307 movl 12(%ebp), %edx // sys_table
297− xorl %esi, %esi
298− jmp efi32_entry // pass %ecx, %edx, %esi
308+ jmp efi32_entry // pass %ecx, %edx
299309 // no other registers remain live
300310
301311 2: popl %edi // restore callee-save registers
arch/x86/entry/vdso/Makefile+1−0
@@ -41,6 +41,7 @@ obj-$(CONFIG_X86_X32_ABI) += vdso-image-x32.o · 40 unmodified lines
4141 obj-$(CONFIG_COMPAT_32) += vdso-image-32.o vdso32-setup.o
4242
4343 OBJECT_FILES_NON_STANDARD_vdso-image-32.o := n
44+OBJECT_FILES_NON_STANDARD_vdso-image-x32.o := n
4445 OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n
4546 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
4647
arch/x86/events/amd/core.c+34−5
@@ -250,7 +250,7 @@ static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX] = · 249 unmodified lines
250250 /*
251251 * AMD Performance Monitor Family 17h and later:
252252 */
253−static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] =
253+static const u64 amd_zen1_perfmon_event_map[PERF_COUNT_HW_MAX] =
254254 {
255255 [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
256256 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
@@ -262,10 +262,39 @@ static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] = · 5 unmodified lines
262262 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x0187,
263263 };
264264
265+static const u64 amd_zen2_perfmon_event_map[PERF_COUNT_HW_MAX] =
266+{
267+ [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
268+ [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
269+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
270+ [PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
271+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
272+ [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
273+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a9,
274+};
275+
276+static const u64 amd_zen4_perfmon_event_map[PERF_COUNT_HW_MAX] =
277+{
278+ [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
279+ [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
280+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
281+ [PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
282+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
283+ [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
284+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a9,
285+ [PERF_COUNT_HW_REF_CPU_CYCLES] = 0x100000120,
286+};
287+
265288 static u64 amd_pmu_event_map(int hw_event)
266289 {
267− if (boot_cpu_data.x86 >= 0x17)
268− return amd_f17h_perfmon_event_map[hw_event];
290+ if (cpu_feature_enabled(X86_FEATURE_ZEN4) || boot_cpu_data.x86 >= 0x1a)
291+ return amd_zen4_perfmon_event_map[hw_event];
292+
293+ if (cpu_feature_enabled(X86_FEATURE_ZEN2) || boot_cpu_data.x86 >= 0x19)
294+ return amd_zen2_perfmon_event_map[hw_event];
295+
296+ if (cpu_feature_enabled(X86_FEATURE_ZEN1))
297+ return amd_zen1_perfmon_event_map[hw_event];
269298
270299 return amd_perfmon_event_map[hw_event];
271300 }
@@ -904,8 +933,8 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs) · 632 unmodified lines
904933 if (!status)
905934 goto done;
906935
907− /* Read branch records before unfreezing */
908− if (status & GLOBAL_STATUS_LBRS_FROZEN) {
936+ /* Read branch records */
937+ if (x86_pmu.lbr_nr) {
909938 amd_pmu_lbr_read();
910939 status &= ~GLOBAL_STATUS_LBRS_FROZEN;
911940 }
arch/x86/events/amd/lbr.c+10−6
@@ -402,10 +402,12 @@ void amd_pmu_lbr_enable_all(void) · 401 unmodified lines
402402 wrmsrl(MSR_AMD64_LBR_SELECT, lbr_select);
403403 }
404404
405− rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
406− rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
405+ if (cpu_feature_enabled(X86_FEATURE_AMD_LBR_PMC_FREEZE)) {
406+ rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
407+ wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
408+ }
407409
408− wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
410+ rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
409411 wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg | DBG_EXTN_CFG_LBRV2EN);
410412 }
411413
@@ -418,10 +420,12 @@ void amd_pmu_lbr_disable_all(void) · 6 unmodified lines
418420 return;
419421
420422 rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
421− rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
422−
423423 wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN);
424− wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
424+
425+ if (cpu_feature_enabled(X86_FEATURE_AMD_LBR_PMC_FREEZE)) {
426+ rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
427+ wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
428+ }
425429 }
426430
427431 __init int amd_pmu_lbr_init(void)
arch/x86/include/asm/asm-prototypes.h+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <asm/asm.h>
1515 #include <asm/fred.h>
1616 #include <asm/gsseg.h>
17+#include <asm/nospec-branch.h>
1718
1819 #ifndef CONFIG_X86_CMPXCHG64
1920 extern void cmpxchg8b_emu(void);
arch/x86/include/asm/cpufeature.h+4−2
@@ -91,8 +91,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; · 90 unmodified lines
9191 CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) || \
9292 CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) || \
9393 CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 20, feature_bit) || \
94+ CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 21, feature_bit) || \
9495 REQUIRED_MASK_CHECK || \
95− BUILD_BUG_ON_ZERO(NCAPINTS != 21))
96+ BUILD_BUG_ON_ZERO(NCAPINTS != 22))
9697
9798 #define DISABLED_MASK_BIT_SET(feature_bit) \
9899 ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \
@@ -116,8 +117,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; · 17 unmodified lines
116117 CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) || \
117118 CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) || \
118119 CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 20, feature_bit) || \
120+ CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 21, feature_bit) || \
119121 DISABLED_MASK_CHECK || \
120− BUILD_BUG_ON_ZERO(NCAPINTS != 21))
122+ BUILD_BUG_ON_ZERO(NCAPINTS != 22))
121123
122124 #define cpu_has(c, bit) \
123125 (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
arch/x86/include/asm/cpufeatures.h+9−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 /*
1414 * Defines x86 CPU feature bits
1515 */
16−#define NCAPINTS 21 /* N 32-bit words worth of info */
16+#define NCAPINTS 22 /* N 32-bit words worth of info */
1717 #define NBUGINTS 2 /* N 32-bit bug flags */
1818
1919 /*
@@ -459,6 +459,14 @@ · 439 unmodified lines
459459 #define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* "" MSR_PRED_CMD[IBPB] flushes all branch type predictions */
460460 #define X86_FEATURE_SRSO_NO (20*32+29) /* "" CPU is not affected by SRSO */
461461
462+/*
463+ * Extended auxiliary flags: Linux defined - for features scattered in various
464+ * CPUID levels like 0x80000022, etc.
465+ *
466+ * Reuse free bits when adding new feature flags!
467+ */
468+#define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0) /* AMD LBR and PMC Freeze */
469+
462470 /*
463471 * BUG word(s)
464472 */
arch/x86/include/asm/crash_reserve.h+2−0
@@ -39,4 +39,6 @@ static inline unsigned long crash_low_size_default(void) · 38 unmodified lines
3939 #endif
4040 }
4141
42+#define HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY
43+
4244 #endif /* _X86_CRASH_RESERVE_H */
arch/x86/include/asm/disabled-features.h+2−1
@@ -155,6 +155,7 @@ · 154 unmodified lines
155155 #define DISABLED_MASK18 (DISABLE_IBT)
156156 #define DISABLED_MASK19 (DISABLE_SEV_SNP)
157157 #define DISABLED_MASK20 0
158−#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
158+#define DISABLED_MASK21 0
159+#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
159160
160161 #endif /* _ASM_X86_DISABLED_FEATURES_H */
arch/x86/include/asm/nospec-branch.h+16−5
@@ -262,11 +262,20 @@ · 261 unmodified lines
262262 .Lskip_rsb_\@:
263263 .endm
264264
265+/*
266+ * The CALL to srso_alias_untrain_ret() must be patched in directly at
267+ * the spot where untraining must be done, ie., srso_alias_untrain_ret()
268+ * must be the target of a CALL instruction instead of indirectly
269+ * jumping to a wrapper which then calls it. Therefore, this macro is
270+ * called outside of __UNTRAIN_RET below, for the time being, before the
271+ * kernel can support nested alternatives with arbitrary nesting.
272+ */
273+.macro CALL_UNTRAIN_RET
265274 #if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
266−#define CALL_UNTRAIN_RET "call entry_untrain_ret"
267−#else
268−#define CALL_UNTRAIN_RET ""
275+ ALTERNATIVE_2 "", "call entry_untrain_ret", X86_FEATURE_UNRET, \
276+ "call srso_alias_untrain_ret", X86_FEATURE_SRSO_ALIAS
269277 #endif
278+.endm
270279
271280 /*
272281 * Mitigate RETBleed for AMD/Hygon Zen uarch. Requires KERNEL CR3 because the
@@ -282,8 +291,8 @@ · 9 unmodified lines
282291 .macro __UNTRAIN_RET ibpb_feature, call_depth_insns
283292 #if defined(CONFIG_MITIGATION_RETHUNK) || defined(CONFIG_MITIGATION_IBPB_ENTRY)
284293 VALIDATE_UNRET_END
285− ALTERNATIVE_3 "", \
286− CALL_UNTRAIN_RET, X86_FEATURE_UNRET, \
294+ CALL_UNTRAIN_RET
295+ ALTERNATIVE_2 "", \
287296 "call entry_ibpb", \ibpb_feature, \
288297 __stringify(\call_depth_insns), X86_FEATURE_CALL_DEPTH
289298 #endif
@@ -342,6 +351,8 @@ extern void retbleed_return_thunk(void); · 52 unmodified lines
342351 static inline void retbleed_return_thunk(void) {}
343352 #endif
344353
354+extern void srso_alias_untrain_ret(void);
355+
345356 #ifdef CONFIG_MITIGATION_SRSO
346357 extern void srso_return_thunk(void);
347358 extern void srso_alias_return_thunk(void);
arch/x86/include/asm/required-features.h+2−1
@@ -99,6 +99,7 @@ · 98 unmodified lines
9999 #define REQUIRED_MASK18 0
100100 #define REQUIRED_MASK19 0
101101 #define REQUIRED_MASK20 0
102−#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
102+#define REQUIRED_MASK21 0
103+#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
103104
104105 #endif /* _ASM_X86_REQUIRED_FEATURES_H */
arch/x86/include/asm/sev.h+2−2
@@ -218,12 +218,12 @@ void early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, · 217 unmodified lines
218218 unsigned long npages);
219219 void early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr,
220220 unsigned long npages);
221−void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op);
222221 void snp_set_memory_shared(unsigned long vaddr, unsigned long npages);
223222 void snp_set_memory_private(unsigned long vaddr, unsigned long npages);
224223 void snp_set_wakeup_secondary_cpu(void);
225224 bool snp_init(struct boot_params *bp);
226225 void __noreturn snp_abort(void);
226+void snp_dmi_setup(void);
227227 int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio);
228228 void snp_accept_memory(phys_addr_t start, phys_addr_t end);
229229 u64 snp_get_unsupported_features(u64 status);
@@ -244,12 +244,12 @@ static inline void __init · 14 unmodified lines
244244 early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
245245 static inline void __init
246246 early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
247−static inline void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op) { }
248247 static inline void snp_set_memory_shared(unsigned long vaddr, unsigned long npages) { }
249248 static inline void snp_set_memory_private(unsigned long vaddr, unsigned long npages) { }
250249 static inline void snp_set_wakeup_secondary_cpu(void) { }
251250 static inline bool snp_init(struct boot_params *bp) { return false; }
252251 static inline void snp_abort(void) { }
252+static inline void snp_dmi_setup(void) { }
253253 static inline int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio)
254254 {
255255 return -ENOTTY;
arch/x86/include/asm/x86_init.h+2−1
@@ -30,12 +30,13 @@ struct x86_init_mpparse { · 29 unmodified lines
3030 * @reserve_resources: reserve the standard resources for the
3131 * platform
3232 * @memory_setup: platform specific memory setup
33− *
33+ * @dmi_setup: platform specific DMI setup
3434 */
3535 struct x86_init_resources {
3636 void (*probe_roms)(void);
3737 void (*reserve_resources)(void);
3838 char *(*memory_setup)(void);
39+ void (*dmi_setup)(void);
3940 };
4041
4142 /**
arch/x86/kernel/cpu/scattered.c+1−0
@@ -49,6 +49,7 @@ static const struct cpuid_bit cpuid_bits[] = { · 48 unmodified lines
4949 { X86_FEATURE_BMEC, CPUID_EBX, 3, 0x80000020, 0 },
5050 { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 },
5151 { X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 },
52+ { X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 },
5253 { 0, 0, 0, 0, 0 }
5354 };
5455
arch/x86/kernel/eisa.c+2−1
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /*
33 * EISA specific code
44 */
5+#include <linux/cc_platform.h>
56 #include <linux/ioport.h>
67 #include <linux/eisa.h>
78 #include <linux/io.h>
@@ -12,7 +13,7 @@ static __init int eisa_bus_probe(void) · 4 unmodified lines
1213 {
1314 void __iomem *p;
1415
15− if (xen_pv_domain() && !xen_initial_domain())
16+ if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
1617 return 0;
1718
1819 p = ioremap(0x0FFFD9, 4);
arch/x86/kernel/nmi.c+14−10
@@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(asm_exc_nmi_kvm_vmx); · 579 unmodified lines
580580
581581 static char *nmi_check_stall_msg[] = {
582582 /* */
583−/* +--------- nsp->idt_seq_snap & 0x1: CPU is in NMI handler. */
583+/* +--------- nmi_seq & 0x1: CPU is currently in NMI handler. */
584584 /* | +------ cpu_is_offline(cpu) */
585585 /* | | +--- nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls): */
586586 /* | | | NMI handler has been invoked. */
@@ -628,22 +628,26 @@ void nmi_backtrace_stall_check(const struct cpumask *btp) · 41 unmodified lines
628628 nmi_seq = READ_ONCE(nsp->idt_nmi_seq);
629629 if (nsp->idt_nmi_seq_snap + 1 == nmi_seq && (nmi_seq & 0x1)) {
630630 msgp = "CPU entered NMI handler function, but has not exited";
631− } else if ((nsp->idt_nmi_seq_snap & 0x1) != (nmi_seq & 0x1)) {
632− msgp = "CPU is handling NMIs";
633− } else {
634− idx = ((nsp->idt_seq_snap & 0x1) << 2) |
631+ } else if (nsp->idt_nmi_seq_snap == nmi_seq ||
632+ nsp->idt_nmi_seq_snap + 1 == nmi_seq) {
633+ idx = ((nmi_seq & 0x1) << 2) |
635634 (cpu_is_offline(cpu) << 1) |
636635 (nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls));
637636 msgp = nmi_check_stall_msg[idx];
638637 if (nsp->idt_ignored_snap != READ_ONCE(nsp->idt_ignored) && (idx & 0x1))
639638 modp = ", but OK because ignore_nmis was set";
640− if (nmi_seq & 0x1)
641− msghp = " (CPU currently in NMI handler function)";
642− else if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
639+ if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
643640 msghp = " (CPU exited one NMI handler function)";
641+ else if (nmi_seq & 0x1)
642+ msghp = " (CPU currently in NMI handler function)";
643+ else
644+ msghp = " (CPU was never in an NMI handler function)";
645+ } else {
646+ msgp = "CPU is handling NMIs";
644647 }
645− pr_alert("%s: CPU %d: %s%s%s, last activity: %lu jiffies ago.\n",
646− __func__, cpu, msgp, modp, msghp, j - READ_ONCE(nsp->recv_jiffies));
648+ pr_alert("%s: CPU %d: %s%s%s\n", __func__, cpu, msgp, modp, msghp);
649+ pr_alert("%s: last activity: %lu jiffies ago.\n",
650+ __func__, j - READ_ONCE(nsp->recv_jiffies));
647651 }
648652 }
649653
arch/x86/kernel/probe_roms.c+0−10
@@ -203,16 +203,6 @@ void __init probe_roms(void) · 202 unmodified lines
203203 unsigned char c;
204204 int i;
205205
206− /*
207− * The ROM memory range is not part of the e820 table and is therefore not
208− * pre-validated by BIOS. The kernel page table maps the ROM region as encrypted
209− * memory, and SNP requires encrypted memory to be validated before access.
210− * Do that here.
211− */
212− snp_prep_memory(video_rom_resource.start,
213− ((system_rom_resource.end + 1) - video_rom_resource.start),
214− SNP_PAGE_STATE_PRIVATE);
215−
216206 /* video rom */
217207 upper = adapter_rom_resources[0].start;
218208 for (start = video_rom_resource.start; start < upper; start += 2048) {
arch/x86/kernel/setup.c+1−2
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #include <linux/console.h>
1010 #include <linux/crash_dump.h>
1111 #include <linux/dma-map-ops.h>
12−#include <linux/dmi.h>
1312 #include <linux/efi.h>
1413 #include <linux/ima.h>
1514 #include <linux/init_ohci1394_dma.h>
@@ -902,7 +901,7 @@ void __init setup_arch(char **cmdline_p) · 886 unmodified lines
902901 efi_init();
903902
904903 reserve_ibft_region();
905− dmi_setup();
904+ x86_init.resources.dmi_setup();
906905
907906 /*
908907 * VMware detection requires dmi to be available, so this
arch/x86/kernel/sev.c+12−15
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/platform_device.h>
2424 #include <linux/io.h>
2525 #include <linux/psp-sev.h>
26+#include <linux/dmi.h>
2627 #include <uapi/linux/sev-guest.h>
2728
2829 #include <asm/init.h>
@@ -795,21 +796,6 @@ void __init early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr · 766 unmodified lines
795796 early_set_pages_state(vaddr, paddr, npages, SNP_PAGE_STATE_SHARED);
796797 }
797798
798−void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op)
799−{
800− unsigned long vaddr, npages;
801−
802− vaddr = (unsigned long)__va(paddr);
803− npages = PAGE_ALIGN(sz) >> PAGE_SHIFT;
804−
805− if (op == SNP_PAGE_STATE_PRIVATE)
806− early_snp_set_memory_private(vaddr, paddr, npages);
807− else if (op == SNP_PAGE_STATE_SHARED)
808− early_snp_set_memory_shared(vaddr, paddr, npages);
809− else
810− WARN(1, "invalid memory op %d\n", op);
811−}
812−
813799 static unsigned long __set_pages_state(struct snp_psc_desc *data, unsigned long vaddr,
814800 unsigned long vaddr_end, int op)
815801 {
@@ -2136,6 +2122,17 @@ void __head __noreturn snp_abort(void) · 1320 unmodified lines
21362122 sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SNP_UNSUPPORTED);
21372123 }
21382124
2125+/*
2126+ * SEV-SNP guests should only execute dmi_setup() if EFI_CONFIG_TABLES are
2127+ * enabled, as the alternative (fallback) logic for DMI probing in the legacy
2128+ * ROM region can cause a crash since this region is not pre-validated.
2129+ */
2130+void __init snp_dmi_setup(void)
2131+{
2132+ if (efi_enabled(EFI_CONFIG_TABLES))
2133+ dmi_setup();
2134+}
2135+
21392136 static void dump_cpuid_table(void)
21402137 {
21412138 const struct snp_cpuid_table *cpuid_table = snp_cpuid_get_table();
arch/x86/kernel/x86_init.c+2−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 *
44 * For licencing details see kernel-base/COPYING
55 */
6+#include <linux/dmi.h>
67 #include <linux/init.h>
78 #include <linux/ioport.h>
89 #include <linux/export.h>
@@ -66,6 +67,7 @@ struct x86_init_ops x86_init __initdata = { · 57 unmodified lines
6667 .probe_roms = probe_roms,
6768 .reserve_resources = reserve_standard_io_resources,
6869 .memory_setup = e820__memory_setup_default,
70+ .dmi_setup = dmi_setup,
6971 },
7072
7173 .mpparse = {
arch/x86/lib/retpoline.S+6−5
@@ -163,6 +163,7 @@ SYM_CODE_START_NOALIGN(srso_alias_untrain_ret) · 162 unmodified lines
163163 lfence
164164 jmp srso_alias_return_thunk
165165 SYM_FUNC_END(srso_alias_untrain_ret)
166+__EXPORT_THUNK(srso_alias_untrain_ret)
166167 .popsection
167168
168169 .pushsection .text..__x86.rethunk_safe
@@ -224,10 +225,12 @@ SYM_CODE_START(srso_return_thunk) · 55 unmodified lines
224225 SYM_CODE_END(srso_return_thunk)
225226
226227 #define JMP_SRSO_UNTRAIN_RET "jmp srso_untrain_ret"
227−#define JMP_SRSO_ALIAS_UNTRAIN_RET "jmp srso_alias_untrain_ret"
228228 #else /* !CONFIG_MITIGATION_SRSO */
229+/* Dummy for the alternative in CALL_UNTRAIN_RET. */
230+SYM_CODE_START(srso_alias_untrain_ret)
231+ RET
232+SYM_FUNC_END(srso_alias_untrain_ret)
229233 #define JMP_SRSO_UNTRAIN_RET "ud2"
230−#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2"
231234 #endif /* CONFIG_MITIGATION_SRSO */
232235
233236 #ifdef CONFIG_MITIGATION_UNRET_ENTRY
@@ -319,9 +322,7 @@ SYM_FUNC_END(retbleed_untrain_ret) · 85 unmodified lines
319322 #if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
320323
321324 SYM_FUNC_START(entry_untrain_ret)
322− ALTERNATIVE_2 JMP_RETBLEED_UNTRAIN_RET, \
323− JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO, \
324− JMP_SRSO_ALIAS_UNTRAIN_RET, X86_FEATURE_SRSO_ALIAS
325+ ALTERNATIVE JMP_RETBLEED_UNTRAIN_RET, JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO
325326 SYM_FUNC_END(entry_untrain_ret)
326327 __EXPORT_THUNK(entry_untrain_ret)
327328
arch/x86/mm/ident_map.c+5−18
@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page, · 25 unmodified lines
2626 for (; addr < end; addr = next) {
2727 pud_t *pud = pud_page + pud_index(addr);
2828 pmd_t *pmd;
29− bool use_gbpage;
3029
3130 next = (addr & PUD_MASK) + PUD_SIZE;
3231 if (next > end)
3332 next = end;
3433
35− /* if this is already a gbpage, this portion is already mapped */
36− if (pud_leaf(*pud))
37− continue;
38−
39− /* Is using a gbpage allowed? */
40− use_gbpage = info->direct_gbpages;
41−
42− /* Don't use gbpage if it maps more than the requested region. */
43− /* at the begining: */
44− use_gbpage &= ((addr & ~PUD_MASK) == 0);
45− /* ... or at the end: */
46− use_gbpage &= ((next & ~PUD_MASK) == 0);
47−
48− /* Never overwrite existing mappings */
49− use_gbpage &= !pud_present(*pud);
50−
51− if (use_gbpage) {
34+ if (info->direct_gbpages) {
5235 pud_t pudval;
5336
37+ if (pud_present(*pud))
38+ continue;
39+
40+ addr &= PUD_MASK;
5441 pudval = __pud((addr - info->offset) | info->page_flag);
5542 set_pud(pud, pudval);
5643 continue;
arch/x86/mm/mem_encrypt_amd.c+18−0
@@ -492,6 +492,24 @@ void __init sme_early_init(void) · 491 unmodified lines
492492 */
493493 if (sev_status & MSR_AMD64_SEV_ENABLED)
494494 ia32_disable();
495+
496+ /*
497+ * Override init functions that scan the ROM region in SEV-SNP guests,
498+ * as this memory is not pre-validated and would thus cause a crash.
499+ */
500+ if (sev_status & MSR_AMD64_SEV_SNP_ENABLED) {
501+ x86_init.mpparse.find_mptable = x86_init_noop;
502+ x86_init.pci.init_irq = x86_init_noop;
503+ x86_init.resources.probe_roms = x86_init_noop;
504+
505+ /*
506+ * DMI setup behavior for SEV-SNP guests depends on
507+ * efi_enabled(EFI_CONFIG_TABLES), which hasn't been
508+ * parsed yet. snp_dmi_setup() will run after that
509+ * parsing has happened.
510+ */
511+ x86_init.resources.dmi_setup = snp_dmi_setup;
512+ }
495513 }
496514
497515 void __init mem_encrypt_free_decrypted_mem(void)
arch/x86/virt/Makefile+1−1
@@ -1,2 +1,2 @@
11 # SPDX-License-Identifier: GPL-2.0-only
2−obj-y += vmx/
2+obj-y += svm/ vmx/
block/blk-merge.c+1−1
@@ -726,7 +726,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req, · 725 unmodified lines
726726 * which can be mixed are set in each bio and mark @rq as mixed
727727 * merged.
728728 */
729−void blk_rq_set_mixed_merge(struct request *rq)
729+static void blk_rq_set_mixed_merge(struct request *rq)
730730 {
731731 blk_opf_t ff = rq->cmd_flags & REQ_FAILFAST_MASK;
732732 struct bio *bio;
block/blk-mq.c+2−7
@@ -770,16 +770,11 @@ static void req_bio_endio(struct request *rq, struct bio *bio, · 769 unmodified lines
770770 /*
771771 * Partial zone append completions cannot be supported as the
772772 * BIO fragments may end up not being written sequentially.
773− * For such case, force the completed nbytes to be equal to
774− * the BIO size so that bio_advance() sets the BIO remaining
775− * size to 0 and we end up calling bio_endio() before returning.
776773 */
777− if (bio->bi_iter.bi_size != nbytes) {
774+ if (bio->bi_iter.bi_size != nbytes)
778775 bio->bi_status = BLK_STS_IOERR;
779− nbytes = bio->bi_iter.bi_size;
780− } else {
776+ else
781777 bio->bi_iter.bi_sector = rq->__sector;
782− }
783778 }
784779
785780 bio_advance(bio, nbytes);
block/blk-settings.c+1−2
@@ -146,8 +146,7 @@ static int blk_validate_limits(struct queue_limits *lim) · 145 unmodified lines
146146 max_hw_sectors = min_not_zero(lim->max_hw_sectors,
147147 lim->max_dev_sectors);
148148 if (lim->max_user_sectors) {
149− if (lim->max_user_sectors > max_hw_sectors ||
150− lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
149+ if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
151150 return -EINVAL;
152151 lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors);
153152 } else {
block/blk.h+0−1
@@ -339,7 +339,6 @@ int ll_back_merge_fn(struct request *req, struct bio *bio, · 338 unmodified lines
339339 bool blk_attempt_req_merge(struct request_queue *q, struct request *rq,
340340 struct request *next);
341341 unsigned int blk_recalc_rq_segments(struct request *rq);
342−void blk_rq_set_mixed_merge(struct request *rq);
343342 bool blk_rq_merge_ok(struct request *rq, struct bio *bio);
344343 enum elv_merge blk_try_merge(struct request *rq, struct bio *bio);
345344
crypto/asymmetric_keys/mscode_parser.c+3−0
@@ -75,6 +75,9 @@ int mscode_note_digest_algo(void *context, size_t hdrlen, · 74 unmodified lines
7575
7676 oid = look_up_OID(value, vlen);
7777 switch (oid) {
78+ case OID_sha1:
79+ ctx->digest_algo = "sha1";
80+ break;
7881 case OID_sha256:
7982 ctx->digest_algo = "sha256";
8083 break;
crypto/asymmetric_keys/pkcs7_parser.c+4−0
@@ -227,6 +227,9 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen, · 226 unmodified lines
227227 struct pkcs7_parse_context *ctx = context;
228228
229229 switch (ctx->last_oid) {
230+ case OID_sha1:
231+ ctx->sinfo->sig->hash_algo = "sha1";
232+ break;
230233 case OID_sha256:
231234 ctx->sinfo->sig->hash_algo = "sha256";
232235 break;
@@ -278,6 +281,7 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen, · 45 unmodified lines
278281 ctx->sinfo->sig->pkey_algo = "rsa";
279282 ctx->sinfo->sig->encoding = "pkcs1";
280283 break;
284+ case OID_id_ecdsa_with_sha1:
281285 case OID_id_ecdsa_with_sha224:
282286 case OID_id_ecdsa_with_sha256:
283287 case OID_id_ecdsa_with_sha384:
crypto/asymmetric_keys/public_key.c+2−1
@@ -115,7 +115,8 @@ software_key_determine_akcipher(const struct public_key *pkey, · 114 unmodified lines
115115 */
116116 if (!hash_algo)
117117 return -EINVAL;
118− if (strcmp(hash_algo, "sha224") != 0 &&
118+ if (strcmp(hash_algo, "sha1") != 0 &&
119+ strcmp(hash_algo, "sha224") != 0 &&
119120 strcmp(hash_algo, "sha256") != 0 &&
120121 strcmp(hash_algo, "sha384") != 0 &&
121122 strcmp(hash_algo, "sha512") != 0 &&
crypto/asymmetric_keys/signature.c+1−1
@@ -115,7 +115,7 @@ EXPORT_SYMBOL_GPL(decrypt_blob); · 114 unmodified lines
115115 * Sign the specified data blob using the private key specified by params->key.
116116 * The signature is wrapped in an encoding if params->encoding is specified
117117 * (eg. "pkcs1"). If the encoding needs to know the digest type, this can be
118− * passed through params->hash_algo (eg. "sha512").
118+ * passed through params->hash_algo (eg. "sha1").
119119 *
120120 * Returns the length of the data placed in the signature buffer or an error.
121121 */
crypto/asymmetric_keys/x509_cert_parser.c+8−0
@@ -198,6 +198,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag, · 197 unmodified lines
198198 default:
199199 return -ENOPKG; /* Unsupported combination */
200200
201+ case OID_sha1WithRSAEncryption:
202+ ctx->cert->sig->hash_algo = "sha1";
203+ goto rsa_pkcs1;
204+
201205 case OID_sha256WithRSAEncryption:
202206 ctx->cert->sig->hash_algo = "sha256";
203207 goto rsa_pkcs1;
@@ -214,6 +218,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag, · 10 unmodified lines
214218 ctx->cert->sig->hash_algo = "sha224";
215219 goto rsa_pkcs1;
216220
221+ case OID_id_ecdsa_with_sha1:
222+ ctx->cert->sig->hash_algo = "sha1";
223+ goto ecdsa;
224+
217225 case OID_id_rsassa_pkcs1_v1_5_with_sha3_256:
218226 ctx->cert->sig->hash_algo = "sha3-256";
219227 goto rsa_pkcs1;
crypto/testmgr.h+80−0
@@ -653,6 +653,30 @@ static const struct akcipher_testvec rsa_tv_template[] = { · 652 unmodified lines
653653 static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
654654 {
655655 .key =
656+ "\x04\xf7\x46\xf8\x2f\x15\xf6\x22\x8e\xd7\x57\x4f\xcc\xe7\xbb\xc1"
657+ "\xd4\x09\x73\xcf\xea\xd0\x15\x07\x3d\xa5\x8a\x8a\x95\x43\xe4\x68"
658+ "\xea\xc6\x25\xc1\xc1\x01\x25\x4c\x7e\xc3\x3c\xa6\x04\x0a\xe7\x08"
659+ "\x98",
660+ .key_len = 49,
661+ .params =
662+ "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
663+ "\xce\x3d\x03\x01\x01",
664+ .param_len = 21,
665+ .m =
666+ "\xcd\xb9\xd2\x1c\xb7\x6f\xcd\x44\xb3\xfd\x63\xea\xa3\x66\x7f\xae"
667+ "\x63\x85\xe7\x82",
668+ .m_size = 20,
669+ .algo = OID_id_ecdsa_with_sha1,
670+ .c =
671+ "\x30\x35\x02\x19\x00\xba\xe5\x93\x83\x6e\xb6\x3b\x63\xa0\x27\x91"
672+ "\xc6\xf6\x7f\xc3\x09\xad\x59\xad\x88\x27\xd6\x92\x6b\x02\x18\x10"
673+ "\x68\x01\x9d\xba\xce\x83\x08\xef\x95\x52\x7b\xa0\x0f\xe4\x18\x86"
674+ "\x80\x6f\xa5\x79\x77\xda\xd0",
675+ .c_size = 55,
676+ .public_key_vec = true,
677+ .siggen_sigver_test = true,
678+ }, {
679+ .key =
656680 "\x04\xb6\x4b\xb1\xd1\xac\xba\x24\x8f\x65\xb2\x60\x00\x90\xbf\xbd"
657681 "\x78\x05\x73\xe9\x79\x1d\x6f\x7c\x0b\xd2\xc3\x93\xa7\x28\xe1\x75"
658682 "\xf7\xd5\x95\x1d\x28\x10\xc0\x75\x50\x5c\x1a\x4f\x3f\x8f\xa5\xee"
@@ -756,6 +780,32 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = { · 97 unmodified lines
756780 static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
757781 {
758782 .key =
783+ "\x04\xb9\x7b\xbb\xd7\x17\x64\xd2\x7e\xfc\x81\x5d\x87\x06\x83\x41"
784+ "\x22\xd6\x9a\xaa\x87\x17\xec\x4f\x63\x55\x2f\x94\xba\xdd\x83\xe9"
785+ "\x34\x4b\xf3\xe9\x91\x13\x50\xb6\xcb\xca\x62\x08\xe7\x3b\x09\xdc"
786+ "\xc3\x63\x4b\x2d\xb9\x73\x53\xe4\x45\xe6\x7c\xad\xe7\x6b\xb0\xe8"
787+ "\xaf",
788+ .key_len = 65,
789+ .params =
790+ "\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
791+ "\xce\x3d\x03\x01\x07",
792+ .param_len = 21,
793+ .m =
794+ "\xc2\x2b\x5f\x91\x78\x34\x26\x09\x42\x8d\x6f\x51\xb2\xc5\xaf\x4c"
795+ "\x0b\xde\x6a\x42",
796+ .m_size = 20,
797+ .algo = OID_id_ecdsa_with_sha1,
798+ .c =
799+ "\x30\x46\x02\x21\x00\xf9\x25\xce\x9f\x3a\xa6\x35\x81\xcf\xd4\xe7"
800+ "\xb7\xf0\x82\x56\x41\xf7\xd4\xad\x8d\x94\x5a\x69\x89\xee\xca\x6a"
801+ "\x52\x0e\x48\x4d\xcc\x02\x21\x00\xd7\xe4\xef\x52\x66\xd3\x5b\x9d"
802+ "\x8a\xfa\x54\x93\x29\xa7\x70\x86\xf1\x03\x03\xf3\x3b\xe2\x73\xf7"
803+ "\xfb\x9d\x8b\xde\xd4\x8d\x6f\xad",
804+ .c_size = 72,
805+ .public_key_vec = true,
806+ .siggen_sigver_test = true,
807+ }, {
808+ .key =
759809 "\x04\x8b\x6d\xc0\x33\x8e\x2d\x8b\x67\xf5\xeb\xc4\x7f\xa0\xf5\xd9"
760810 "\x7b\x03\xa5\x78\x9a\xb5\xea\x14\xe4\x23\xd0\xaf\xd7\x0e\x2e\xa0"
761811 "\xc9\x8b\xdb\x95\xf8\xb3\xaf\xac\x00\x2c\x2c\x1f\x7a\xfd\x95\x88"
@@ -866,6 +916,36 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = { · 104 unmodified lines
866916
867917 static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
868918 {
919+ .key = /* secp384r1(sha1) */
920+ "\x04\x89\x25\xf3\x97\x88\xcb\xb0\x78\xc5\x72\x9a\x14\x6e\x7a\xb1"
921+ "\x5a\xa5\x24\xf1\x95\x06\x9e\x28\xfb\xc4\xb9\xbe\x5a\x0d\xd9\x9f"
922+ "\xf3\xd1\x4d\x2d\x07\x99\xbd\xda\xa7\x66\xec\xbb\xea\xba\x79\x42"
923+ "\xc9\x34\x89\x6a\xe7\x0b\xc3\xf2\xfe\x32\x30\xbe\xba\xf9\xdf\x7e"
924+ "\x4b\x6a\x07\x8e\x26\x66\x3f\x1d\xec\xa2\x57\x91\x51\xdd\x17\x0e"
925+ "\x0b\x25\xd6\x80\x5c\x3b\xe6\x1a\x98\x48\x91\x45\x7a\x73\xb0\xc3"
926+ "\xf1",
927+ .key_len = 97,
928+ .params =
929+ "\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
930+ "\x00\x22",
931+ .param_len = 18,
932+ .m =
933+ "\x12\x55\x28\xf0\x77\xd5\xb6\x21\x71\x32\x48\xcd\x28\xa8\x25\x22"
934+ "\x3a\x69\xc1\x93",
935+ .m_size = 20,
936+ .algo = OID_id_ecdsa_with_sha1,
937+ .c =
938+ "\x30\x66\x02\x31\x00\xf5\x0f\x24\x4c\x07\x93\x6f\x21\x57\x55\x07"
939+ "\x20\x43\x30\xde\xa0\x8d\x26\x8e\xae\x63\x3f\xbc\x20\x3a\xc6\xf1"
940+ "\x32\x3c\xce\x70\x2b\x78\xf1\x4c\x26\xe6\x5b\x86\xcf\xec\x7c\x7e"
941+ "\xd0\x87\xd7\xd7\x6e\x02\x31\x00\xcd\xbb\x7e\x81\x5d\x8f\x63\xc0"
942+ "\x5f\x63\xb1\xbe\x5e\x4c\x0e\xa1\xdf\x28\x8c\x1b\xfa\xf9\x95\x88"
943+ "\x74\xa0\x0f\xbf\xaf\xc3\x36\x76\x4a\xa1\x59\xf1\x1c\xa4\x58\x26"
944+ "\x79\x12\x2a\xb7\xc5\x15\x92\xc5",
945+ .c_size = 104,
946+ .public_key_vec = true,
947+ .siggen_sigver_test = true,
948+ }, {
869949 .key = /* secp384r1(sha224) */
870950 "\x04\x69\x6c\xcf\x62\xee\xd0\x0d\xe5\xb5\x2f\x70\x54\xcf\x26\xa0"
871951 "\xd9\x98\x8d\x92\x2a\xab\x9b\x11\xcb\x48\x18\xa1\xa9\x0d\xd5\x18"
drivers/acpi/acpica/dbnames.c+6−2
@@ -550,8 +550,12 @@ acpi_db_walk_for_fields(acpi_handle obj_handle, · 549 unmodified lines
550550 ACPI_FREE(buffer.pointer);
551551
552552 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
553− acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
554−
553+ status = acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
554+ if (ACPI_FAILURE(status)) {
555+ acpi_os_printf("Could Not evaluate object %p\n",
556+ obj_handle);
557+ return (AE_OK);
558+ }
555559 /*
556560 * Since this is a field unit, surround the output in braces
557561 */
drivers/acpi/apei/einj-core.c+1−1
@@ -851,7 +851,7 @@ err_put_table: · 850 unmodified lines
851851 return rc;
852852 }
853853
854−static void __exit einj_remove(struct platform_device *pdev)
854+static void einj_remove(struct platform_device *pdev)
855855 {
856856 struct apei_exec_context ctx;
857857
drivers/ata/libata-eh.c+4−1
@@ -712,8 +712,10 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap) · 711 unmodified lines
712712 ehc->saved_ncq_enabled |= 1 << devno;
713713
714714 /* If we are resuming, wake up the device */
715− if (ap->pflags & ATA_PFLAG_RESUMING)
715+ if (ap->pflags & ATA_PFLAG_RESUMING) {
716+ dev->flags |= ATA_DFLAG_RESUMING;
716717 ehc->i.dev_action[devno] |= ATA_EH_SET_ACTIVE;
718+ }
717719 }
718720 }
719721
@@ -3169,6 +3171,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, · 2449 unmodified lines
31693171 return 0;
31703172
31713173 err:
3174+ dev->flags &= ~ATA_DFLAG_RESUMING;
31723175 *r_failed_dev = dev;
31733176 return rc;
31743177 }
drivers/ata/libata-scsi.c+9−0
@@ -4730,6 +4730,7 @@ void ata_scsi_dev_rescan(struct work_struct *work) · 4729 unmodified lines
47304730 struct ata_link *link;
47314731 struct ata_device *dev;
47324732 unsigned long flags;
4733+ bool do_resume;
47334734 int ret = 0;
47344735
47354736 mutex_lock(&ap->scsi_scan_mutex);
@@ -4751,7 +4752,15 @@ void ata_scsi_dev_rescan(struct work_struct *work) · 15 unmodified lines
47514752 if (scsi_device_get(sdev))
47524753 continue;
47534754
4755+ do_resume = dev->flags & ATA_DFLAG_RESUMING;
4756+
47544757 spin_unlock_irqrestore(ap->lock, flags);
4758+ if (do_resume) {
4759+ ret = scsi_resume_device(sdev);
4760+ if (ret == -EWOULDBLOCK)
4761+ goto unlock;
4762+ dev->flags &= ~ATA_DFLAG_RESUMING;
4763+ }
47554764 ret = scsi_rescan_device(sdev);
47564765 scsi_device_put(sdev);
47574766 spin_lock_irqsave(ap->lock, flags);
drivers/crypto/intel/iaa/iaa_crypto_main.c+7−3
@@ -806,6 +806,8 @@ static int save_iaa_wq(struct idxd_wq *wq) · 805 unmodified lines
806806 return -EINVAL;
807807
808808 cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa;
809+ if (!cpus_per_iaa)
810+ cpus_per_iaa = 1;
809811 out:
810812 return 0;
811813 }
@@ -821,10 +823,12 @@ static void remove_iaa_wq(struct idxd_wq *wq) · 9 unmodified lines
821823 }
822824 }
823825
824− if (nr_iaa)
826+ if (nr_iaa) {
825827 cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa;
826− else
827− cpus_per_iaa = 0;
828+ if (!cpus_per_iaa)
829+ cpus_per_iaa = 1;
830+ } else
831+ cpus_per_iaa = 1;
828832 }
829833
830834 static int wq_table_add_wqs(int iaa, int cpu)
drivers/cxl/Kconfig+0−13
@@ -144,17 +144,4 @@ config CXL_REGION_INVALIDATION_TEST · 143 unmodified lines
144144 If unsure, or if this kernel is meant for production environments,
145145 say N.
146146
147−config CXL_PMU
148− tristate "CXL Performance Monitoring Unit"
149− default CXL_BUS
150− depends on PERF_EVENTS
151− help
152− Support performance monitoring as defined in CXL rev 3.0
153− section 13.2: Performance Monitoring. CXL components may have
154− one or more CXL Performance Monitoring Units (CPMUs).
155−
156− Say 'y/m' to enable a driver that will attach to performance
157− monitoring units and provide standard perf based interfaces.
158−
159− If unsure say 'm'.
160147 endif
drivers/dma-buf/st-dma-fence-chain.c+3−3
@@ -84,11 +84,11 @@ static int sanitycheck(void *arg) · 83 unmodified lines
8484 return -ENOMEM;
8585
8686 chain = mock_chain(NULL, f, 1);
87− if (!chain)
87+ if (chain)
88+ dma_fence_enable_sw_signaling(chain);
89+ else
8890 err = -ENOMEM;
8991
90− dma_fence_enable_sw_signaling(chain);
91−
9292 dma_fence_signal(f);
9393 dma_fence_put(f);
9494
drivers/dpll/Kconfig+1−1
@@ -4,4 +4,4 @@ · 3 unmodified lines
44 #
55
66 config DPLL
7− bool
7+ bool
drivers/firmware/efi/libstub/randomalloc.c+1−1
@@ -120,7 +120,7 @@ efi_status_t efi_random_alloc(unsigned long size, · 119 unmodified lines
120120 continue;
121121 }
122122
123− target = round_up(max(md->phys_addr, alloc_min), align) + target_slot * align;
123+ target = round_up(max_t(u64, md->phys_addr, alloc_min), align) + target_slot * align;
124124 pages = size / EFI_PAGE_SIZE;
125125
126126 status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
drivers/firmware/efi/libstub/x86-stub.c+1−0
@@ -496,6 +496,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 495 unmodified lines
496496 hdr->vid_mode = 0xffff;
497497
498498 hdr->type_of_loader = 0x21;
499+ hdr->initrd_addr_max = INT_MAX;
499500
500501 /* Convert unicode cmdline to ascii */
501502 cmdline_ptr = efi_convert_cmdline(image, &options_size);
drivers/gpio/gpiolib-cdev.c+32−6
@@ -1083,10 +1083,20 @@ static u32 gpio_v2_line_config_debounce_period(struct gpio_v2_line_config *lc, · 1082 unmodified lines
10831083 return 0;
10841084 }
10851085
1086+static inline char *make_irq_label(const char *orig)
1087+{
1088+ return kstrdup_and_replace(orig, '/', ':', GFP_KERNEL);
1089+}
1090+
1091+static inline void free_irq_label(const char *label)
1092+{
1093+ kfree(label);
1094+}
1095+
10861096 static void edge_detector_stop(struct line *line)
10871097 {
10881098 if (line->irq) {
1089− free_irq(line->irq, line);
1099+ free_irq_label(free_irq(line->irq, line));
10901100 line->irq = 0;
10911101 }
10921102
@@ -1110,6 +1120,7 @@ static int edge_detector_setup(struct line *line, · 17 unmodified lines
11101120 unsigned long irqflags = 0;
11111121 u64 eflags;
11121122 int irq, ret;
1123+ char *label;
11131124
11141125 eflags = edflags & GPIO_V2_LINE_EDGE_FLAGS;
11151126 if (eflags && !kfifo_initialized(&line->req->events)) {
@@ -1146,11 +1157,17 @@ static int edge_detector_setup(struct line *line, · 30 unmodified lines
11461157 IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING;
11471158 irqflags |= IRQF_ONESHOT;
11481159
1160+ label = make_irq_label(line->req->label);
1161+ if (!label)
1162+ return -ENOMEM;
1163+
11491164 /* Request a thread to read the events */
11501165 ret = request_threaded_irq(irq, edge_irq_handler, edge_irq_thread,
1151− irqflags, line->req->label, line);
1152− if (ret)
1166+ irqflags, label, line);
1167+ if (ret) {
1168+ free_irq_label(label);
11531169 return ret;
1170+ }
11541171
11551172 line->irq = irq;
11561173 return 0;
@@ -1973,7 +1990,7 @@ static void lineevent_free(struct lineevent_state *le) · 816 unmodified lines
19731990 blocking_notifier_chain_unregister(&le->gdev->device_notifier,
19741991 &le->device_unregistered_nb);
19751992 if (le->irq)
1976− free_irq(le->irq, le);
1993+ free_irq_label(free_irq(le->irq, le));
19771994 if (le->desc)
19781995 gpiod_free(le->desc);
19791996 kfree(le->label);
@@ -2114,6 +2131,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) · 134 unmodified lines
21142131 int fd;
21152132 int ret;
21162133 int irq, irqflags = 0;
2134+ char *label;
21172135
21182136 if (copy_from_user(&eventreq, ip, sizeof(eventreq)))
21192137 return -EFAULT;
@@ -2198,15 +2216,23 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) · 78 unmodified lines
21982216 if (ret)
21992217 goto out_free_le;
22002218
2219+ label = make_irq_label(le->label);
2220+ if (!label) {
2221+ ret = -ENOMEM;
2222+ goto out_free_le;
2223+ }
2224+
22012225 /* Request a thread to read the events */
22022226 ret = request_threaded_irq(irq,
22032227 lineevent_irq_handler,
22042228 lineevent_irq_thread,
22052229 irqflags,
2206− le->label,
2230+ label,
22072231 le);
2208− if (ret)
2232+ if (ret) {
2233+ free_irq_label(label);
22092234 goto out_free_le;
2235+ }
22102236
22112237 le->irq = irq;
22122238
drivers/gpio/gpiolib.c+18−14
@@ -2397,6 +2397,11 @@ char *gpiochip_dup_line_label(struct gpio_chip *gc, unsigned int offset) · 2396 unmodified lines
23972397 }
23982398 EXPORT_SYMBOL_GPL(gpiochip_dup_line_label);
23992399
2400+static inline const char *function_name_or_default(const char *con_id)
2401+{
2402+ return con_id ?: "(default)";
2403+}
2404+
24002405 /**
24012406 * gpiochip_request_own_desc - Allow GPIO chip to request its own descriptor
24022407 * @gc: GPIO chip
@@ -2425,10 +2430,11 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, · 22 unmodified lines
24252430 enum gpiod_flags dflags)
24262431 {
24272432 struct gpio_desc *desc = gpiochip_get_desc(gc, hwnum);
2433+ const char *name = function_name_or_default(label);
24282434 int ret;
24292435
24302436 if (IS_ERR(desc)) {
2431− chip_err(gc, "failed to get GPIO descriptor\n");
2437+ chip_err(gc, "failed to get GPIO %s descriptor\n", name);
24322438 return desc;
24332439 }
24342440
@@ -2438,8 +2444,8 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc, · 3 unmodified lines
24382444
24392445 ret = gpiod_configure_flags(desc, label, lflags, dflags);
24402446 if (ret) {
2441− chip_err(gc, "setup of own GPIO %s failed\n", label);
24422447 gpiod_free_commit(desc);
2448+ chip_err(gc, "setup of own GPIO %s failed\n", name);
24432449 return ERR_PTR(ret);
24442450 }
24452451
@@ -4153,19 +4159,17 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode, · 1707 unmodified lines
41534159 enum gpiod_flags *flags,
41544160 unsigned long *lookupflags)
41554161 {
4162+ const char *name = function_name_or_default(con_id);
41564163 struct gpio_desc *desc = ERR_PTR(-ENOENT);
41574164
41584165 if (is_of_node(fwnode)) {
4159− dev_dbg(consumer, "using DT '%pfw' for '%s' GPIO lookup\n",
4160− fwnode, con_id);
4166+ dev_dbg(consumer, "using DT '%pfw' for '%s' GPIO lookup\n", fwnode, name);
41614167 desc = of_find_gpio(to_of_node(fwnode), con_id, idx, lookupflags);
41624168 } else if (is_acpi_node(fwnode)) {
4163− dev_dbg(consumer, "using ACPI '%pfw' for '%s' GPIO lookup\n",
4164− fwnode, con_id);
4169+ dev_dbg(consumer, "using ACPI '%pfw' for '%s' GPIO lookup\n", fwnode, name);
41654170 desc = acpi_find_gpio(fwnode, con_id, idx, flags, lookupflags);
41664171 } else if (is_software_node(fwnode)) {
4167− dev_dbg(consumer, "using swnode '%pfw' for '%s' GPIO lookup\n",
4168− fwnode, con_id);
4172+ dev_dbg(consumer, "using swnode '%pfw' for '%s' GPIO lookup\n", fwnode, name);
41694173 desc = swnode_find_gpio(fwnode, con_id, idx, lookupflags);
41704174 }
41714175
@@ -4181,6 +4185,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer, · 9 unmodified lines
41814185 bool platform_lookup_allowed)
41824186 {
41834187 unsigned long lookupflags = GPIO_LOOKUP_FLAGS_DEFAULT;
4188+ const char *name = function_name_or_default(con_id);
41844189 /*
41854190 * scoped_guard() is implemented as a for loop, meaning static
41864191 * analyzers will complain about these two not being initialized.
@@ -4203,8 +4208,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer, · 16 unmodified lines
42034208 }
42044209
42054210 if (IS_ERR(desc)) {
4206− dev_dbg(consumer, "No GPIO consumer %s found\n",
4207− con_id);
4211+ dev_dbg(consumer, "No GPIO consumer %s found\n", name);
42084212 return desc;
42094213 }
42104214
@@ -4226,15 +4230,14 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer, · 15 unmodified lines
42264230 *
42274231 * FIXME: Make this more sane and safe.
42284232 */
4229− dev_info(consumer,
4230− "nonexclusive access to GPIO for %s\n", con_id);
4233+ dev_info(consumer, "nonexclusive access to GPIO for %s\n", name);
42314234 return desc;
42324235 }
42334236
42344237 ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
42354238 if (ret < 0) {
4236− dev_dbg(consumer, "setup of GPIO %s failed\n", con_id);
42374239 gpiod_put(desc);
4240+ dev_dbg(consumer, "setup of GPIO %s failed\n", name);
42384241 return ERR_PTR(ret);
42394242 }
42404243
@@ -4350,6 +4353,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_optional); · 109 unmodified lines
43504353 int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
43514354 unsigned long lflags, enum gpiod_flags dflags)
43524355 {
4356+ const char *name = function_name_or_default(con_id);
43534357 int ret;
43544358
43554359 if (lflags & GPIO_ACTIVE_LOW)
@@ -4393,7 +4397,7 @@ int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, · 37 unmodified lines
43934397
43944398 /* No particular flag request, return here... */
43954399 if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET)) {
4396− gpiod_dbg(desc, "no flags found for %s\n", con_id);
4400+ gpiod_dbg(desc, "no flags found for GPIO %s\n", name);
43974401 return 0;
43984402 }
43994403
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+2−0
@@ -4539,6 +4539,8 @@ int amdgpu_device_prepare(struct drm_device *dev) · 4538 unmodified lines
45394539 if (r)
45404540 goto unprepare;
45414541
4542+ flush_delayed_work(&adev->gfx.gfx_off_delay_work);
4543+
45424544 for (i = 0; i < adev->num_ip_blocks; i++) {
45434545 if (!adev->ip_blocks[i].status.valid)
45444546 continue;
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+1−0
@@ -2237,6 +2237,7 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev) · 2236 unmodified lines
22372237 {
22382238 switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
22392239 case IP_VERSION(4, 0, 5):
2240+ case IP_VERSION(4, 0, 6):
22402241 if (amdgpu_umsch_mm & 0x1) {
22412242 amdgpu_device_ip_block_add(adev, &umsch_mm_v4_0_ip_block);
22422243 adev->enable_umsch_mm = true;
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c+29−17
@@ -524,46 +524,58 @@ static ssize_t amdgpu_debugfs_mqd_read(struct file *f, char __user *buf, · 523 unmodified lines
524524 {
525525 struct amdgpu_ring *ring = file_inode(f)->i_private;
526526 volatile u32 *mqd;
527− int r;
527+ u32 *kbuf;
528+ int r, i;
528529 uint32_t value, result;
529530
530531 if (*pos & 3 || size & 3)
531532 return -EINVAL;
532533
533− result = 0;
534+ kbuf = kmalloc(ring->mqd_size, GFP_KERNEL);
535+ if (!kbuf)
536+ return -ENOMEM;
534537
535538 r = amdgpu_bo_reserve(ring->mqd_obj, false);
536539 if (unlikely(r != 0))
537− return r;
540+ goto err_free;
538541
539542 r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&mqd);
540− if (r) {
541− amdgpu_bo_unreserve(ring->mqd_obj);
542− return r;
543− }
543+ if (r)
544+ goto err_unreserve;
544545
546+ /*
547+ * Copy to local buffer to avoid put_user(), which might fault
548+ * and acquire mmap_sem, under reservation_ww_class_mutex.
549+ */
550+ for (i = 0; i < ring->mqd_size/sizeof(u32); i++)
551+ kbuf[i] = mqd[i];
552+
553+ amdgpu_bo_kunmap(ring->mqd_obj);
554+ amdgpu_bo_unreserve(ring->mqd_obj);
555+
556+ result = 0;
545557 while (size) {
546558 if (*pos >= ring->mqd_size)
547− goto done;
559+ break;
548560
549− value = mqd[*pos/4];
561+ value = kbuf[*pos/4];
550562 r = put_user(value, (uint32_t *)buf);
551563 if (r)
552− goto done;
564+ goto err_free;
553565 buf += 4;
554566 result += 4;
555567 size -= 4;
556568 *pos += 4;
557569 }
558570
559−done:
560− amdgpu_bo_kunmap(ring->mqd_obj);
561− mqd = NULL;
562− amdgpu_bo_unreserve(ring->mqd_obj);
563− if (r)
564− return r;
565−
571+ kfree(kbuf);
566572 return result;
573+
574+err_unreserve:
575+ amdgpu_bo_unreserve(ring->mqd_obj);
576+err_free:
577+ kfree(kbuf);
578+ return r;
567579 }
568580
569581 static const struct file_operations amdgpu_debugfs_mqd_fops = {
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c+10−2
@@ -189,10 +189,13 @@ static void setup_vpe_queue(struct amdgpu_device *adev, · 188 unmodified lines
189189 mqd->rptr_val = 0;
190190 mqd->unmapped = 1;
191191
192+ if (adev->vpe.collaborate_mode)
193+ memcpy(++mqd, test->mqd_data_cpu_addr, sizeof(struct MQD_INFO));
194+
192195 qinfo->mqd_addr = test->mqd_data_gpu_addr;
193196 qinfo->csa_addr = test->ctx_data_gpu_addr +
194197 offsetof(struct umsch_mm_test_ctx_data, vpe_ctx_csa);
195− qinfo->doorbell_offset_0 = (adev->doorbell_index.vpe_ring + 1) << 1;
198+ qinfo->doorbell_offset_0 = 0;
196199 qinfo->doorbell_offset_1 = 0;
197200 }
198201
@@ -287,7 +290,10 @@ static int submit_vpe_queue(struct amdgpu_device *adev, struct umsch_mm_test *te · 88 unmodified lines
287290 ring[5] = 0;
288291
289292 mqd->wptr_val = (6 << 2);
290− // WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
293+ if (adev->vpe.collaborate_mode)
294+ (++mqd)->wptr_val = (6 << 2);
295+
296+ WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
291297
292298 for (i = 0; i < adev->usec_timeout; i++) {
293299 if (*fence == test_pattern)
@@ -571,6 +577,7 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch) · 277 unmodified lines
571577
572578 switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
573579 case IP_VERSION(4, 0, 5):
580+ case IP_VERSION(4, 0, 6):
574581 fw_name = "amdgpu/umsch_mm_4_0_0.bin";
575582 break;
576583 default:
@@ -750,6 +757,7 @@ static int umsch_mm_early_init(void *handle) · 173 unmodified lines
750757
751758 switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
752759 case IP_VERSION(4, 0, 5):
760+ case IP_VERSION(4, 0, 6):
753761 umsch_mm_v4_0_set_funcs(&adev->umsch_mm);
754762 break;
755763 default:
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h+10−10
@@ -33,13 +33,6 @@ enum UMSCH_SWIP_ENGINE_TYPE { · 32 unmodified lines
3333 UMSCH_SWIP_ENGINE_TYPE_MAX
3434 };
3535
36−enum UMSCH_SWIP_AFFINITY_TYPE {
37− UMSCH_SWIP_AFFINITY_TYPE_ANY = 0,
38− UMSCH_SWIP_AFFINITY_TYPE_VCN0 = 1,
39− UMSCH_SWIP_AFFINITY_TYPE_VCN1 = 2,
40− UMSCH_SWIP_AFFINITY_TYPE_MAX
41−};
42−
4336 enum UMSCH_CONTEXT_PRIORITY_LEVEL {
4437 CONTEXT_PRIORITY_LEVEL_IDLE = 0,
4538 CONTEXT_PRIORITY_LEVEL_NORMAL = 1,
@@ -51,13 +44,15 @@ enum UMSCH_CONTEXT_PRIORITY_LEVEL { · 5 unmodified lines
5144 struct umsch_mm_set_resource_input {
5245 uint32_t vmid_mask_mm_vcn;
5346 uint32_t vmid_mask_mm_vpe;
47+ uint32_t collaboration_mask_vpe;
5448 uint32_t logging_vmid;
5549 uint32_t engine_mask;
5650 union {
5751 struct {
5852 uint32_t disable_reset : 1;
5953 uint32_t disable_umsch_mm_log : 1;
60− uint32_t reserved : 30;
54+ uint32_t use_rs64mem_for_proc_ctx_csa : 1;
55+ uint32_t reserved : 29;
6156 };
6257 uint32_t uint32_all;
6358 };
@@ -78,15 +73,18 @@ struct umsch_mm_add_queue_input { · 14 unmodified lines
7873 uint32_t doorbell_offset_1;
7974 enum UMSCH_SWIP_ENGINE_TYPE engine_type;
8075 uint32_t affinity;
81− enum UMSCH_SWIP_AFFINITY_TYPE affinity_type;
8276 uint64_t mqd_addr;
8377 uint64_t h_context;
8478 uint64_t h_queue;
8579 uint32_t vm_context_cntl;
8680
81+ uint32_t process_csa_array_index;
82+ uint32_t context_csa_array_index;
83+
8784 struct {
8885 uint32_t is_context_suspended : 1;
89− uint32_t reserved : 31;
86+ uint32_t collaboration_mode : 1;
87+ uint32_t reserved : 30;
9088 };
9189 };
9290
@@ -94,6 +92,7 @@ struct umsch_mm_remove_queue_input { · 1 unmodified line
9492 uint32_t doorbell_offset_0;
9593 uint32_t doorbell_offset_1;
9694 uint64_t context_csa_addr;
95+ uint32_t context_csa_array_index;
9796 };
9897
9998 struct MQD_INFO {
@@ -103,6 +102,7 @@ struct MQD_INFO { · 3 unmodified lines
103102 uint32_t wptr_val;
104103 uint32_t rptr_val;
105104 uint32_t unmapped;
105+ uint32_t vmid;
106106 };
107107
108108 struct amdgpu_umsch_mm;
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c+6−0
@@ -396,6 +396,12 @@ static int vpe_hw_init(void *handle) · 395 unmodified lines
396396 struct amdgpu_vpe *vpe = &adev->vpe;
397397 int ret;
398398
399+ /* Power on VPE */
400+ ret = amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VPE,
401+ AMD_PG_STATE_UNGATE);
402+ if (ret)
403+ return ret;
404+
399405 ret = vpe_load_microcode(vpe);
400406 if (ret)
401407 return ret;
drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c+5−2
@@ -60,7 +60,7 @@ static int umsch_mm_v4_0_load_microcode(struct amdgpu_umsch_mm *umsch) · 59 unmodified lines
6060
6161 umsch->cmd_buf_curr_ptr = umsch->cmd_buf_ptr;
6262
63− if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
63+ if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
6464 WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
6565 1 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
6666 SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
@@ -248,7 +248,7 @@ static int umsch_mm_v4_0_ring_stop(struct amdgpu_umsch_mm *umsch) · 181 unmodified lines
248248 data = REG_SET_FIELD(data, VCN_UMSCH_RB_DB_CTRL, EN, 0);
249249 WREG32_SOC15(VCN, 0, regVCN_UMSCH_RB_DB_CTRL, data);
250250
251− if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
251+ if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
252252 WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
253253 2 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
254254 SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
@@ -271,6 +271,8 @@ static int umsch_mm_v4_0_set_hw_resources(struct amdgpu_umsch_mm *umsch) · 16 unmodified lines
271271
272272 set_hw_resources.vmid_mask_mm_vcn = umsch->vmid_mask_mm_vcn;
273273 set_hw_resources.vmid_mask_mm_vpe = umsch->vmid_mask_mm_vpe;
274+ set_hw_resources.collaboration_mask_vpe =
275+ adev->vpe.collaborate_mode ? 0x3 : 0x0;
274276 set_hw_resources.engine_mask = umsch->engine_mask;
275277
276278 set_hw_resources.vcn0_hqd_mask[0] = umsch->vcn0_hqd_mask;
@@ -346,6 +348,7 @@ static int umsch_mm_v4_0_add_queue(struct amdgpu_umsch_mm *umsch, · 69 unmodified lines
346348 add_queue.h_queue = input_ptr->h_queue;
347349 add_queue.vm_context_cntl = input_ptr->vm_context_cntl;
348350 add_queue.is_context_suspended = input_ptr->is_context_suspended;
351+ add_queue.collaboration_mode = adev->vpe.collaborate_mode ? 1 : 0;
349352
350353 add_queue.api_status.api_completion_fence_addr = umsch->ring.fence_drv.gpu_addr;
351354 add_queue.api_status.api_completion_fence_value = ++umsch->ring.fence_drv.sync_seq;
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+2−2
@@ -1523,7 +1523,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep, · 1522 unmodified lines
15231523
15241524 /* Find a KFD GPU device that supports the get_dmabuf_info query */
15251525 for (i = 0; kfd_topology_enum_kfd_devices(i, &dev) == 0; i++)
1526− if (dev)
1526+ if (dev && !kfd_devcgroup_check_permission(dev))
15271527 break;
15281528 if (!dev)
15291529 return -EINVAL;
@@ -1545,7 +1545,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep, · 15 unmodified lines
15451545 if (xcp_id >= 0)
15461546 args->gpu_id = dmabuf_adev->kfd.dev->nodes[xcp_id]->id;
15471547 else
1548− args->gpu_id = dmabuf_adev->kfd.dev->nodes[0]->id;
1548+ args->gpu_id = dev->id;
15491549 args->flags = flags;
15501550
15511551 /* Copy metadata buffer to user mode */
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c+2−1
@@ -339,7 +339,8 @@ static void event_interrupt_wq_v10(struct kfd_node *dev, · 338 unmodified lines
339339 break;
340340 }
341341 kfd_signal_event_interrupt(pasid, context_id0 & 0x7fffff, 23);
342− } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
342+ } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
343+ KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
343344 kfd_set_dbg_ev_from_interrupt(dev, pasid,
344345 KFD_DEBUG_DOORBELL_ID(context_id0),
345346 KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c+2−1
@@ -328,7 +328,8 @@ static void event_interrupt_wq_v11(struct kfd_node *dev, · 327 unmodified lines
328328 /* CP */
329329 if (source_id == SOC15_INTSRC_CP_END_OF_PIPE)
330330 kfd_signal_event_interrupt(pasid, context_id0, 32);
331− else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE)
331+ else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
332+ KFD_DBG_EC_TYPE_IS_PACKET(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)))
332333 kfd_set_dbg_ev_from_interrupt(dev, pasid,
333334 KFD_CTXID0_DOORBELL_ID(context_id0),
334335 KFD_EC_MASK(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)),
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c+2−1
@@ -388,7 +388,8 @@ static void event_interrupt_wq_v9(struct kfd_node *dev, · 387 unmodified lines
388388 break;
389389 }
390390 kfd_signal_event_interrupt(pasid, sq_int_data, 24);
391− } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
391+ } else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
392+ KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
392393 kfd_set_dbg_ev_from_interrupt(dev, pasid,
393394 KFD_DEBUG_DOORBELL_ID(context_id0),
394395 KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),
drivers/gpu/drm/amd/amdkfd/kfd_priv.h+1−1
@@ -1473,7 +1473,7 @@ static inline void kfd_flush_tlb(struct kfd_process_device *pdd, · 1472 unmodified lines
14731473
14741474 static inline bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev)
14751475 {
1476− return KFD_GC_VERSION(dev) > IP_VERSION(9, 4, 2) ||
1476+ return KFD_GC_VERSION(dev) >= IP_VERSION(9, 4, 2) ||
14771477 (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) && dev->sdma_fw_version >= 18) ||
14781478 KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
14791479 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+3−5
@@ -6305,9 +6305,8 @@ create_stream_for_sink(struct drm_connector *connector, · 6304 unmodified lines
63056305
63066306 if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
63076307 mod_build_hf_vsif_infopacket(stream, &stream->vsp_infopacket);
6308− else if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
6309− stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
6310− stream->signal == SIGNAL_TYPE_EDP) {
6308+
6309+ if (stream->link->psr_settings.psr_feature_enabled || stream->link->replay_settings.replay_feature_enabled) {
63116310 //
63126311 // should decide stream support vsc sdp colorimetry capability
63136312 // before building vsc info packet
@@ -6323,9 +6322,8 @@ create_stream_for_sink(struct drm_connector *connector, · 9 unmodified lines
63236322 if (stream->out_transfer_func->tf == TRANSFER_FUNCTION_GAMMA22)
63246323 tf = TRANSFER_FUNC_GAMMA_22;
63256324 mod_build_vsc_infopacket(stream, &stream->vsc_infopacket, stream->output_color_space, tf);
6325+ aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
63266326
6327− if (stream->link->psr_settings.psr_feature_enabled)
6328− aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
63296327 }
63306328 finish:
63316329 dc_sink_release(sink);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c+5−3
@@ -141,9 +141,8 @@ bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream) · 140 unmodified lines
141141 * amdgpu_dm_psr_enable() - enable psr f/w
142142 * @stream: stream state
143143 *
144− * Return: true if success
145144 */
146−bool amdgpu_dm_psr_enable(struct dc_stream_state *stream)
145+void amdgpu_dm_psr_enable(struct dc_stream_state *stream)
147146 {
148147 struct dc_link *link = stream->link;
149148 unsigned int vsync_rate_hz = 0;
@@ -190,7 +189,10 @@ bool amdgpu_dm_psr_enable(struct dc_stream_state *stream) · 40 unmodified lines
190189 if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1)
191190 power_opt |= psr_power_opt_z10_static_screen;
192191
193− return dc_link_set_psr_allow_active(link, &psr_enable, false, false, &power_opt);
192+ dc_link_set_psr_allow_active(link, &psr_enable, false, false, &power_opt);
193+
194+ if (link->ctx->dc->caps.ips_support)
195+ dc_allow_idle_optimizations(link->ctx->dc, true);
194196 }
195197
196198 /*
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #define AMDGPU_DM_PSR_ENTRY_DELAY 5
3333
3434 void amdgpu_dm_set_psr_caps(struct dc_link *link);
35−bool amdgpu_dm_psr_enable(struct dc_stream_state *stream);
35+void amdgpu_dm_psr_enable(struct dc_stream_state *stream);
3636 bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream);
3737 bool amdgpu_dm_psr_disable(struct dc_stream_state *stream);
3838 bool amdgpu_dm_psr_disable_all(struct amdgpu_display_manager *dm);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c+6−1
@@ -73,6 +73,8 @@ · 72 unmodified lines
7373 #define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL_MASK 0x00000007L
7474 #define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV_MASK 0x000F0000L
7575
76+#define SMU_VER_THRESHOLD 0x5D4A00 //93.74.0
77+
7678 #define REG(reg_name) \
7779 (ctx->clk_reg_offsets[reg ## reg_name ## _BASE_IDX] + reg ## reg_name)
7880
@@ -411,9 +413,12 @@ static void dcn35_dump_clk_registers(struct clk_state_registers_and_bypass *regs · 332 unmodified lines
411413
412414 static void init_clk_states(struct clk_mgr *clk_mgr)
413415 {
416+ struct clk_mgr_internal *clk_mgr_int = TO_CLK_MGR_INTERNAL(clk_mgr);
414417 uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;
415418 memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
416419
420+ if (clk_mgr_int->smu_ver >= SMU_VER_THRESHOLD)
421+ clk_mgr->clks.dtbclk_en = true; // request DTBCLK disable on first commit
417422 clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk; // restore ref_dtbclk
418423 clk_mgr->clks.p_state_change_support = true;
419424 clk_mgr->clks.prev_p_state_change_support = true;
@@ -709,7 +714,7 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk · 289 unmodified lines
709714 clock_table->NumFclkLevelsEnabled;
710715 max_fclk = find_max_clk_value(clock_table->FclkClocks_Freq, num_fclk);
711716
712− num_dcfclk = (clock_table->NumFclkLevelsEnabled > NUM_DCFCLK_DPM_LEVELS) ? NUM_DCFCLK_DPM_LEVELS :
717+ num_dcfclk = (clock_table->NumDcfClkLevelsEnabled > NUM_DCFCLK_DPM_LEVELS) ? NUM_DCFCLK_DPM_LEVELS :
713718 clock_table->NumDcfClkLevelsEnabled;
714719 for (i = 0; i < num_dcfclk; i++) {
715720 int j;
drivers/gpu/drm/amd/display/dc/core/dc.c+4−2
@@ -3024,7 +3024,8 @@ static void backup_planes_and_stream_state( · 3023 unmodified lines
30243024 scratch->blend_tf[i] = *status->plane_states[i]->blend_tf;
30253025 }
30263026 scratch->stream_state = *stream;
3027− scratch->out_transfer_func = *stream->out_transfer_func;
3027+ if (stream->out_transfer_func)
3028+ scratch->out_transfer_func = *stream->out_transfer_func;
30283029 }
30293030
30303031 static void restore_planes_and_stream_state(
@@ -3046,7 +3047,8 @@ static void restore_planes_and_stream_state( · 15 unmodified lines
30463047 *status->plane_states[i]->blend_tf = scratch->blend_tf[i];
30473048 }
30483049 *stream = scratch->stream_state;
3049− *stream->out_transfer_func = scratch->out_transfer_func;
3050+ if (stream->out_transfer_func)
3051+ *stream->out_transfer_func = scratch->out_transfer_func;
30503052 }
30513053
30523054 static bool update_planes_and_stream_state(struct dc *dc,
drivers/gpu/drm/amd/display/dc/dce110/Makefile+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 # Makefile for the 'controller' sub-component of DAL.
2424 # It provides the control and status of HW CRTC block.
2525
26−CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = $(call cc-disable-warning, override-init)
26+CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = -Wno-override-init
2727
2828 DCE110 = dce110_timing_generator.o \
2929 dce110_compressor.o dce110_opp_regamma_v.o \
drivers/gpu/drm/amd/display/dc/dce112/Makefile+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 # Makefile for the 'controller' sub-component of DAL.
2424 # It provides the control and status of HW CRTC block.
2525
26−CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = $(call cc-disable-warning, override-init)
26+CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = -Wno-override-init
2727
2828 DCE112 = dce112_compressor.o
2929
drivers/gpu/drm/amd/display/dc/dce120/Makefile+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 # It provides the control and status of HW CRTC block.
2525
2626
27−CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call cc-disable-warning, override-init)
27+CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = -Wno-override-init
2828
2929 DCE120 = dce120_timing_generator.o
3030
drivers/gpu/drm/amd/display/dc/dce60/Makefile+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 # Makefile for the 'controller' sub-component of DAL.
2424 # It provides the control and status of HW CRTC block.
2525
26−CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init)
26+CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = -Wno-override-init
2727
2828 DCE60 = dce60_timing_generator.o dce60_hw_sequencer.o \
2929 dce60_resource.o
drivers/gpu/drm/amd/display/dc/dce80/Makefile+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 # Makefile for the 'controller' sub-component of DAL.
2424 # It provides the control and status of HW CRTC block.
2525
26−CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = $(call cc-disable-warning, override-init)
26+CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = -Wno-override-init
2727
2828 DCE80 = dce80_timing_generator.o
2929
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c+32−22
@@ -44,6 +44,36 @@ · 43 unmodified lines
4444 #define NUM_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
4545
4646
47+void mpc3_mpc_init(struct mpc *mpc)
48+{
49+ struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
50+ int opp_id;
51+
52+ mpc1_mpc_init(mpc);
53+
54+ for (opp_id = 0; opp_id < MAX_OPP; opp_id++) {
55+ if (REG(MUX[opp_id]))
56+ /* disable mpc out rate and flow control */
57+ REG_UPDATE_2(MUX[opp_id], MPC_OUT_RATE_CONTROL_DISABLE,
58+ 1, MPC_OUT_FLOW_CONTROL_COUNT, 0);
59+ }
60+}
61+
62+void mpc3_mpc_init_single_inst(struct mpc *mpc, unsigned int mpcc_id)
63+{
64+ struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
65+
66+ mpc1_mpc_init_single_inst(mpc, mpcc_id);
67+
68+ /* assuming mpc out mux is connected to opp with the same index at this
69+ * point in time (e.g. transitioning from vbios to driver)
70+ */
71+ if (mpcc_id < MAX_OPP && REG(MUX[mpcc_id]))
72+ /* disable mpc out rate and flow control */
73+ REG_UPDATE_2(MUX[mpcc_id], MPC_OUT_RATE_CONTROL_DISABLE,
74+ 1, MPC_OUT_FLOW_CONTROL_COUNT, 0);
75+}
76+
4777 bool mpc3_is_dwb_idle(
4878 struct mpc *mpc,
4979 int dwb_id)
@@ -80,25 +110,6 @@ void mpc3_disable_dwb_mux( · 30 unmodified lines
80110 MPC_DWB0_MUX, 0xf);
81111 }
82112
83−void mpc3_set_out_rate_control(
84− struct mpc *mpc,
85− int opp_id,
86− bool enable,
87− bool rate_2x_mode,
88− struct mpc_dwb_flow_control *flow_control)
89−{
90− struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
91−
92− REG_UPDATE_2(MUX[opp_id],
93− MPC_OUT_RATE_CONTROL_DISABLE, !enable,
94− MPC_OUT_RATE_CONTROL, rate_2x_mode);
95−
96− if (flow_control)
97− REG_UPDATE_2(MUX[opp_id],
98− MPC_OUT_FLOW_CONTROL_MODE, flow_control->flow_ctrl_mode,
99− MPC_OUT_FLOW_CONTROL_COUNT, flow_control->flow_ctrl_cnt1);
100−}
101−
102113 enum dc_lut_mode mpc3_get_ogam_current(struct mpc *mpc, int mpcc_id)
103114 {
104115 /*Contrary to DCN2 and DCN1 wherein a single status register field holds this info;
@@ -1490,8 +1501,8 @@ static const struct mpc_funcs dcn30_mpc_funcs = { · 1385 unmodified lines
14901501 .read_mpcc_state = mpc3_read_mpcc_state,
14911502 .insert_plane = mpc1_insert_plane,
14921503 .remove_mpcc = mpc1_remove_mpcc,
1493− .mpc_init = mpc1_mpc_init,
1494− .mpc_init_single_inst = mpc1_mpc_init_single_inst,
1504+ .mpc_init = mpc3_mpc_init,
1505+ .mpc_init_single_inst = mpc3_mpc_init_single_inst,
14951506 .update_blending = mpc2_update_blending,
14961507 .cursor_lock = mpc1_cursor_lock,
14971508 .get_mpcc_for_dpp = mpc1_get_mpcc_for_dpp,
@@ -1508,7 +1519,6 @@ static const struct mpc_funcs dcn30_mpc_funcs = { · 10 unmodified lines
15081519 .set_dwb_mux = mpc3_set_dwb_mux,
15091520 .disable_dwb_mux = mpc3_disable_dwb_mux,
15101521 .is_dwb_idle = mpc3_is_dwb_idle,
1511− .set_out_rate_control = mpc3_set_out_rate_control,
15121522 .set_gamut_remap = mpc3_set_gamut_remap,
15131523 .program_shaper = mpc3_program_shaper,
15141524 .acquire_rmu = mpcc3_acquire_rmu,
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h+7−7
@@ -1007,6 +1007,13 @@ void dcn30_mpc_construct(struct dcn30_mpc *mpc30, · 1006 unmodified lines
10071007 int num_mpcc,
10081008 int num_rmu);
10091009
1010+void mpc3_mpc_init(
1011+ struct mpc *mpc);
1012+
1013+void mpc3_mpc_init_single_inst(
1014+ struct mpc *mpc,
1015+ unsigned int mpcc_id);
1016+
10101017 bool mpc3_program_shaper(
10111018 struct mpc *mpc,
10121019 const struct pwl_params *params,
@@ -1078,13 +1085,6 @@ bool mpc3_is_dwb_idle( · 65 unmodified lines
10781085 struct mpc *mpc,
10791086 int dwb_id);
10801087
1081−void mpc3_set_out_rate_control(
1082− struct mpc *mpc,
1083− int opp_id,
1084− bool enable,
1085− bool rate_2x_mode,
1086− struct mpc_dwb_flow_control *flow_control);
1087−
10881088 void mpc3_power_on_ogam_lut(
10891089 struct mpc *mpc, int mpcc_id,
10901090 bool power_on);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c+2−3
@@ -47,7 +47,7 @@ void mpc32_mpc_init(struct mpc *mpc) · 46 unmodified lines
4747 struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
4848 int mpcc_id;
4949
50− mpc1_mpc_init(mpc);
50+ mpc3_mpc_init(mpc);
5151
5252 if (mpc->ctx->dc->debug.enable_mem_low_power.bits.mpc) {
5353 if (mpc30->mpc_mask->MPCC_MCM_SHAPER_MEM_LOW_PWR_MODE && mpc30->mpc_mask->MPCC_MCM_3DLUT_MEM_LOW_PWR_MODE) {
@@ -991,7 +991,7 @@ static const struct mpc_funcs dcn32_mpc_funcs = { · 937 unmodified lines
991991 .insert_plane = mpc1_insert_plane,
992992 .remove_mpcc = mpc1_remove_mpcc,
993993 .mpc_init = mpc32_mpc_init,
994− .mpc_init_single_inst = mpc1_mpc_init_single_inst,
994+ .mpc_init_single_inst = mpc3_mpc_init_single_inst,
995995 .update_blending = mpc2_update_blending,
996996 .cursor_lock = mpc1_cursor_lock,
997997 .get_mpcc_for_dpp = mpc1_get_mpcc_for_dpp,
@@ -1008,7 +1008,6 @@ static const struct mpc_funcs dcn32_mpc_funcs = { · 10 unmodified lines
10081008 .set_dwb_mux = mpc3_set_dwb_mux,
10091009 .disable_dwb_mux = mpc3_disable_dwb_mux,
10101010 .is_dwb_idle = mpc3_is_dwb_idle,
1011− .set_out_rate_control = mpc3_set_out_rate_control,
10121011 .set_gamut_remap = mpc3_set_gamut_remap,
10131012 .program_shaper = mpc32_program_shaper,
10141013 .program_3dlut = mpc32_program_3dlut,
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c+2−2
@@ -166,8 +166,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = { · 165 unmodified lines
166166 .num_states = 5,
167167 .sr_exit_time_us = 28.0,
168168 .sr_enter_plus_exit_time_us = 30.0,
169− .sr_exit_z8_time_us = 210.0,
170− .sr_enter_plus_exit_z8_time_us = 320.0,
169+ .sr_exit_z8_time_us = 250.0,
170+ .sr_enter_plus_exit_z8_time_us = 350.0,
171171 .fclk_change_latency_us = 24.0,
172172 .usr_retraining_latency_us = 2,
173173 .writeback_latency_us = 12.0,
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c+84−19
@@ -98,55 +98,114 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_51_soc = { · 97 unmodified lines
9898 .clock_limits = {
9999 {
100100 .state = 0,
101− .dispclk_mhz = 1200.0,
102− .dppclk_mhz = 1200.0,
101+ .dcfclk_mhz = 400.0,
102+ .fabricclk_mhz = 400.0,
103+ .socclk_mhz = 600.0,
104+ .dram_speed_mts = 3200.0,
105+ .dispclk_mhz = 600.0,
106+ .dppclk_mhz = 600.0,
103107 .phyclk_mhz = 600.0,
104108 .phyclk_d18_mhz = 667.0,
105− .dscclk_mhz = 186.0,
109+ .dscclk_mhz = 200.0,
106110 .dtbclk_mhz = 600.0,
107111 },
108112 {
109113 .state = 1,
110− .dispclk_mhz = 1200.0,
111− .dppclk_mhz = 1200.0,
114+ .dcfclk_mhz = 600.0,
115+ .fabricclk_mhz = 1000.0,
116+ .socclk_mhz = 733.0,
117+ .dram_speed_mts = 6400.0,
118+ .dispclk_mhz = 800.0,
119+ .dppclk_mhz = 800.0,
112120 .phyclk_mhz = 810.0,
113121 .phyclk_d18_mhz = 667.0,
114− .dscclk_mhz = 209.0,
122+ .dscclk_mhz = 266.7,
115123 .dtbclk_mhz = 600.0,
116124 },
117125 {
118126 .state = 2,
119− .dispclk_mhz = 1200.0,
120− .dppclk_mhz = 1200.0,
127+ .dcfclk_mhz = 738.0,
128+ .fabricclk_mhz = 1200.0,
129+ .socclk_mhz = 880.0,
130+ .dram_speed_mts = 7500.0,
131+ .dispclk_mhz = 800.0,
132+ .dppclk_mhz = 800.0,
121133 .phyclk_mhz = 810.0,
122134 .phyclk_d18_mhz = 667.0,
123− .dscclk_mhz = 209.0,
135+ .dscclk_mhz = 266.7,
124136 .dtbclk_mhz = 600.0,
125137 },
126138 {
127139 .state = 3,
128− .dispclk_mhz = 1200.0,
129− .dppclk_mhz = 1200.0,
140+ .dcfclk_mhz = 800.0,
141+ .fabricclk_mhz = 1400.0,
142+ .socclk_mhz = 978.0,
143+ .dram_speed_mts = 7500.0,
144+ .dispclk_mhz = 960.0,
145+ .dppclk_mhz = 960.0,
130146 .phyclk_mhz = 810.0,
131147 .phyclk_d18_mhz = 667.0,
132− .dscclk_mhz = 371.0,
148+ .dscclk_mhz = 320.0,
133149 .dtbclk_mhz = 600.0,
134150 },
135151 {
136152 .state = 4,
153+ .dcfclk_mhz = 873.0,
154+ .fabricclk_mhz = 1600.0,
155+ .socclk_mhz = 1100.0,
156+ .dram_speed_mts = 8533.0,
157+ .dispclk_mhz = 1066.7,
158+ .dppclk_mhz = 1066.7,
159+ .phyclk_mhz = 810.0,
160+ .phyclk_d18_mhz = 667.0,
161+ .dscclk_mhz = 355.6,
162+ .dtbclk_mhz = 600.0,
163+ },
164+ {
165+ .state = 5,
166+ .dcfclk_mhz = 960.0,
167+ .fabricclk_mhz = 1700.0,
168+ .socclk_mhz = 1257.0,
169+ .dram_speed_mts = 8533.0,
137170 .dispclk_mhz = 1200.0,
138171 .dppclk_mhz = 1200.0,
139172 .phyclk_mhz = 810.0,
140173 .phyclk_d18_mhz = 667.0,
141− .dscclk_mhz = 417.0,
174+ .dscclk_mhz = 400.0,
175+ .dtbclk_mhz = 600.0,
176+ },
177+ {
178+ .state = 6,
179+ .dcfclk_mhz = 1067.0,
180+ .fabricclk_mhz = 1850.0,
181+ .socclk_mhz = 1257.0,
182+ .dram_speed_mts = 8533.0,
183+ .dispclk_mhz = 1371.4,
184+ .dppclk_mhz = 1371.4,
185+ .phyclk_mhz = 810.0,
186+ .phyclk_d18_mhz = 667.0,
187+ .dscclk_mhz = 457.1,
188+ .dtbclk_mhz = 600.0,
189+ },
190+ {
191+ .state = 7,
192+ .dcfclk_mhz = 1200.0,
193+ .fabricclk_mhz = 2000.0,
194+ .socclk_mhz = 1467.0,
195+ .dram_speed_mts = 8533.0,
196+ .dispclk_mhz = 1600.0,
197+ .dppclk_mhz = 1600.0,
198+ .phyclk_mhz = 810.0,
199+ .phyclk_d18_mhz = 667.0,
200+ .dscclk_mhz = 533.3,
142201 .dtbclk_mhz = 600.0,
143202 },
144203 },
145− .num_states = 5,
204+ .num_states = 8,
146205 .sr_exit_time_us = 28.0,
147206 .sr_enter_plus_exit_time_us = 30.0,
148− .sr_exit_z8_time_us = 210.0,
149− .sr_enter_plus_exit_z8_time_us = 320.0,
207+ .sr_exit_z8_time_us = 250.0,
208+ .sr_enter_plus_exit_z8_time_us = 350.0,
150209 .fclk_change_latency_us = 24.0,
151210 .usr_retraining_latency_us = 2,
152211 .writeback_latency_us = 12.0,
@@ -177,6 +236,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_51_soc = { · 24 unmodified lines
177236 .do_urgent_latency_adjustment = 0,
178237 .urgent_latency_adjustment_fabric_clock_component_us = 0,
179238 .urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
239+ .num_chans = 4,
240+ .dram_clock_change_latency_us = 11.72,
241+ .dispclk_dppclk_vco_speed_mhz = 2400.0,
180242 };
181243
182244 /*
@@ -340,6 +402,8 @@ void dcn351_update_bw_bounding_box_fpu(struct dc *dc, · 157 unmodified lines
340402 clock_limits[i].socclk_mhz;
341403 dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].memclk_mhz =
342404 clk_table->entries[i].memclk_mhz * clk_table->entries[i].wck_ratio;
405+ dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].dtbclk_mhz =
406+ clock_limits[i].dtbclk_mhz;
343407 dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels =
344408 clk_table->num_entries;
345409 dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_fclk_levels =
@@ -352,6 +416,8 @@ void dcn351_update_bw_bounding_box_fpu(struct dc *dc, · 6 unmodified lines
352416 clk_table->num_entries;
353417 dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_memclk_levels =
354418 clk_table->num_entries;
419+ dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dtbclk_levels =
420+ clk_table->num_entries;
355421 }
356422 }
357423
@@ -551,6 +617,7 @@ void dcn351_decide_zstate_support(struct dc *dc, struct dc_state *context) · 193 unmodified lines
551617 if (context->res_ctx.pipe_ctx[i].plane_state)
552618 plane_count++;
553619 }
620+
554621 /*dcn351 does not support z9/z10*/
555622 if (context->stream_count == 0 || plane_count == 0) {
556623 support = DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY;
@@ -564,11 +631,9 @@ void dcn351_decide_zstate_support(struct dc *dc, struct dc_state *context) · 7 unmodified lines
564631 dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000;
565632 bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency;
566633
567−
568634 /*for psr1/psr-su, we allow z8 and z10 based on latency, for replay with IPS enabled, it will enter ips2*/
569− if (is_pwrseq0 && (is_psr || is_replay))
635+ if (is_pwrseq0 && (is_psr || is_replay))
570636 support = allow_z8 ? allow_z8 : DCN_ZSTATE_SUPPORT_DISALLOW;
571−
572637 }
573638 context->bw_ctx.bw.dcn.clk.zstate_support = support;
574639 }
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c+1−5
@@ -228,17 +228,13 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s · 227 unmodified lines
228228 break;
229229
230230 case dml_project_dcn35:
231+ case dml_project_dcn351:
231232 out->num_chans = 4;
232233 out->round_trip_ping_latency_dcfclk_cycles = 106;
233234 out->smn_latency_us = 2;
234235 out->dispclk_dppclk_vco_speed_mhz = 3600;
235236 break;
236237
237− case dml_project_dcn351:
238− out->num_chans = 16;
239− out->round_trip_ping_latency_dcfclk_cycles = 1100;
240− out->smn_latency_us = 2;
241− break;
242238 }
243239 /* ---Overrides if available--- */
244240 if (dml2->config.bbox_overrides.dram_num_chan)
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c+2−1
@@ -1185,7 +1185,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) · 1184 unmodified lines
11851185 if (dccg) {
11861186 dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
11871187 dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
1188− dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
1188+ if (dccg && dccg->funcs->set_dtbclk_dto)
1189+ dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
11891190 }
11901191 } else if (dccg && dccg->funcs->disable_symclk_se) {
11911192 dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c+0−41
@@ -69,29 +69,6 @@ · 68 unmodified lines
6969 #define FN(reg_name, field_name) \
7070 hws->shifts->field_name, hws->masks->field_name
7171
72−static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
73− int opp_cnt)
74−{
75− bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
76− int flow_ctrl_cnt;
77−
78− if (opp_cnt >= 2)
79− hblank_halved = true;
80−
81− flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
82− stream->timing.h_border_left -
83− stream->timing.h_border_right;
84−
85− if (hblank_halved)
86− flow_ctrl_cnt /= 2;
87−
88− /* ODM combine 4:1 case */
89− if (opp_cnt == 4)
90− flow_ctrl_cnt /= 2;
91−
92− return flow_ctrl_cnt;
93−}
94−
9572 static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
9673 {
9774 struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
@@ -183,10 +160,6 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx · 85 unmodified lines
183160 struct pipe_ctx *odm_pipe;
184161 int opp_cnt = 0;
185162 int opp_inst[MAX_PIPES] = {0};
186− bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
187− struct mpc_dwb_flow_control flow_control;
188− struct mpc *mpc = dc->res_pool->mpc;
189− int i;
190163
191164 opp_cnt = get_odm_config(pipe_ctx, opp_inst);
192165
@@ -199,20 +172,6 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx · 6 unmodified lines
199172 pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
200173 pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
201174
202− rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
203− flow_control.flow_ctrl_mode = 0;
204− flow_control.flow_ctrl_cnt0 = 0x80;
205− flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
206− if (mpc->funcs->set_out_rate_control) {
207− for (i = 0; i < opp_cnt; ++i) {
208− mpc->funcs->set_out_rate_control(
209− mpc, opp_inst[i],
210− true,
211− rate_control_2x_pclk,
212− &flow_control);
213− }
214− }
215−
216175 for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
217176 odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
218177 odm_pipe->stream_res.opp,
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c+0−41
@@ -966,29 +966,6 @@ void dcn32_init_hw(struct dc *dc) · 965 unmodified lines
966966 }
967967 }
968968
969−static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
970− int opp_cnt)
971−{
972− bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
973− int flow_ctrl_cnt;
974−
975− if (opp_cnt >= 2)
976− hblank_halved = true;
977−
978− flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
979− stream->timing.h_border_left -
980− stream->timing.h_border_right;
981−
982− if (hblank_halved)
983− flow_ctrl_cnt /= 2;
984−
985− /* ODM combine 4:1 case */
986− if (opp_cnt == 4)
987− flow_ctrl_cnt /= 2;
988−
989− return flow_ctrl_cnt;
990−}
991−
992969 static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
993970 {
994971 struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
@@ -1103,10 +1080,6 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx * · 108 unmodified lines
11031080 struct pipe_ctx *odm_pipe;
11041081 int opp_cnt = 0;
11051082 int opp_inst[MAX_PIPES] = {0};
1106− bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
1107− struct mpc_dwb_flow_control flow_control;
1108− struct mpc *mpc = dc->res_pool->mpc;
1109− int i;
11101083
11111084 opp_cnt = get_odm_config(pipe_ctx, opp_inst);
11121085
@@ -1119,20 +1092,6 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx * · 6 unmodified lines
11191092 pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
11201093 pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
11211094
1122− rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
1123− flow_control.flow_ctrl_mode = 0;
1124− flow_control.flow_ctrl_cnt0 = 0x80;
1125− flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
1126− if (mpc->funcs->set_out_rate_control) {
1127− for (i = 0; i < opp_cnt; ++i) {
1128− mpc->funcs->set_out_rate_control(
1129− mpc, opp_inst[i],
1130− true,
1131− rate_control_2x_pclk,
1132− &flow_control);
1133− }
1134− }
1135−
11361095 for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
11371096 odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
11381097 odm_pipe->stream_res.opp,
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c+0−41
@@ -358,29 +358,6 @@ void dcn35_init_hw(struct dc *dc) · 357 unmodified lines
358358 }
359359 }
360360
361−static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
362− int opp_cnt)
363−{
364− bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
365− int flow_ctrl_cnt;
366−
367− if (opp_cnt >= 2)
368− hblank_halved = true;
369−
370− flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
371− stream->timing.h_border_left -
372− stream->timing.h_border_right;
373−
374− if (hblank_halved)
375− flow_ctrl_cnt /= 2;
376−
377− /* ODM combine 4:1 case */
378− if (opp_cnt == 4)
379− flow_ctrl_cnt /= 2;
380−
381− return flow_ctrl_cnt;
382−}
383−
384361 static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
385362 {
386363 struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
@@ -474,10 +451,6 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx * · 87 unmodified lines
474451 struct pipe_ctx *odm_pipe;
475452 int opp_cnt = 0;
476453 int opp_inst[MAX_PIPES] = {0};
477− bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
478− struct mpc_dwb_flow_control flow_control;
479− struct mpc *mpc = dc->res_pool->mpc;
480− int i;
481454
482455 opp_cnt = get_odm_config(pipe_ctx, opp_inst);
483456
@@ -490,20 +463,6 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx * · 6 unmodified lines
490463 pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
491464 pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
492465
493− rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
494− flow_control.flow_ctrl_mode = 0;
495− flow_control.flow_ctrl_cnt0 = 0x80;
496− flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
497− if (mpc->funcs->set_out_rate_control) {
498− for (i = 0; i < opp_cnt; ++i) {
499− mpc->funcs->set_out_rate_control(
500− mpc, opp_inst[i],
501− true,
502− rate_control_2x_pclk,
503− &flow_control);
504− }
505− }
506−
507466 for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
508467 odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
509468 odm_pipe->stream_res.opp,
drivers/gpu/drm/amd/display/dc/hwss/dcn351/dcn351_init.c+1−1
@@ -67,7 +67,7 @@ static const struct hw_sequencer_funcs dcn351_funcs = { · 66 unmodified lines
6767 .prepare_bandwidth = dcn35_prepare_bandwidth,
6868 .optimize_bandwidth = dcn35_optimize_bandwidth,
6969 .update_bandwidth = dcn20_update_bandwidth,
70− .set_drr = dcn10_set_drr,
70+ .set_drr = dcn35_set_drr,
7171 .get_position = dcn10_get_position,
7272 .set_static_screen_control = dcn35_set_static_screen_control,
7373 .setup_stereo = dcn10_setup_stereo,
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c+8−3
@@ -700,6 +700,8 @@ static const struct dc_debug_options debug_defaults_drv = { · 699 unmodified lines
700700 .disable_dcc = DCC_ENABLE,
701701 .disable_dpp_power_gate = true,
702702 .disable_hubp_power_gate = true,
703+ .disable_optc_power_gate = true, /*should the same as above two*/
704+ .disable_hpo_power_gate = true, /*dmubfw force domain25 on*/
703705 .disable_clock_gate = false,
704706 .disable_dsc_power_gate = true,
705707 .vsr_support = true,
@@ -742,12 +744,13 @@ static const struct dc_debug_options debug_defaults_drv = { · 36 unmodified lines
742744 },
743745 .seamless_boot_odm_combine = DML_FAIL_SOURCE_PIXEL_FORMAT,
744746 .enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/
747+ .minimum_z8_residency_time = 2100,
745748 .using_dml2 = true,
746749 .support_eDP1_5 = true,
747750 .enable_hpo_pg_support = false,
748751 .enable_legacy_fast_update = true,
749752 .enable_single_display_2to1_odm_policy = true,
750− .disable_idle_power_optimizations = true,
753+ .disable_idle_power_optimizations = false,
751754 .dmcub_emulation = false,
752755 .disable_boot_optimizations = false,
753756 .disable_unbounded_requesting = false,
@@ -758,8 +761,10 @@ static const struct dc_debug_options debug_defaults_drv = { · 4 unmodified lines
758761 .disable_z10 = true,
759762 .ignore_pg = true,
760763 .psp_disabled_wa = true,
761− .ips2_eval_delay_us = 200,
762− .ips2_entry_delay_us = 400
764+ .ips2_eval_delay_us = 2000,
765+ .ips2_entry_delay_us = 800,
766+ .disable_dmub_reallow_idle = true,
767+ .static_screen_wait_frames = 2,
763768 };
764769
765770 static const struct dc_panel_config panel_config_defaults = {
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c+5−8
@@ -147,15 +147,12 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, · 146 unmodified lines
147147 }
148148
149149 /* VSC packet set to 4 for PSR-SU, or 2 for PSR1 */
150− if (stream->link->psr_settings.psr_feature_enabled) {
151− if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
152− vsc_packet_revision = vsc_packet_rev4;
153− else if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_1)
154− vsc_packet_revision = vsc_packet_rev2;
155− }
156−
157− if (stream->link->replay_settings.config.replay_supported)
150+ if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
151+ vsc_packet_revision = vsc_packet_rev4;
152+ else if (stream->link->replay_settings.config.replay_supported)
158153 vsc_packet_revision = vsc_packet_rev4;
154+ else if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_1)
155+ vsc_packet_revision = vsc_packet_rev2;
159156
160157 /* Update to revision 5 for extended colorimetry support */
161158 if (stream->use_vsc_sdp_for_colorimetry)
drivers/gpu/drm/amd/include/umsch_mm_4_0_api_def.h+11−2
@@ -234,7 +234,8 @@ union UMSCHAPI__SET_HW_RESOURCES { · 233 unmodified lines
234234 uint32_t enable_level_process_quantum_check : 1;
235235 uint32_t is_vcn0_enabled : 1;
236236 uint32_t is_vcn1_enabled : 1;
237− uint32_t reserved : 27;
237+ uint32_t use_rs64mem_for_proc_ctx_csa : 1;
238+ uint32_t reserved : 26;
238239 };
239240 uint32_t uint32_all;
240241 };
@@ -297,9 +298,12 @@ union UMSCHAPI__ADD_QUEUE { · 56 unmodified lines
297298
298299 struct {
299300 uint32_t is_context_suspended : 1;
300− uint32_t reserved : 31;
301+ uint32_t collaboration_mode : 1;
302+ uint32_t reserved : 30;
301303 };
302304 struct UMSCH_API_STATUS api_status;
305+ uint32_t process_csa_array_index;
306+ uint32_t context_csa_array_index;
303307 };
304308
305309 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -314,6 +318,7 @@ union UMSCHAPI__REMOVE_QUEUE { · 8 unmodified lines
314318 uint64_t context_csa_addr;
315319
316320 struct UMSCH_API_STATUS api_status;
321+ uint32_t context_csa_array_index;
317322 };
318323
319324 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -337,6 +342,7 @@ union UMSCHAPI__SUSPEND { · 17 unmodified lines
337342 uint32_t suspend_fence_value;
338343
339344 struct UMSCH_API_STATUS api_status;
345+ uint32_t context_csa_array_index;
340346 };
341347
342348 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -356,6 +362,7 @@ union UMSCHAPI__RESUME { · 13 unmodified lines
356362 enum UMSCH_ENGINE_TYPE engine_type;
357363
358364 struct UMSCH_API_STATUS api_status;
365+ uint32_t context_csa_array_index;
359366 };
360367
361368 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -404,6 +411,7 @@ union UMSCHAPI__UPDATE_AFFINITY { · 42 unmodified lines
404411 union UMSCH_AFFINITY affinity;
405412 uint64_t context_csa_addr;
406413 struct UMSCH_API_STATUS api_status;
414+ uint32_t context_csa_array_index;
407415 };
408416
409417 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -417,6 +425,7 @@ union UMSCHAPI__CHANGE_CONTEXT_PRIORITY_LEVEL { · 7 unmodified lines
417425 uint64_t context_quantum;
418426 uint64_t context_csa_addr;
419427 struct UMSCH_API_STATUS api_status;
428+ uint32_t context_csa_array_index;
420429 };
421430
422431 uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v14_0_0_ppsmc.h+14−14
@@ -54,14 +54,14 @@ · 53 unmodified lines
5454 #define PPSMC_MSG_TestMessage 0x01 ///< To check if PMFW is alive and responding. Requirement specified by PMFW team
5555 #define PPSMC_MSG_GetPmfwVersion 0x02 ///< Get PMFW version
5656 #define PPSMC_MSG_GetDriverIfVersion 0x03 ///< Get PMFW_DRIVER_IF version
57−#define PPSMC_MSG_SPARE0 0x04 ///< SPARE
58−#define PPSMC_MSG_SPARE1 0x05 ///< SPARE
59−#define PPSMC_MSG_PowerDownVcn 0x06 ///< Power down VCN
60−#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default
61−#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display
57+#define PPSMC_MSG_PowerDownVcn1 0x04 ///< Power down VCN1
58+#define PPSMC_MSG_PowerUpVcn1 0x05 ///< Power up VCN1; VCN1 is power gated by default
59+#define PPSMC_MSG_PowerDownVcn0 0x06 ///< Power down VCN0
60+#define PPSMC_MSG_PowerUpVcn0 0x07 ///< Power up VCN0; VCN0 is power gated by default
61+#define PPSMC_MSG_SetHardMinVcn0 0x08 ///< For wireless display
6262 #define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz
63−#define PPSMC_MSG_SPARE2 0x0A ///< SPARE
64−#define PPSMC_MSG_SPARE3 0x0B ///< SPARE
63+#define PPSMC_MSG_SetHardMinVcn1 0x0A ///< For wireless display
64+#define PPSMC_MSG_SetSoftMinVcn1 0x0B ///< Set soft min for VCN1 clocks (VCLK1 and DCLK1)
6565 #define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload
6666 #define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer
6767 #define PPSMC_MSG_SetDriverDramAddrLow 0x0E ///< Set low 32 bits of DRAM address for Driver table transfer
@@ -71,7 +71,7 @@ · 3 unmodified lines
7171 #define PPSMC_MSG_GetEnabledSmuFeatures 0x12 ///< Get enabled features in PMFW
7272 #define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK
7373 #define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK
74−#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK)
74+#define PPSMC_MSG_SetSoftMinVcn0 0x15 ///< Set soft min for VCN0 clocks (VCLK0 and DCLK0)
7575
7676 #define PPSMC_MSG_EnableGfxImu 0x16 ///< Enable GFX IMU
7777
@@ -84,17 +84,17 @@ · 6 unmodified lines
8484
8585 #define PPSMC_MSG_SetSoftMaxSocclkByFreq 0x1D ///< Set soft max for SOC CLK
8686 #define PPSMC_MSG_SetSoftMaxFclkByFreq 0x1E ///< Set soft max for FCLK
87−#define PPSMC_MSG_SetSoftMaxVcn 0x1F ///< Set soft max for VCN clocks (VCLK and DCLK)
87+#define PPSMC_MSG_SetSoftMaxVcn0 0x1F ///< Set soft max for VCN0 clocks (VCLK0 and DCLK0)
8888 #define PPSMC_MSG_spare_0x20 0x20
89−#define PPSMC_MSG_PowerDownJpeg 0x21 ///< Power down Jpeg
90−#define PPSMC_MSG_PowerUpJpeg 0x22 ///< Power up Jpeg; VCN is power gated by default
89+#define PPSMC_MSG_PowerDownJpeg0 0x21 ///< Power down Jpeg of VCN0
90+#define PPSMC_MSG_PowerUpJpeg0 0x22 ///< Power up Jpeg of VCN0; VCN0 is power gated by default
9191
9292 #define PPSMC_MSG_SetHardMinFclkByFreq 0x23 ///< Set hard min for FCLK
9393 #define PPSMC_MSG_SetSoftMinSocclkByFreq 0x24 ///< Set soft min for SOC CLK
9494 #define PPSMC_MSG_AllowZstates 0x25 ///< Inform PMFM of allowing Zstate entry, i.e. no Miracast activity
95−#define PPSMC_MSG_Reserved 0x26 ///< Not used
96−#define PPSMC_MSG_Reserved1 0x27 ///< Not used, previously PPSMC_MSG_RequestActiveWgp
97−#define PPSMC_MSG_Reserved2 0x28 ///< Not used, previously PPSMC_MSG_QueryActiveWgp
95+#define PPSMC_MSG_PowerDownJpeg1 0x26 ///< Power down Jpeg of VCN1
96+#define PPSMC_MSG_PowerUpJpeg1 0x27 ///< Power up Jpeg of VCN1; VCN1 is power gated by default
97+#define PPSMC_MSG_SetSoftMaxVcn1 0x28 ///< Set soft max for VCN1 clocks (VCLK1 and DCLK1)
9898 #define PPSMC_MSG_PowerDownIspByTile 0x29 ///< ISP is power gated by default
9999 #define PPSMC_MSG_PowerUpIspByTile 0x2A ///< This message is used to power up ISP tiles and enable the ISP DPM
100100 #define PPSMC_MSG_SetHardMinIspiclkByFreq 0x2B ///< Set HardMin by frequency for ISPICLK
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h+10−0
@@ -115,6 +115,10 @@ · 114 unmodified lines
115115 __SMU_DUMMY_MAP(PowerDownVcn), \
116116 __SMU_DUMMY_MAP(PowerUpJpeg), \
117117 __SMU_DUMMY_MAP(PowerDownJpeg), \
118+ __SMU_DUMMY_MAP(PowerUpJpeg0), \
119+ __SMU_DUMMY_MAP(PowerDownJpeg0), \
120+ __SMU_DUMMY_MAP(PowerUpJpeg1), \
121+ __SMU_DUMMY_MAP(PowerDownJpeg1), \
118122 __SMU_DUMMY_MAP(BacoAudioD3PME), \
119123 __SMU_DUMMY_MAP(ArmD3), \
120124 __SMU_DUMMY_MAP(RunDcBtc), \
@@ -135,6 +139,8 @@ · 14 unmodified lines
135139 __SMU_DUMMY_MAP(PowerUpSdma), \
136140 __SMU_DUMMY_MAP(SetHardMinIspclkByFreq), \
137141 __SMU_DUMMY_MAP(SetHardMinVcn), \
142+ __SMU_DUMMY_MAP(SetHardMinVcn0), \
143+ __SMU_DUMMY_MAP(SetHardMinVcn1), \
138144 __SMU_DUMMY_MAP(SetAllowFclkSwitch), \
139145 __SMU_DUMMY_MAP(SetMinVideoGfxclkFreq), \
140146 __SMU_DUMMY_MAP(ActiveProcessNotify), \
@@ -150,6 +156,8 @@ · 9 unmodified lines
150156 __SMU_DUMMY_MAP(SetPhyclkVoltageByFreq), \
151157 __SMU_DUMMY_MAP(SetDppclkVoltageByFreq), \
152158 __SMU_DUMMY_MAP(SetSoftMinVcn), \
159+ __SMU_DUMMY_MAP(SetSoftMinVcn0), \
160+ __SMU_DUMMY_MAP(SetSoftMinVcn1), \
153161 __SMU_DUMMY_MAP(EnablePostCode), \
154162 __SMU_DUMMY_MAP(GetGfxclkFrequency), \
155163 __SMU_DUMMY_MAP(GetFclkFrequency), \
@@ -161,6 +169,8 @@ · 5 unmodified lines
161169 __SMU_DUMMY_MAP(SetSoftMaxSocclkByFreq), \
162170 __SMU_DUMMY_MAP(SetSoftMaxFclkByFreq), \
163171 __SMU_DUMMY_MAP(SetSoftMaxVcn), \
172+ __SMU_DUMMY_MAP(SetSoftMaxVcn0), \
173+ __SMU_DUMMY_MAP(SetSoftMaxVcn1), \
164174 __SMU_DUMMY_MAP(PowerGateMmHub), \
165175 __SMU_DUMMY_MAP(UpdatePmeRestore), \
166176 __SMU_DUMMY_MAP(GpuChangeState), \
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c+44−6
@@ -1402,9 +1402,22 @@ int smu_v14_0_set_vcn_enable(struct smu_context *smu, · 1401 unmodified lines
14021402 if (adev->vcn.harvest_config & (1 << i))
14031403 continue;
14041404
1405− ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1406− SMU_MSG_PowerUpVcn : SMU_MSG_PowerDownVcn,
1407− i << 16U, NULL);
1405+ if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
1406+ amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1407+ if (i == 0)
1408+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1409+ SMU_MSG_PowerUpVcn0 : SMU_MSG_PowerDownVcn0,
1410+ i << 16U, NULL);
1411+ else if (i == 1)
1412+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1413+ SMU_MSG_PowerUpVcn1 : SMU_MSG_PowerDownVcn1,
1414+ i << 16U, NULL);
1415+ } else {
1416+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1417+ SMU_MSG_PowerUpVcn : SMU_MSG_PowerDownVcn,
1418+ i << 16U, NULL);
1419+ }
1420+
14081421 if (ret)
14091422 return ret;
14101423 }
@@ -1415,9 +1428,34 @@ int smu_v14_0_set_vcn_enable(struct smu_context *smu, · 4 unmodified lines
14151428 int smu_v14_0_set_jpeg_enable(struct smu_context *smu,
14161429 bool enable)
14171430 {
1418− return smu_cmn_send_smc_msg_with_param(smu, enable ?
1419− SMU_MSG_PowerUpJpeg : SMU_MSG_PowerDownJpeg,
1420− 0, NULL);
1431+ struct amdgpu_device *adev = smu->adev;
1432+ int i, ret = 0;
1433+
1434+ for (i = 0; i < adev->jpeg.num_jpeg_inst; i++) {
1435+ if (adev->jpeg.harvest_config & (1 << i))
1436+ continue;
1437+
1438+ if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
1439+ amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1440+ if (i == 0)
1441+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1442+ SMU_MSG_PowerUpJpeg0 : SMU_MSG_PowerDownJpeg0,
1443+ i << 16U, NULL);
1444+ else if (i == 1 && amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1445+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1446+ SMU_MSG_PowerUpJpeg1 : SMU_MSG_PowerDownJpeg1,
1447+ i << 16U, NULL);
1448+ } else {
1449+ ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1450+ SMU_MSG_PowerUpJpeg : SMU_MSG_PowerDownJpeg,
1451+ i << 16U, NULL);
1452+ }
1453+
1454+ if (ret)
1455+ return ret;
1456+ }
1457+
1458+ return ret;
14211459 }
14221460
14231461 int smu_v14_0_run_btc(struct smu_context *smu)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c+14−7
@@ -70,9 +70,12 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] = · 69 unmodified lines
7070 MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1),
7171 MSG_MAP(GetSmuVersion, PPSMC_MSG_GetPmfwVersion, 1),
7272 MSG_MAP(GetDriverIfVersion, PPSMC_MSG_GetDriverIfVersion, 1),
73− MSG_MAP(PowerDownVcn, PPSMC_MSG_PowerDownVcn, 1),
74− MSG_MAP(PowerUpVcn, PPSMC_MSG_PowerUpVcn, 1),
75− MSG_MAP(SetHardMinVcn, PPSMC_MSG_SetHardMinVcn, 1),
73+ MSG_MAP(PowerDownVcn0, PPSMC_MSG_PowerDownVcn0, 1),
74+ MSG_MAP(PowerUpVcn0, PPSMC_MSG_PowerUpVcn0, 1),
75+ MSG_MAP(SetHardMinVcn0, PPSMC_MSG_SetHardMinVcn0, 1),
76+ MSG_MAP(PowerDownVcn1, PPSMC_MSG_PowerDownVcn1, 1),
77+ MSG_MAP(PowerUpVcn1, PPSMC_MSG_PowerUpVcn1, 1),
78+ MSG_MAP(SetHardMinVcn1, PPSMC_MSG_SetHardMinVcn1, 1),
7679 MSG_MAP(SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk, 1),
7780 MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 1),
7881 MSG_MAP(SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh, 1),
@@ -83,7 +86,8 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] = · 4 unmodified lines
8386 MSG_MAP(GetEnabledSmuFeatures, PPSMC_MSG_GetEnabledSmuFeatures, 1),
8487 MSG_MAP(SetHardMinSocclkByFreq, PPSMC_MSG_SetHardMinSocclkByFreq, 1),
8588 MSG_MAP(SetSoftMinFclk, PPSMC_MSG_SetSoftMinFclk, 1),
86− MSG_MAP(SetSoftMinVcn, PPSMC_MSG_SetSoftMinVcn, 1),
89+ MSG_MAP(SetSoftMinVcn0, PPSMC_MSG_SetSoftMinVcn0, 1),
90+ MSG_MAP(SetSoftMinVcn1, PPSMC_MSG_SetSoftMinVcn1, 1),
8791 MSG_MAP(EnableGfxImu, PPSMC_MSG_EnableGfxImu, 1),
8892 MSG_MAP(AllowGfxOff, PPSMC_MSG_AllowGfxOff, 1),
8993 MSG_MAP(DisallowGfxOff, PPSMC_MSG_DisallowGfxOff, 1),
@@ -91,9 +95,12 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] = · 1 unmodified line
9195 MSG_MAP(SetHardMinGfxClk, PPSMC_MSG_SetHardMinGfxClk, 1),
9296 MSG_MAP(SetSoftMaxSocclkByFreq, PPSMC_MSG_SetSoftMaxSocclkByFreq, 1),
9397 MSG_MAP(SetSoftMaxFclkByFreq, PPSMC_MSG_SetSoftMaxFclkByFreq, 1),
94− MSG_MAP(SetSoftMaxVcn, PPSMC_MSG_SetSoftMaxVcn, 1),
95− MSG_MAP(PowerDownJpeg, PPSMC_MSG_PowerDownJpeg, 1),
96− MSG_MAP(PowerUpJpeg, PPSMC_MSG_PowerUpJpeg, 1),
98+ MSG_MAP(SetSoftMaxVcn0, PPSMC_MSG_SetSoftMaxVcn0, 1),
99+ MSG_MAP(SetSoftMaxVcn1, PPSMC_MSG_SetSoftMaxVcn1, 1),
100+ MSG_MAP(PowerDownJpeg0, PPSMC_MSG_PowerDownJpeg0, 1),
101+ MSG_MAP(PowerUpJpeg0, PPSMC_MSG_PowerUpJpeg0, 1),
102+ MSG_MAP(PowerDownJpeg1, PPSMC_MSG_PowerDownJpeg1, 1),
103+ MSG_MAP(PowerUpJpeg1, PPSMC_MSG_PowerUpJpeg1, 1),
97104 MSG_MAP(SetHardMinFclkByFreq, PPSMC_MSG_SetHardMinFclkByFreq, 1),
98105 MSG_MAP(SetSoftMinSocclkByFreq, PPSMC_MSG_SetSoftMinSocclkByFreq, 1),
99106 MSG_MAP(PowerDownIspByTile, PPSMC_MSG_PowerDownIspByTile, 1),
drivers/gpu/drm/display/drm_dp_helper.c+7−0
@@ -4111,6 +4111,13 @@ int drm_dp_bw_overhead(int lane_count, int hactive, · 4110 unmodified lines
41114111 u32 overhead = 1000000;
41124112 int symbol_cycles;
41134113
4114+ if (lane_count == 0 || hactive == 0 || bpp_x16 == 0) {
4115+ DRM_DEBUG_KMS("Invalid BW overhead params: lane_count %d, hactive %d, bpp_x16 %d.%04d\n",
4116+ lane_count, hactive,
4117+ bpp_x16 >> 4, (bpp_x16 & 0xf) * 625);
4118+ return 0;
4119+ }
4120+
41144121 /*
41154122 * DP Standard v2.1 2.6.4.1
41164123 * SSC downspread and ref clock variation margin:
drivers/gpu/drm/i915/Makefile+3−3
@@ -33,9 +33,9 @@ endif · 32 unmodified lines
3333 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
3434
3535 # Fine grained warnings disable
36−CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init)
37−CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init)
38−CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init)
36+CFLAGS_i915_pci.o = -Wno-override-init
37+CFLAGS_display/intel_display_device.o = -Wno-override-init
38+CFLAGS_display/intel_fbdev.o = -Wno-override-init
3939
4040 # Support compiling the display code separately for both i915 and xe
4141 # drivers. Define I915 when building i915.
drivers/gpu/drm/i915/display/g4x_dp.c+0−2
@@ -717,7 +717,6 @@ static void g4x_enable_dp(struct intel_atomic_state *state, · 716 unmodified lines
717717 {
718718 intel_enable_dp(state, encoder, pipe_config, conn_state);
719719 intel_edp_backlight_on(pipe_config, conn_state);
720− encoder->audio_enable(encoder, pipe_config, conn_state);
721720 }
722721
723722 static void vlv_enable_dp(struct intel_atomic_state *state,
@@ -726,7 +725,6 @@ static void vlv_enable_dp(struct intel_atomic_state *state, · 2 unmodified lines
726725 const struct drm_connector_state *conn_state)
727726 {
728727 intel_edp_backlight_on(pipe_config, conn_state);
729− encoder->audio_enable(encoder, pipe_config, conn_state);
730728 }
731729
732730 static void g4x_pre_enable_dp(struct intel_atomic_state *state,
drivers/gpu/drm/i915/display/icl_dsi.c+2−1
@@ -1155,7 +1155,6 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) · 1154 unmodified lines
11551155 }
11561156
11571157 intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP);
1158− intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
11591158
11601159 /* ensure all panel commands dispatched before enabling transcoder */
11611160 wait_for_cmds_dispatched_to_panel(encoder);
@@ -1256,6 +1255,8 @@ static void gen11_dsi_enable(struct intel_atomic_state *state, · 94 unmodified lines
12561255 /* step6d: enable dsi transcoder */
12571256 gen11_dsi_enable_transcoder(encoder);
12581257
1258+ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
1259+
12591260 /* step7: enable backlight */
12601261 intel_backlight_enable(crtc_state, conn_state);
12611262 intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON);
drivers/gpu/drm/i915/display/intel_bios.c+40−6
@@ -1955,16 +1955,12 @@ static int get_init_otp_deassert_fragment_len(struct drm_i915_private *i915, · 1954 unmodified lines
19551955 * these devices we split the init OTP sequence into a deassert sequence and
19561956 * the actual init OTP part.
19571957 */
1958−static void fixup_mipi_sequences(struct drm_i915_private *i915,
1959− struct intel_panel *panel)
1958+static void vlv_fixup_mipi_sequences(struct drm_i915_private *i915,
1959+ struct intel_panel *panel)
19601960 {
19611961 u8 *init_otp;
19621962 int len;
19631963
1964− /* Limit this to VLV for now. */
1965− if (!IS_VALLEYVIEW(i915))
1966− return;
1967−
19681964 /* Limit this to v1 vid-mode sequences */
19691965 if (panel->vbt.dsi.config->is_cmd_mode ||
19701966 panel->vbt.dsi.seq_version != 1)
@@ -2000,6 +1996,41 @@ static void fixup_mipi_sequences(struct drm_i915_private *i915, · 29 unmodified lines
20001996 panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] = init_otp + len - 1;
20011997 }
20021998
1999+/*
2000+ * Some machines (eg. Lenovo 82TQ) appear to have broken
2001+ * VBT sequences:
2002+ * - INIT_OTP is not present at all
2003+ * - what should be in INIT_OTP is in DISPLAY_ON
2004+ * - what should be in DISPLAY_ON is in BACKLIGHT_ON
2005+ * (along with the actual backlight stuff)
2006+ *
2007+ * To make those work we simply swap DISPLAY_ON and INIT_OTP.
2008+ *
2009+ * TODO: Do we need to limit this to specific machines,
2010+ * or examine the contents of the sequences to
2011+ * avoid false positives?
2012+ */
2013+static void icl_fixup_mipi_sequences(struct drm_i915_private *i915,
2014+ struct intel_panel *panel)
2015+{
2016+ if (!panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP] &&
2017+ panel->vbt.dsi.sequence[MIPI_SEQ_DISPLAY_ON]) {
2018+ drm_dbg_kms(&i915->drm, "Broken VBT: Swapping INIT_OTP and DISPLAY_ON sequences\n");
2019+
2020+ swap(panel->vbt.dsi.sequence[MIPI_SEQ_INIT_OTP],
2021+ panel->vbt.dsi.sequence[MIPI_SEQ_DISPLAY_ON]);
2022+ }
2023+}
2024+
2025+static void fixup_mipi_sequences(struct drm_i915_private *i915,
2026+ struct intel_panel *panel)
2027+{
2028+ if (DISPLAY_VER(i915) >= 11)
2029+ icl_fixup_mipi_sequences(i915, panel);
2030+ else if (IS_VALLEYVIEW(i915))
2031+ vlv_fixup_mipi_sequences(i915, panel);
2032+}
2033+
20032034 static void
20042035 parse_mipi_sequence(struct drm_i915_private *i915,
20052036 struct intel_panel *panel)
@@ -3351,6 +3382,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da · 1345 unmodified lines
33513382 {
33523383 const struct child_device_config *child = &devdata->child;
33533384
3385+ if (!devdata)
3386+ return false;
3387+
33543388 if (!intel_bios_encoder_supports_dp(devdata) ||
33553389 !intel_bios_encoder_supports_hdmi(devdata))
33563390 return false;
drivers/gpu/drm/i915/display/intel_cursor.c+1−3
@@ -36,12 +36,10 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state) · 35 unmodified lines
3636 {
3737 struct drm_i915_private *dev_priv =
3838 to_i915(plane_state->uapi.plane->dev);
39− const struct drm_framebuffer *fb = plane_state->hw.fb;
40− struct drm_i915_gem_object *obj = intel_fb_obj(fb);
4139 u32 base;
4240
4341 if (DISPLAY_INFO(dev_priv)->cursor_needs_physical)
44− base = i915_gem_object_get_dma_address(obj, 0);
42+ base = plane_state->phys_dma_addr;
4543 else
4644 base = intel_plane_ggtt_offset(plane_state);
4745
drivers/gpu/drm/i915/display/intel_display_types.h+1−0
@@ -727,6 +727,7 @@ struct intel_plane_state { · 726 unmodified lines
727727 #define PLANE_HAS_FENCE BIT(0)
728728
729729 struct intel_fb_view view;
730+ u32 phys_dma_addr; /* for cursor_needs_physical */
730731
731732 /* Plane pxp decryption state */
732733 bool decrypt;
drivers/gpu/drm/i915/display/intel_dp.c+2−10
@@ -67,6 +67,7 @@ · 66 unmodified lines
6767 #include "intel_dp_tunnel.h"
6868 #include "intel_dpio_phy.h"
6969 #include "intel_dpll.h"
70+#include "intel_drrs.h"
7071 #include "intel_fifo_underrun.h"
7172 #include "intel_hdcp.h"
7273 #include "intel_hdmi.h"
@@ -2683,15 +2684,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp, · 2610 unmodified lines
26832684 intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
26842685 }
26852686
2686−static bool cpu_transcoder_has_drrs(struct drm_i915_private *i915,
2687− enum transcoder cpu_transcoder)
2688−{
2689− if (HAS_DOUBLE_BUFFERED_M_N(i915))
2690− return true;
2691−
2692− return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
2693−}
2694−
26952687 static bool can_enable_drrs(struct intel_connector *connector,
26962688 const struct intel_crtc_state *pipe_config,
26972689 const struct drm_display_mode *downclock_mode)
@@ -2714,7 +2706,7 @@ static bool can_enable_drrs(struct intel_connector *connector, · 16 unmodified lines
27142706 if (pipe_config->has_pch_encoder)
27152707 return false;
27162708
2717− if (!cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
2709+ if (!intel_cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
27182710 return false;
27192711
27202712 return downclock_mode &&
drivers/gpu/drm/i915/display/intel_dpll_mgr.c+1−1
@@ -2554,7 +2554,7 @@ static void icl_wrpll_params_populate(struct skl_wrpll_params *params, · 2553 unmodified lines
25542554 static bool
25552555 ehl_combo_pll_div_frac_wa_needed(struct drm_i915_private *i915)
25562556 {
2557− return (((IS_ELKHARTLAKE(i915) || IS_JASPERLAKE(i915)) &&
2557+ return ((IS_ELKHARTLAKE(i915) &&
25582558 IS_DISPLAY_STEP(i915, STEP_B0, STEP_FOREVER)) ||
25592559 IS_TIGERLAKE(i915) || IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915)) &&
25602560 i915->display.dpll.ref_clks.nssc == 38400;
drivers/gpu/drm/i915/display/intel_drrs.c+11−3
@@ -63,6 +63,15 @@ const char *intel_drrs_type_str(enum drrs_type drrs_type) · 62 unmodified lines
6363 return str[drrs_type];
6464 }
6565
66+bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
67+ enum transcoder cpu_transcoder)
68+{
69+ if (HAS_DOUBLE_BUFFERED_M_N(i915))
70+ return true;
71+
72+ return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
73+}
74+
6675 static void
6776 intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc,
6877 enum drrs_refresh_rate refresh_rate)
@@ -312,9 +321,8 @@ static int intel_drrs_debugfs_status_show(struct seq_file *m, void *unused) · 243 unmodified lines
312321 mutex_lock(&crtc->drrs.mutex);
313322
314323 seq_printf(m, "DRRS capable: %s\n",
315− str_yes_no(crtc_state->has_drrs ||
316− HAS_DOUBLE_BUFFERED_M_N(i915) ||
317− intel_cpu_transcoder_has_m2_n2(i915, crtc_state->cpu_transcoder)));
324+ str_yes_no(intel_cpu_transcoder_has_drrs(i915,
325+ crtc_state->cpu_transcoder)));
318326
319327 seq_printf(m, "DRRS enabled: %s\n",
320328 str_yes_no(crtc_state->has_drrs));
drivers/gpu/drm/i915/display/intel_drrs.h+3−0
@@ -9,12 +9,15 @@ · 8 unmodified lines
99 #include <linux/types.h>
1010
1111 enum drrs_type;
12+enum transcoder;
1213 struct drm_i915_private;
1314 struct intel_atomic_state;
1415 struct intel_crtc;
1516 struct intel_crtc_state;
1617 struct intel_connector;
1718
19+bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
20+ enum transcoder cpu_transcoder);
1821 const char *intel_drrs_type_str(enum drrs_type drrs_type);
1922 bool intel_drrs_is_active(struct intel_crtc *crtc);
2023 void intel_drrs_activate(const struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/display/intel_dsb.c+14−0
@@ -340,6 +340,17 @@ static int intel_dsb_dewake_scanline(const struct intel_crtc_state *crtc_state) · 339 unmodified lines
340340 return max(0, vblank_start - intel_usecs_to_scanlines(adjusted_mode, latency));
341341 }
342342
343+static u32 dsb_chicken(struct intel_crtc *crtc)
344+{
345+ if (crtc->mode_flags & I915_MODE_FLAG_VRR)
346+ return DSB_CTRL_WAIT_SAFE_WINDOW |
347+ DSB_CTRL_NO_WAIT_VBLANK |
348+ DSB_INST_WAIT_SAFE_WINDOW |
349+ DSB_INST_NO_WAIT_VBLANK;
350+ else
351+ return 0;
352+}
353+
343354 static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
344355 int dewake_scanline)
345356 {
@@ -361,6 +372,9 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl, · 15 unmodified lines
361372 intel_de_write_fw(dev_priv, DSB_CTRL(pipe, dsb->id),
362373 ctrl | DSB_ENABLE);
363374
375+ intel_de_write_fw(dev_priv, DSB_CHICKEN(pipe, dsb->id),
376+ dsb_chicken(crtc));
377+
364378 intel_de_write_fw(dev_priv, DSB_HEAD(pipe, dsb->id),
365379 intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf));
366380
drivers/gpu/drm/i915/display/intel_fb_pin.c+10−0
@@ -255,6 +255,16 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state) · 254 unmodified lines
255255 return PTR_ERR(vma);
256256
257257 plane_state->ggtt_vma = vma;
258+
259+ /*
260+ * Pre-populate the dma address before we enter the vblank
261+ * evade critical section as i915_gem_object_get_dma_address()
262+ * will trigger might_sleep() even if it won't actually sleep,
263+ * which is the case when the fb has already been pinned.
264+ */
265+ if (phys_cursor)
266+ plane_state->phys_dma_addr =
267+ i915_gem_object_get_dma_address(intel_fb_obj(fb), 0);
258268 } else {
259269 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
260270
drivers/gpu/drm/i915/display/intel_sdvo.c+0−4
@@ -1842,8 +1842,6 @@ static void intel_disable_sdvo(struct intel_atomic_state *state, · 1841 unmodified lines
18421842 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
18431843 u32 temp;
18441844
1845− encoder->audio_disable(encoder, old_crtc_state, conn_state);
1846−
18471845 intel_sdvo_set_active_outputs(intel_sdvo, 0);
18481846 if (0)
18491847 intel_sdvo_set_encoder_power_state(intel_sdvo,
@@ -1935,8 +1933,6 @@ static void intel_enable_sdvo(struct intel_atomic_state *state, · 85 unmodified lines
19351933 intel_sdvo_set_encoder_power_state(intel_sdvo,
19361934 DRM_MODE_DPMS_ON);
19371935 intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo_connector->output_flag);
1938−
1939− encoder->audio_enable(encoder, pipe_config, conn_state);
19401936 }
19411937
19421938 static enum drm_mode_status
drivers/gpu/drm/i915/display/intel_vrr.c+4−3
@@ -187,10 +187,11 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state) · 186 unmodified lines
187187 enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
188188
189189 /*
190− * TRANS_SET_CONTEXT_LATENCY with VRR enabled
191− * requires this chicken bit on ADL/DG2.
190+ * This bit seems to have two meanings depending on the platform:
191+ * TGL: generate VRR "safe window" for DSB vblank waits
192+ * ADL/DG2: make TRANS_SET_CONTEXT_LATENCY effective with VRR
192193 */
193− if (DISPLAY_VER(dev_priv) == 13)
194+ if (IS_DISPLAY_VER(dev_priv, 12, 13))
194195 intel_de_rmw(dev_priv, CHICKEN_TRANS(cpu_transcoder),
195196 0, PIPE_VBLANK_WITH_DELAY);
196197
drivers/gpu/drm/i915/display/skl_universal_plane.c+3−0
@@ -2295,6 +2295,9 @@ static u8 skl_get_plane_caps(struct drm_i915_private *i915, · 2294 unmodified lines
22952295 if (HAS_4TILE(i915))
22962296 caps |= INTEL_PLANE_CAP_TILING_4;
22972297
2298+ if (!IS_ENABLED(I915) && !HAS_FLAT_CCS(i915))
2299+ return caps;
2300+
22982301 if (skl_plane_has_rc_ccs(i915, pipe, plane_id)) {
22992302 caps |= INTEL_PLANE_CAP_CCS_RC;
23002303 if (DISPLAY_VER(i915) >= 12)
drivers/gpu/drm/i915/gt/intel_engine_pm.c+0−3
@@ -279,9 +279,6 @@ static int __engine_park(struct intel_wakeref *wf) · 278 unmodified lines
279279 intel_engine_park_heartbeat(engine);
280280 intel_breadcrumbs_park(engine->breadcrumbs);
281281
282− /* Must be reset upon idling, or we may miss the busy wakeup. */
283− GEM_BUG_ON(engine->sched_engine->queue_priority_hint != INT_MIN);
284−
285282 if (engine->park)
286283 engine->park(engine);
287284
drivers/gpu/drm/i915/gt/intel_execlists_submission.c+3−0
@@ -3272,6 +3272,9 @@ static void execlists_park(struct intel_engine_cs *engine) · 3271 unmodified lines
32723272 {
32733273 cancel_timer(&engine->execlists.timer);
32743274 cancel_timer(&engine->execlists.preempt);
3275+
3276+ /* Reset upon idling, or we may delay the busy wakeup. */
3277+ WRITE_ONCE(engine->sched_engine->queue_priority_hint, INT_MIN);
32753278 }
32763279
32773280 static void add_to_engine(struct i915_request *rq)
drivers/gpu/drm/i915/gt/intel_workarounds.c+1−0
@@ -1653,6 +1653,7 @@ static void · 1652 unmodified lines
16531653 xelpg_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
16541654 {
16551655 /* Wa_14018575942 / Wa_18018781329 */
1656+ wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB);
16561657 wa_mcr_write_or(wal, COMP_MOD_CTRL, FORCE_MISS_FTLB);
16571658
16581659 /* Wa_22016670082 */
drivers/gpu/drm/i915/i915_driver.c+1−1
@@ -800,7 +800,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 799 unmodified lines
800800 goto out_cleanup_modeset2;
801801
802802 ret = intel_pxp_init(i915);
803− if (ret != -ENODEV)
803+ if (ret && ret != -ENODEV)
804804 drm_dbg(&i915->drm, "pxp init failed with %d\n", ret);
805805
806806 ret = intel_display_driver_probe(i915);
drivers/gpu/drm/i915/i915_hwmon.c+19−18
@@ -72,12 +72,13 @@ hwm_locked_with_pm_intel_uncore_rmw(struct hwm_drvdata *ddat, · 71 unmodified lines
7272 struct intel_uncore *uncore = ddat->uncore;
7373 intel_wakeref_t wakeref;
7474
75− mutex_lock(&hwmon->hwmon_lock);
75+ with_intel_runtime_pm(uncore->rpm, wakeref) {
76+ mutex_lock(&hwmon->hwmon_lock);
7677
77− with_intel_runtime_pm(uncore->rpm, wakeref)
7878 intel_uncore_rmw(uncore, reg, clear, set);
7979
80− mutex_unlock(&hwmon->hwmon_lock);
80+ mutex_unlock(&hwmon->hwmon_lock);
81+ }
8182 }
8283
8384 /*
@@ -136,20 +137,21 @@ hwm_energy(struct hwm_drvdata *ddat, long *energy) · 52 unmodified lines
136137 else
137138 rgaddr = hwmon->rg.energy_status_all;
138139
139− mutex_lock(&hwmon->hwmon_lock);
140+ with_intel_runtime_pm(uncore->rpm, wakeref) {
141+ mutex_lock(&hwmon->hwmon_lock);
140142
141− with_intel_runtime_pm(uncore->rpm, wakeref)
142143 reg_val = intel_uncore_read(uncore, rgaddr);
143144
144− if (reg_val >= ei->reg_val_prev)
145− ei->accum_energy += reg_val - ei->reg_val_prev;
146− else
147− ei->accum_energy += UINT_MAX - ei->reg_val_prev + reg_val;
148− ei->reg_val_prev = reg_val;
145+ if (reg_val >= ei->reg_val_prev)
146+ ei->accum_energy += reg_val - ei->reg_val_prev;
147+ else
148+ ei->accum_energy += UINT_MAX - ei->reg_val_prev + reg_val;
149+ ei->reg_val_prev = reg_val;
149150
150− *energy = mul_u64_u32_shr(ei->accum_energy, SF_ENERGY,
151− hwmon->scl_shift_energy);
152− mutex_unlock(&hwmon->hwmon_lock);
151+ *energy = mul_u64_u32_shr(ei->accum_energy, SF_ENERGY,
152+ hwmon->scl_shift_energy);
153+ mutex_unlock(&hwmon->hwmon_lock);
154+ }
153155 }
154156
155157 static ssize_t
@@ -404,6 +406,7 @@ hwm_power_max_write(struct hwm_drvdata *ddat, long val) · 248 unmodified lines
404406
405407 /* Block waiting for GuC reset to complete when needed */
406408 for (;;) {
409+ wakeref = intel_runtime_pm_get(ddat->uncore->rpm);
407410 mutex_lock(&hwmon->hwmon_lock);
408411
409412 prepare_to_wait(&ddat->waitq, &wait, TASK_INTERRUPTIBLE);
@@ -417,14 +420,13 @@ hwm_power_max_write(struct hwm_drvdata *ddat, long val) · 7 unmodified lines
417420 }
418421
419422 mutex_unlock(&hwmon->hwmon_lock);
423+ intel_runtime_pm_put(ddat->uncore->rpm, wakeref);
420424
421425 schedule();
422426 }
423427 finish_wait(&ddat->waitq, &wait);
424428 if (ret)
425− goto unlock;
426−
427− wakeref = intel_runtime_pm_get(ddat->uncore->rpm);
429+ goto exit;
428430
429431 /* Disable PL1 limit and verify, because the limit cannot be disabled on all platforms */
430432 if (val == PL1_DISABLE) {
@@ -444,9 +446,8 @@ hwm_power_max_write(struct hwm_drvdata *ddat, long val) · 13 unmodified lines
444446 intel_uncore_rmw(ddat->uncore, hwmon->rg.pkg_rapl_limit,
445447 PKG_PWR_LIM_1_EN | PKG_PWR_LIM_1, nval);
446448 exit:
447− intel_runtime_pm_put(ddat->uncore->rpm, wakeref);
448−unlock:
449449 mutex_unlock(&hwmon->hwmon_lock);
450+ intel_runtime_pm_put(ddat->uncore->rpm, wakeref);
450451 return ret;
451452 }
452453
drivers/gpu/drm/i915/i915_memcpy.c+2−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #include <linux/kernel.h>
2626 #include <linux/string.h>
2727 #include <linux/cpufeature.h>
28+#include <linux/bug.h>
29+#include <linux/build_bug.h>
2830 #include <asm/fpu/api.h>
2931
3032 #include "i915_memcpy.h"
drivers/gpu/drm/i915/i915_reg.h+1−1
@@ -4599,7 +4599,7 @@ · 4598 unmodified lines
45994599 #define MTL_CHICKEN_TRANS(trans) _MMIO_TRANS((trans), \
46004600 _MTL_CHICKEN_TRANS_A, \
46014601 _MTL_CHICKEN_TRANS_B)
4602−#define PIPE_VBLANK_WITH_DELAY REG_BIT(31) /* ADL/DG2 */
4602+#define PIPE_VBLANK_WITH_DELAY REG_BIT(31) /* tgl+ */
46034603 #define SKL_UNMASK_VBL_TO_PIPE_IN_SRD REG_BIT(30) /* skl+ */
46044604 #define HSW_FRAME_START_DELAY_MASK REG_GENMASK(28, 27)
46054605 #define HSW_FRAME_START_DELAY(x) REG_FIELD_PREP(HSW_FRAME_START_DELAY_MASK, x)
drivers/gpu/drm/i915/i915_vma.c+43−7
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include "gt/intel_engine.h"
3535 #include "gt/intel_engine_heartbeat.h"
3636 #include "gt/intel_gt.h"
37+#include "gt/intel_gt_pm.h"
3738 #include "gt/intel_gt_requests.h"
3839 #include "gt/intel_tlb.h"
3940
@@ -103,12 +104,42 @@ static inline struct i915_vma *active_to_vma(struct i915_active *ref) · 63 unmodified lines
103104
104105 static int __i915_vma_active(struct i915_active *ref)
105106 {
106− return i915_vma_tryget(active_to_vma(ref)) ? 0 : -ENOENT;
107+ struct i915_vma *vma = active_to_vma(ref);
108+
109+ if (!i915_vma_tryget(vma))
110+ return -ENOENT;
111+
112+ /*
113+ * Exclude global GTT VMA from holding a GT wakeref
114+ * while active, otherwise GPU never goes idle.
115+ */
116+ if (!i915_vma_is_ggtt(vma)) {
117+ /*
118+ * Since we and our _retire() counterpart can be
119+ * called asynchronously, storing a wakeref tracking
120+ * handle inside struct i915_vma is not safe, and
121+ * there is no other good place for that. Hence,
122+ * use untracked variants of intel_gt_pm_get/put().
123+ */
124+ intel_gt_pm_get_untracked(vma->vm->gt);
125+ }
126+
127+ return 0;
107128 }
108129
109130 static void __i915_vma_retire(struct i915_active *ref)
110131 {
111− i915_vma_put(active_to_vma(ref));
132+ struct i915_vma *vma = active_to_vma(ref);
133+
134+ if (!i915_vma_is_ggtt(vma)) {
135+ /*
136+ * Since we can be called from atomic contexts,
137+ * use an async variant of intel_gt_pm_put().
138+ */
139+ intel_gt_pm_put_async_untracked(vma->vm->gt);
140+ }
141+
142+ i915_vma_put(vma);
112143 }
113144
114145 static struct i915_vma *
@@ -1404,7 +1435,7 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww, · 1289 unmodified lines
14041435 struct i915_vma_work *work = NULL;
14051436 struct dma_fence *moving = NULL;
14061437 struct i915_vma_resource *vma_res = NULL;
1407− intel_wakeref_t wakeref = 0;
1438+ intel_wakeref_t wakeref;
14081439 unsigned int bound;
14091440 int err;
14101441
@@ -1424,8 +1455,14 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww, · 13 unmodified lines
14241455 if (err)
14251456 return err;
14261457
1427− if (flags & PIN_GLOBAL)
1428− wakeref = intel_runtime_pm_get(&vma->vm->i915->runtime_pm);
1458+ /*
1459+ * In case of a global GTT, we must hold a runtime-pm wakeref
1460+ * while global PTEs are updated. In other cases, we hold
1461+ * the rpm reference while the VMA is active. Since runtime
1462+ * resume may require allocations, which are forbidden inside
1463+ * vm->mutex, get the first rpm wakeref outside of the mutex.
1464+ */
1465+ wakeref = intel_runtime_pm_get(&vma->vm->i915->runtime_pm);
14291466
14301467 if (flags & vma->vm->bind_async_flags) {
14311468 /* lock VM */
@@ -1561,8 +1598,7 @@ err_fence: · 129 unmodified lines
15611598 if (work)
15621599 dma_fence_work_commit_imm(&work->base);
15631600 err_rpm:
1564− if (wakeref)
1565− intel_runtime_pm_put(&vma->vm->i915->runtime_pm, wakeref);
1601+ intel_runtime_pm_put(&vma->vm->i915->runtime_pm, wakeref);
15661602
15671603 if (moving)
15681604 dma_fence_put(moving);
drivers/gpu/drm/nouveau/nouveau_dmem.c+6−6
@@ -378,9 +378,9 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) · 377 unmodified lines
378378 dma_addr_t *dma_addrs;
379379 struct nouveau_fence *fence;
380380
381− src_pfns = kcalloc(npages, sizeof(*src_pfns), GFP_KERNEL);
382− dst_pfns = kcalloc(npages, sizeof(*dst_pfns), GFP_KERNEL);
383− dma_addrs = kcalloc(npages, sizeof(*dma_addrs), GFP_KERNEL);
381+ src_pfns = kvcalloc(npages, sizeof(*src_pfns), GFP_KERNEL | __GFP_NOFAIL);
382+ dst_pfns = kvcalloc(npages, sizeof(*dst_pfns), GFP_KERNEL | __GFP_NOFAIL);
383+ dma_addrs = kvcalloc(npages, sizeof(*dma_addrs), GFP_KERNEL | __GFP_NOFAIL);
384384
385385 migrate_device_range(src_pfns, chunk->pagemap.range.start >> PAGE_SHIFT,
386386 npages);
@@ -406,11 +406,11 @@ nouveau_dmem_evict_chunk(struct nouveau_dmem_chunk *chunk) · 19 unmodified lines
406406 migrate_device_pages(src_pfns, dst_pfns, npages);
407407 nouveau_dmem_fence_done(&fence);
408408 migrate_device_finalize(src_pfns, dst_pfns, npages);
409− kfree(src_pfns);
410− kfree(dst_pfns);
409+ kvfree(src_pfns);
410+ kvfree(dst_pfns);
411411 for (i = 0; i < npages; i++)
412412 dma_unmap_page(chunk->drm->dev->dev, dma_addrs[i], PAGE_SIZE, DMA_BIDIRECTIONAL);
413− kfree(dma_addrs);
413+ kvfree(dma_addrs);
414414 }
415415
416416 void
drivers/gpu/drm/qxl/qxl_cmd.c+0−2
@@ -421,7 +421,6 @@ int qxl_surface_id_alloc(struct qxl_device *qdev, · 420 unmodified lines
421421 {
422422 uint32_t handle;
423423 int idr_ret;
424− int count = 0;
425424 again:
426425 idr_preload(GFP_ATOMIC);
427426 spin_lock(&qdev->surf_id_idr_lock);
@@ -433,7 +432,6 @@ again: · 5 unmodified lines
433432 handle = idr_ret;
434433
435434 if (handle >= qdev->rom->n_surfaces) {
436− count++;
437435 spin_lock(&qdev->surf_id_idr_lock);
438436 idr_remove(&qdev->surf_id_idr, handle);
439437 spin_unlock(&qdev->surf_id_idr_lock);
drivers/gpu/drm/qxl/qxl_ioctl.c+1−3
@@ -145,7 +145,7 @@ static int qxl_process_single_command(struct qxl_device *qdev, · 144 unmodified lines
145145 struct qxl_release *release;
146146 struct qxl_bo *cmd_bo;
147147 void *fb_cmd;
148− int i, ret, num_relocs;
148+ int i, ret;
149149 int unwritten;
150150
151151 switch (cmd->type) {
@@ -200,7 +200,6 @@ static int qxl_process_single_command(struct qxl_device *qdev, · 48 unmodified lines
200200 }
201201
202202 /* fill out reloc info structs */
203− num_relocs = 0;
204203 for (i = 0; i < cmd->relocs_num; ++i) {
205204 struct drm_qxl_reloc reloc;
206205 struct drm_qxl_reloc __user *u = u64_to_user_ptr(cmd->relocs);
@@ -230,7 +229,6 @@ static int qxl_process_single_command(struct qxl_device *qdev, · 23 unmodified lines
230229 reloc_info[i].dst_bo = cmd_bo;
231230 reloc_info[i].dst_offset = reloc.dst_offset + release->release_offset;
232231 }
233− num_relocs++;
234232
235233 /* reserve and validate the reloc dst bo */
236234 if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle) {
drivers/gpu/drm/rockchip/rockchip_vop2_reg.c+0−2
@@ -17,9 +17,7 @@ · 16 unmodified lines
1717
1818 static const uint32_t formats_cluster[] = {
1919 DRM_FORMAT_XRGB2101010,
20− DRM_FORMAT_ARGB2101010,
2120 DRM_FORMAT_XBGR2101010,
22− DRM_FORMAT_ABGR2101010,
2321 DRM_FORMAT_XRGB8888,
2422 DRM_FORMAT_ARGB8888,
2523 DRM_FORMAT_XBGR8888,
drivers/gpu/drm/scheduler/sched_entity.c+9−3
@@ -71,13 +71,19 @@ int drm_sched_entity_init(struct drm_sched_entity *entity, · 70 unmodified lines
7171 entity->guilty = guilty;
7272 entity->num_sched_list = num_sched_list;
7373 entity->priority = priority;
74+ /*
75+ * It's perfectly valid to initialize an entity without having a valid
76+ * scheduler attached. It's just not valid to use the scheduler before it
77+ * is initialized itself.
78+ */
7479 entity->sched_list = num_sched_list > 1 ? sched_list : NULL;
7580 RCU_INIT_POINTER(entity->last_scheduled, NULL);
7681 RB_CLEAR_NODE(&entity->rb_tree_node);
7782
78− if (!sched_list[0]->sched_rq) {
79− /* Warn drivers not to do this and to fix their DRM
80− * calling order.
83+ if (num_sched_list && !sched_list[0]->sched_rq) {
84+ /* Since every entry covered by num_sched_list
85+ * should be non-NULL and therefore we warn drivers
86+ * not to do this and to fix their DRM calling order.
8187 */
8288 pr_warn("%s: called with uninitialized scheduler\n", __func__);
8389 } else if (num_sched_list) {
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+9−6
@@ -1444,12 +1444,15 @@ static void vmw_debugfs_resource_managers_init(struct vmw_private *vmw) · 1443 unmodified lines
14441444 root, "system_ttm");
14451445 ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_VRAM),
14461446 root, "vram_ttm");
1447− ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_GMR),
1448− root, "gmr_ttm");
1449− ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_MOB),
1450− root, "mob_ttm");
1451− ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_SYSTEM),
1452− root, "system_mob_ttm");
1447+ if (vmw->has_gmr)
1448+ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_GMR),
1449+ root, "gmr_ttm");
1450+ if (vmw->has_mob) {
1451+ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_MOB),
1452+ root, "mob_ttm");
1453+ ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_SYSTEM),
1454+ root, "system_mob_ttm");
1455+ }
14531456 }
14541457
14551458 static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
drivers/gpu/drm/xe/Makefile+2−2
@@ -172,8 +172,8 @@ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ · 171 unmodified lines
172172 -Ddrm_i915_gem_object=xe_bo \
173173 -Ddrm_i915_private=xe_device
174174
175−CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init)
176−CFLAGS_i915-display/intel_display_device.o = $(call cc-disable-warning, override-init)
175+CFLAGS_i915-display/intel_fbdev.o = -Wno-override-init
176+CFLAGS_i915-display/intel_display_device.o = -Wno-override-init
177177
178178 # Rule to build SOC code shared with i915
179179 $(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE
drivers/gpu/drm/xe/xe_bo.c+9−50
@@ -144,9 +144,6 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo, · 143 unmodified lines
144144 .mem_type = XE_PL_TT,
145145 };
146146 *c += 1;
147−
148− if (bo->props.preferred_mem_type == XE_BO_PROPS_INVALID)
149− bo->props.preferred_mem_type = XE_PL_TT;
150147 }
151148 }
152149
@@ -181,25 +178,15 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo, · 28 unmodified lines
181178 }
182179 places[*c] = place;
183180 *c += 1;
184−
185− if (bo->props.preferred_mem_type == XE_BO_PROPS_INVALID)
186− bo->props.preferred_mem_type = mem_type;
187181 }
188182
189183 static void try_add_vram(struct xe_device *xe, struct xe_bo *bo,
190184 u32 bo_flags, u32 *c)
191185 {
192− if (bo->props.preferred_gt == XE_GT1) {
193− if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
194− add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
195− if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
196− add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
197− } else {
198− if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
199− add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
200− if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
201− add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
202− }
186+ if (bo_flags & XE_BO_CREATE_VRAM0_BIT)
187+ add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM0, c);
188+ if (bo_flags & XE_BO_CREATE_VRAM1_BIT)
189+ add_vram(xe, bo, bo->placements, bo_flags, XE_PL_VRAM1, c);
203190 }
204191
205192 static void try_add_stolen(struct xe_device *xe, struct xe_bo *bo,
@@ -223,17 +210,8 @@ static int __xe_bo_placement_for_flags(struct xe_device *xe, struct xe_bo *bo, · 17 unmodified lines
223210 {
224211 u32 c = 0;
225212
226− bo->props.preferred_mem_type = XE_BO_PROPS_INVALID;
227−
228− /* The order of placements should indicate preferred location */
229−
230− if (bo->props.preferred_mem_class == DRM_XE_MEM_REGION_CLASS_SYSMEM) {
231− try_add_system(xe, bo, bo_flags, &c);
232− try_add_vram(xe, bo, bo_flags, &c);
233− } else {
234− try_add_vram(xe, bo, bo_flags, &c);
235− try_add_system(xe, bo, bo_flags, &c);
236− }
213+ try_add_vram(xe, bo, bo_flags, &c);
214+ try_add_system(xe, bo, bo_flags, &c);
237215 try_add_stolen(xe, bo, bo_flags, &c);
238216
239217 if (!c)
@@ -1126,13 +1104,6 @@ static void xe_gem_object_close(struct drm_gem_object *obj, · 886 unmodified lines
11261104 }
11271105 }
11281106
1129−static bool should_migrate_to_system(struct xe_bo *bo)
1130−{
1131− struct xe_device *xe = xe_bo_device(bo);
1132−
1133− return xe_device_in_fault_mode(xe) && bo->props.cpu_atomic;
1134−}
1135−
11361107 static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
11371108 {
11381109 struct ttm_buffer_object *tbo = vmf->vma->vm_private_data;
@@ -1141,7 +1112,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf) · 2 unmodified lines
11411112 struct xe_bo *bo = ttm_to_xe_bo(tbo);
11421113 bool needs_rpm = bo->flags & XE_BO_CREATE_VRAM_MASK;
11431114 vm_fault_t ret;
1144− int idx, r = 0;
1115+ int idx;
11451116
11461117 if (needs_rpm)
11471118 xe_device_mem_access_get(xe);
@@ -1153,17 +1124,8 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf) · 5 unmodified lines
11531124 if (drm_dev_enter(ddev, &idx)) {
11541125 trace_xe_bo_cpu_fault(bo);
11551126
1156− if (should_migrate_to_system(bo)) {
1157− r = xe_bo_migrate(bo, XE_PL_TT);
1158− if (r == -EBUSY || r == -ERESTARTSYS || r == -EINTR)
1159− ret = VM_FAULT_NOPAGE;
1160− else if (r)
1161− ret = VM_FAULT_SIGBUS;
1162− }
1163− if (!ret)
1164− ret = ttm_bo_vm_fault_reserved(vmf,
1165− vmf->vma->vm_page_prot,
1166− TTM_BO_VM_NUM_PREFAULT);
1127+ ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
1128+ TTM_BO_VM_NUM_PREFAULT);
11671129 drm_dev_exit(idx);
11681130 } else {
11691131 ret = ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
@@ -1291,9 +1253,6 @@ struct xe_bo *___xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo, · 121 unmodified lines
12911253 bo->flags = flags;
12921254 bo->cpu_caching = cpu_caching;
12931255 bo->ttm.base.funcs = &xe_gem_object_funcs;
1294− bo->props.preferred_mem_class = XE_BO_PROPS_INVALID;
1295− bo->props.preferred_gt = XE_BO_PROPS_INVALID;
1296− bo->props.preferred_mem_type = XE_BO_PROPS_INVALID;
12971256 bo->ttm.priority = XE_BO_PRIORITY_NORMAL;
12981257 INIT_LIST_HEAD(&bo->pinned_link);
12991258 #ifdef CONFIG_PROC_FS
drivers/gpu/drm/xe/xe_bo_types.h+0−19
@@ -56,25 +56,6 @@ struct xe_bo { · 55 unmodified lines
5656 */
5757 struct list_head client_link;
5858 #endif
59− /** @props: BO user controlled properties */
60− struct {
61− /** @preferred_mem: preferred memory class for this BO */
62− s16 preferred_mem_class;
63− /** @prefered_gt: preferred GT for this BO */
64− s16 preferred_gt;
65− /** @preferred_mem_type: preferred memory type */
66− s32 preferred_mem_type;
67− /**
68− * @cpu_atomic: the CPU expects to do atomics operations to
69− * this BO
70− */
71− bool cpu_atomic;
72− /**
73− * @device_atomic: the device expects to do atomics operations
74− * to this BO
75− */
76− bool device_atomic;
77− } props;
7859 /** @freed: List node for delayed put. */
7960 struct llist_node freed;
8061 /** @created: Whether the bo has passed initial creation */
drivers/gpu/drm/xe/xe_device.h+2−2
@@ -58,7 +58,7 @@ static inline struct xe_tile *xe_device_get_root_tile(struct xe_device *xe) · 57 unmodified lines
5858
5959 static inline struct xe_gt *xe_tile_get_gt(struct xe_tile *tile, u8 gt_id)
6060 {
61− if (drm_WARN_ON(&tile_to_xe(tile)->drm, gt_id > XE_MAX_GT_PER_TILE))
61+ if (drm_WARN_ON(&tile_to_xe(tile)->drm, gt_id >= XE_MAX_GT_PER_TILE))
6262 gt_id = 0;
6363
6464 return gt_id ? tile->media_gt : tile->primary_gt;
@@ -79,7 +79,7 @@ static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id) · 14 unmodified lines
7979 if (MEDIA_VER(xe) >= 13) {
8080 gt = xe_tile_get_gt(root_tile, gt_id);
8181 } else {
82− if (drm_WARN_ON(&xe->drm, gt_id > XE_MAX_TILES_PER_DEVICE))
82+ if (drm_WARN_ON(&xe->drm, gt_id >= XE_MAX_TILES_PER_DEVICE))
8383 gt_id = 0;
8484
8585 gt = xe->tiles[gt_id].primary_gt;
drivers/gpu/drm/xe/xe_exec_queue.c+1−1
@@ -448,7 +448,7 @@ find_hw_engine(struct xe_device *xe, · 447 unmodified lines
448448 {
449449 u32 idx;
450450
451− if (eci.engine_class > ARRAY_SIZE(user_to_xe_engine_class))
451+ if (eci.engine_class >= ARRAY_SIZE(user_to_xe_engine_class))
452452 return NULL;
453453
454454 if (eci.gt_id >= xe->info.gt_count)
drivers/gpu/drm/xe/xe_guc_submit.c+1−1
@@ -1220,7 +1220,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) · 1219 unmodified lines
12201220 init_waitqueue_head(&ge->suspend_wait);
12211221
12221222 timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT :
1223− q->sched_props.job_timeout_ms;
1223+ msecs_to_jiffies(q->sched_props.job_timeout_ms);
12241224 err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
12251225 get_submit_wq(guc),
12261226 q->lrc[0].ring.size / MAX_JOB_SIZE_BYTES, 64,
drivers/gpu/drm/xe/xe_lrc.c+9−11
@@ -97,7 +97,6 @@ static void set_offsets(u32 *regs, · 96 unmodified lines
9797 #define REG16(x) \
9898 (((x) >> 9) | BIT(7) | BUILD_BUG_ON_ZERO(x >= 0x10000)), \
9999 (((x) >> 2) & 0x7f)
100−#define END 0
101100 {
102101 const u32 base = hwe->mmio_base;
103102
@@ -168,7 +167,7 @@ static const u8 gen12_xcs_offsets[] = { · 64 unmodified lines
168167 REG16(0x274),
169168 REG16(0x270),
170169
171− END
170+ 0
172171 };
173172
174173 static const u8 dg2_xcs_offsets[] = {
@@ -202,7 +201,7 @@ static const u8 dg2_xcs_offsets[] = { · 27 unmodified lines
202201 REG16(0x274),
203202 REG16(0x270),
204203
205− END
204+ 0
206205 };
207206
208207 static const u8 gen12_rcs_offsets[] = {
@@ -298,7 +297,7 @@ static const u8 gen12_rcs_offsets[] = { · 89 unmodified lines
298297 REG(0x084),
299298 NOP(1),
300299
301− END
300+ 0
302301 };
303302
304303 static const u8 xehp_rcs_offsets[] = {
@@ -339,7 +338,7 @@ static const u8 xehp_rcs_offsets[] = { · 34 unmodified lines
339338 LRI(1, 0),
340339 REG(0x0c8),
341340
342− END
341+ 0
343342 };
344343
345344 static const u8 dg2_rcs_offsets[] = {
@@ -382,7 +381,7 @@ static const u8 dg2_rcs_offsets[] = { · 36 unmodified lines
382381 LRI(1, 0),
383382 REG(0x0c8),
384383
385− END
384+ 0
386385 };
387386
388387 static const u8 mtl_rcs_offsets[] = {
@@ -425,7 +424,7 @@ static const u8 mtl_rcs_offsets[] = { · 36 unmodified lines
425424 LRI(1, 0),
426425 REG(0x0c8),
427426
428− END
427+ 0
429428 };
430429
431430 #define XE2_CTX_COMMON \
@@ -471,7 +470,7 @@ static const u8 xe2_rcs_offsets[] = { · 39 unmodified lines
471470 LRI(1, 0), /* [0x47] */
472471 REG(0x0c8), /* [0x48] R_PWR_CLK_STATE */
473472
474− END
473+ 0
475474 };
476475
477476 static const u8 xe2_bcs_offsets[] = {
@@ -482,16 +481,15 @@ static const u8 xe2_bcs_offsets[] = { · 4 unmodified lines
482481 REG16(0x200), /* [0x42] BCS_SWCTRL */
483482 REG16(0x204), /* [0x44] BLIT_CCTL */
484483
485− END
484+ 0
486485 };
487486
488487 static const u8 xe2_xcs_offsets[] = {
489488 XE2_CTX_COMMON,
490489
491− END
490+ 0
492491 };
493492
494−#undef END
495493 #undef REG16
496494 #undef REG
497495 #undef LRI
drivers/gpu/drm/xe/xe_query.c+1−1
@@ -132,7 +132,7 @@ query_engine_cycles(struct xe_device *xe, · 131 unmodified lines
132132 return -EINVAL;
133133
134134 eci = &resp.eci;
135− if (eci->gt_id > XE_MAX_GT_PER_TILE)
135+ if (eci->gt_id >= XE_MAX_GT_PER_TILE)
136136 return -EINVAL;
137137
138138 gt = xe_device_get_gt(xe, eci->gt_id);
drivers/i2c/busses/i2c-i801.c+4−3
@@ -536,11 +536,12 @@ static int i801_block_transaction_by_block(struct i801_priv *priv, · 535 unmodified lines
536536
537537 if (read_write == I2C_SMBUS_READ ||
538538 command == I2C_SMBUS_BLOCK_PROC_CALL) {
539− status = i801_get_block_len(priv);
540− if (status < 0)
539+ len = i801_get_block_len(priv);
540+ if (len < 0) {
541+ status = len;
541542 goto out;
543+ }
542544
543− len = status;
544545 data->block[0] = len;
545546 inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
546547 for (i = 0; i < len; i++)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c+25−13
@@ -1139,7 +1139,8 @@ static void arm_smmu_write_ste(struct arm_smmu_master *master, u32 sid, · 1138 unmodified lines
11391139 * requires a breaking update, zero the V bit, write all qwords
11401140 * but 0, then set qword 0
11411141 */
1142− unused_update.data[0] = entry->data[0] & (~STRTAB_STE_0_V);
1142+ unused_update.data[0] = entry->data[0] &
1143+ cpu_to_le64(~STRTAB_STE_0_V);
11431144 entry_set(smmu, sid, entry, &unused_update, 0, 1);
11441145 entry_set(smmu, sid, entry, target, 1, num_entry_qwords - 1);
11451146 entry_set(smmu, sid, entry, target, 0, 1);
@@ -1453,14 +1454,17 @@ static void arm_smmu_make_abort_ste(struct arm_smmu_ste *target) · 307 unmodified lines
14531454 FIELD_PREP(STRTAB_STE_0_CFG, STRTAB_STE_0_CFG_ABORT));
14541455 }
14551456
1456−static void arm_smmu_make_bypass_ste(struct arm_smmu_ste *target)
1457+static void arm_smmu_make_bypass_ste(struct arm_smmu_device *smmu,
1458+ struct arm_smmu_ste *target)
14571459 {
14581460 memset(target, 0, sizeof(*target));
14591461 target->data[0] = cpu_to_le64(
14601462 STRTAB_STE_0_V |
14611463 FIELD_PREP(STRTAB_STE_0_CFG, STRTAB_STE_0_CFG_BYPASS));
1462− target->data[1] = cpu_to_le64(
1463− FIELD_PREP(STRTAB_STE_1_SHCFG, STRTAB_STE_1_SHCFG_INCOMING));
1464+
1465+ if (smmu->features & ARM_SMMU_FEAT_ATTR_TYPES_OVR)
1466+ target->data[1] = cpu_to_le64(FIELD_PREP(STRTAB_STE_1_SHCFG,
1467+ STRTAB_STE_1_SHCFG_INCOMING));
14641468 }
14651469
14661470 static void arm_smmu_make_cdtable_ste(struct arm_smmu_ste *target,
@@ -1523,6 +1527,7 @@ static void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target, · 56 unmodified lines
15231527 typeof(&pgtbl_cfg->arm_lpae_s2_cfg.vtcr) vtcr =
15241528 &pgtbl_cfg->arm_lpae_s2_cfg.vtcr;
15251529 u64 vtcr_val;
1530+ struct arm_smmu_device *smmu = master->smmu;
15261531
15271532 memset(target, 0, sizeof(*target));
15281533 target->data[0] = cpu_to_le64(
@@ -1531,9 +1536,11 @@ static void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target, · 2 unmodified lines
15311536
15321537 target->data[1] = cpu_to_le64(
15331538 FIELD_PREP(STRTAB_STE_1_EATS,
1534− master->ats_enabled ? STRTAB_STE_1_EATS_TRANS : 0) |
1535− FIELD_PREP(STRTAB_STE_1_SHCFG,
1536− STRTAB_STE_1_SHCFG_INCOMING));
1539+ master->ats_enabled ? STRTAB_STE_1_EATS_TRANS : 0));
1540+
1541+ if (smmu->features & ARM_SMMU_FEAT_ATTR_TYPES_OVR)
1542+ target->data[1] |= cpu_to_le64(FIELD_PREP(STRTAB_STE_1_SHCFG,
1543+ STRTAB_STE_1_SHCFG_INCOMING));
15371544
15381545 vtcr_val = FIELD_PREP(STRTAB_STE_2_VTCR_S2T0SZ, vtcr->tsz) |
15391546 FIELD_PREP(STRTAB_STE_2_VTCR_S2SL0, vtcr->sl) |
@@ -1560,7 +1567,8 @@ static void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target, · 20 unmodified lines
15601567 * This can safely directly manipulate the STE memory without a sync sequence
15611568 * because the STE table has not been installed in the SMMU yet.
15621569 */
1563−static void arm_smmu_init_initial_stes(struct arm_smmu_ste *strtab,
1570+static void arm_smmu_init_initial_stes(struct arm_smmu_device *smmu,
1571+ struct arm_smmu_ste *strtab,
15641572 unsigned int nent)
15651573 {
15661574 unsigned int i;
@@ -1569,7 +1577,7 @@ static void arm_smmu_init_initial_stes(struct arm_smmu_ste *strtab, · 2 unmodified lines
15691577 if (disable_bypass)
15701578 arm_smmu_make_abort_ste(strtab);
15711579 else
1572− arm_smmu_make_bypass_ste(strtab);
1580+ arm_smmu_make_bypass_ste(smmu, strtab);
15731581 strtab++;
15741582 }
15751583 }
@@ -1597,7 +1605,7 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid) · 21 unmodified lines
15971605 return -ENOMEM;
15981606 }
15991607
1600− arm_smmu_init_initial_stes(desc->l2ptr, 1 << STRTAB_SPLIT);
1608+ arm_smmu_init_initial_stes(smmu, desc->l2ptr, 1 << STRTAB_SPLIT);
16011609 arm_smmu_write_strtab_l1_desc(strtab, desc);
16021610 return 0;
16031611 }
@@ -2637,8 +2645,9 @@ static int arm_smmu_attach_dev_identity(struct iommu_domain *domain, · 1033 unmodified lines
26372645 struct device *dev)
26382646 {
26392647 struct arm_smmu_ste ste;
2648+ struct arm_smmu_master *master = dev_iommu_priv_get(dev);
26402649
2641− arm_smmu_make_bypass_ste(&ste);
2650+ arm_smmu_make_bypass_ste(master->smmu, &ste);
26422651 return arm_smmu_attach_dev_ste(dev, &ste);
26432652 }
26442653
@@ -3264,7 +3273,7 @@ static int arm_smmu_init_strtab_linear(struct arm_smmu_device *smmu) · 619 unmodified lines
32643273 reg |= FIELD_PREP(STRTAB_BASE_CFG_LOG2SIZE, smmu->sid_bits);
32653274 cfg->strtab_base_cfg = reg;
32663275
3267− arm_smmu_init_initial_stes(strtab, cfg->num_l1_ents);
3276+ arm_smmu_init_initial_stes(smmu, strtab, cfg->num_l1_ents);
32683277 return 0;
32693278 }
32703279
@@ -3777,6 +3786,9 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) · 506 unmodified lines
37773786 return -ENXIO;
37783787 }
37793788
3789+ if (reg & IDR1_ATTR_TYPES_OVR)
3790+ smmu->features |= ARM_SMMU_FEAT_ATTR_TYPES_OVR;
3791+
37803792 /* Queue sizes, capped to ensure natural alignment */
37813793 smmu->cmdq.q.llq.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT,
37823794 FIELD_GET(IDR1_CMDQS, reg));
@@ -3992,7 +4004,7 @@ static void arm_smmu_rmr_install_bypass_ste(struct arm_smmu_device *smmu) · 209 unmodified lines
39924004 * STE table is not programmed to HW, see
39934005 * arm_smmu_initial_bypass_stes()
39944006 */
3995− arm_smmu_make_bypass_ste(
4007+ arm_smmu_make_bypass_ste(smmu,
39964008 arm_smmu_get_step_for_sid(smmu, rmr->sids[i]));
39974009 }
39984010 }
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h+2−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #define IDR1_TABLES_PRESET (1 << 30)
4545 #define IDR1_QUEUES_PRESET (1 << 29)
4646 #define IDR1_REL (1 << 28)
47+#define IDR1_ATTR_TYPES_OVR (1 << 27)
4748 #define IDR1_CMDQS GENMASK(25, 21)
4849 #define IDR1_EVTQS GENMASK(20, 16)
4950 #define IDR1_PRIQS GENMASK(15, 11)
@@ -647,6 +648,7 @@ struct arm_smmu_device { · 597 unmodified lines
647648 #define ARM_SMMU_FEAT_SVA (1 << 17)
648649 #define ARM_SMMU_FEAT_E2H (1 << 18)
649650 #define ARM_SMMU_FEAT_NESTING (1 << 19)
651+#define ARM_SMMU_FEAT_ATTR_TYPES_OVR (1 << 20)
650652 u32 features;
651653
652654 #define ARM_SMMU_OPT_SKIP_PREFETCH (1 << 0)
drivers/iommu/iommu.c+10−1
@@ -3354,6 +3354,7 @@ int iommu_attach_device_pasid(struct iommu_domain *domain, · 3353 unmodified lines
33543354 {
33553355 /* Caller must be a probed driver on dev */
33563356 struct iommu_group *group = dev->iommu_group;
3357+ struct group_device *device;
33573358 void *curr;
33583359 int ret;
33593360
@@ -3363,10 +3364,18 @@ int iommu_attach_device_pasid(struct iommu_domain *domain, · 3 unmodified lines
33633364 if (!group)
33643365 return -ENODEV;
33653366
3366− if (!dev_has_iommu(dev) || dev_iommu_ops(dev) != domain->owner)
3367+ if (!dev_has_iommu(dev) || dev_iommu_ops(dev) != domain->owner ||
3368+ pasid == IOMMU_NO_PASID)
33673369 return -EINVAL;
33683370
33693371 mutex_lock(&group->mutex);
3372+ for_each_group_device(group, device) {
3373+ if (pasid >= device->dev->iommu->max_pasids) {
3374+ ret = -EINVAL;
3375+ goto out_unlock;
3376+ }
3377+ }
3378+
33703379 curr = xa_cmpxchg(&group->pasid_array, pasid, NULL, domain, GFP_KERNEL);
33713380 if (curr) {
33723381 ret = xa_err(curr) ? : -EBUSY;
drivers/irqchip/irq-armada-370-xp.c+1−1
@@ -316,7 +316,7 @@ static int armada_370_xp_msi_init(struct device_node *node, · 315 unmodified lines
316316 return 0;
317317 }
318318 #else
319−static void armada_370_xp_msi_reenable_percpu(void) {}
319+static __maybe_unused void armada_370_xp_msi_reenable_percpu(void) {}
320320
321321 static inline int armada_370_xp_msi_init(struct device_node *node,
322322 phys_addr_t main_int_phys_base)
drivers/md/dm-integrity.c+1−1
@@ -4221,7 +4221,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv · 4220 unmodified lines
42214221 } else if (sscanf(opt_string, "sectors_per_bit:%llu%c", &llval, &dummy) == 1) {
42224222 log2_sectors_per_bitmap_bit = !llval ? 0 : __ilog2_u64(llval);
42234223 } else if (sscanf(opt_string, "bitmap_flush_interval:%u%c", &val, &dummy) == 1) {
4224− if (val >= (uint64_t)UINT_MAX * 1000 / HZ) {
4224+ if ((uint64_t)val >= (uint64_t)UINT_MAX * 1000 / HZ) {
42254225 r = -EINVAL;
42264226 ti->error = "Invalid bitmap_flush_interval argument";
42274227 goto bad;
drivers/md/dm-vdo/murmurhash3.c+8−25
@@ -8,33 +8,14 @@ · 7 unmodified lines
88
99 #include "murmurhash3.h"
1010
11+#include <asm/unaligned.h>
12+
1113 static inline u64 rotl64(u64 x, s8 r)
1214 {
1315 return (x << r) | (x >> (64 - r));
1416 }
1517
1618 #define ROTL64(x, y) rotl64(x, y)
17−static __always_inline u64 getblock64(const u64 *p, int i)
18−{
19−#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
20− return p[i];
21−#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
22− return __builtin_bswap64(p[i]);
23−#else
24−#error "can't figure out byte order"
25−#endif
26−}
27−
28−static __always_inline void putblock64(u64 *p, int i, u64 value)
29−{
30−#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
31− p[i] = value;
32−#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
33− p[i] = __builtin_bswap64(value);
34−#else
35−#error "can't figure out byte order"
36−#endif
37−}
3819
3920 /* Finalization mix - force all bits of a hash block to avalanche */
4021
@@ -60,6 +41,8 @@ void murmurhash3_128(const void *key, const int len, const u32 seed, void *out) · 19 unmodified lines
6041 const u64 c1 = 0x87c37b91114253d5LLU;
6142 const u64 c2 = 0x4cf5ad432745937fLLU;
6243
44+ u64 *hash_out = out;
45+
6346 /* body */
6447
6548 const u64 *blocks = (const u64 *)(data);
@@ -67,8 +50,8 @@ void murmurhash3_128(const void *key, const int len, const u32 seed, void *out) · 1 unmodified line
6750 int i;
6851
6952 for (i = 0; i < nblocks; i++) {
70− u64 k1 = getblock64(blocks, i * 2 + 0);
71− u64 k2 = getblock64(blocks, i * 2 + 1);
53+ u64 k1 = get_unaligned_le64(&blocks[i * 2]);
54+ u64 k2 = get_unaligned_le64(&blocks[i * 2 + 1]);
7255
7356 k1 *= c1;
7457 k1 = ROTL64(k1, 31);
@@ -170,6 +153,6 @@ void murmurhash3_128(const void *key, const int len, const u32 seed, void *out) · 95 unmodified lines
170153 h1 += h2;
171154 h2 += h1;
172155
173− putblock64((u64 *)out, 0, h1);
174− putblock64((u64 *)out, 1, h2);
156+ put_unaligned_le64(h1, &hash_out[0]);
157+ put_unaligned_le64(h2, &hash_out[1]);
175158 }
drivers/mmc/core/block.c+2−2
@@ -413,7 +413,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( · 412 unmodified lines
413413 struct mmc_blk_ioc_data *idata;
414414 int err;
415415
416− idata = kmalloc(sizeof(*idata), GFP_KERNEL);
416+ idata = kzalloc(sizeof(*idata), GFP_KERNEL);
417417 if (!idata) {
418418 err = -ENOMEM;
419419 goto out;
@@ -488,7 +488,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, · 68 unmodified lines
488488 if (idata->flags & MMC_BLK_IOC_DROP)
489489 return 0;
490490
491− if (idata->flags & MMC_BLK_IOC_SBC)
491+ if (idata->flags & MMC_BLK_IOC_SBC && i > 0)
492492 prev_idata = idatas[i - 1];
493493
494494 /*
drivers/mmc/host/sdhci-of-dwcmshc.c+17−11
@@ -999,6 +999,17 @@ free_pltfm: · 998 unmodified lines
999999 return err;
10001000 }
10011001
1002+static void dwcmshc_disable_card_clk(struct sdhci_host *host)
1003+{
1004+ u16 ctrl;
1005+
1006+ ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
1007+ if (ctrl & SDHCI_CLOCK_CARD_EN) {
1008+ ctrl &= ~SDHCI_CLOCK_CARD_EN;
1009+ sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL);
1010+ }
1011+}
1012+
10021013 static void dwcmshc_remove(struct platform_device *pdev)
10031014 {
10041015 struct sdhci_host *host = platform_get_drvdata(pdev);
@@ -1006,8 +1017,14 @@ static void dwcmshc_remove(struct platform_device *pdev) · 1 unmodified line
10061017 struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host);
10071018 struct rk35xx_priv *rk_priv = priv->priv;
10081019
1020+ pm_runtime_get_sync(&pdev->dev);
1021+ pm_runtime_disable(&pdev->dev);
1022+ pm_runtime_put_noidle(&pdev->dev);
1023+
10091024 sdhci_remove_host(host, 0);
10101025
1026+ dwcmshc_disable_card_clk(host);
1027+
10111028 clk_disable_unprepare(pltfm_host->clk);
10121029 clk_disable_unprepare(priv->bus_clk);
10131030 if (rk_priv)
@@ -1099,17 +1116,6 @@ static void dwcmshc_enable_card_clk(struct sdhci_host *host) · 85 unmodified lines
10991116 }
11001117 }
11011118
1102−static void dwcmshc_disable_card_clk(struct sdhci_host *host)
1103−{
1104− u16 ctrl;
1105−
1106− ctrl = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
1107− if (ctrl & SDHCI_CLOCK_CARD_EN) {
1108− ctrl &= ~SDHCI_CLOCK_CARD_EN;
1109− sdhci_writew(host, ctrl, SDHCI_CLOCK_CONTROL);
1110− }
1111−}
1112−
11131119 static int dwcmshc_runtime_suspend(struct device *dev)
11141120 {
11151121 struct sdhci_host *host = dev_get_drvdata(dev);
drivers/mmc/host/sdhci-omap.c+3−0
@@ -1439,6 +1439,9 @@ static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev) · 1438 unmodified lines
14391439 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
14401440 struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);
14411441
1442+ if (host->tuning_mode != SDHCI_TUNING_MODE_3)
1443+ mmc_retune_needed(host->mmc);
1444+
14421445 if (omap_host->con != -EINVAL)
14431446 sdhci_runtime_suspend_host(host);
14441447
drivers/net/dsa/mt7530.c+3−2
@@ -2268,8 +2268,6 @@ mt7530_setup(struct dsa_switch *ds) · 2267 unmodified lines
22682268 SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
22692269 SYS_CTRL_REG_RST);
22702270
2271− mt7530_pll_setup(priv);
2272−
22732271 /* Lower Tx driving for TRGMII path */
22742272 for (i = 0; i < NUM_TRGMII_CTRL; i++)
22752273 mt7530_write(priv, MT7530_TRGMII_TD_ODT(i),
@@ -2285,6 +2283,9 @@ mt7530_setup(struct dsa_switch *ds) · 9 unmodified lines
22852283 val |= MHWTRAP_MANUAL;
22862284 mt7530_write(priv, MT7530_MHWTRAP, val);
22872285
2286+ if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_40MHZ)
2287+ mt7530_pll_setup(priv);
2288+
22882289 mt753x_trap_frames(priv);
22892290
22902291 /* Enable and reset MIB counters */
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c+20−23
@@ -392,7 +392,9 @@ static void umac_reset(struct bcmasp_intf *intf) · 391 unmodified lines
392392 umac_wl(intf, 0x0, UMC_CMD);
393393 umac_wl(intf, UMC_CMD_SW_RESET, UMC_CMD);
394394 usleep_range(10, 100);
395− umac_wl(intf, 0x0, UMC_CMD);
395+ /* We hold the umac in reset and bring it out of
396+ * reset when phy link is up.
397+ */
396398 }
397399
398400 static void umac_set_hw_addr(struct bcmasp_intf *intf,
@@ -412,6 +414,8 @@ static void umac_enable_set(struct bcmasp_intf *intf, u32 mask, · 13 unmodified lines
412414 u32 reg;
413415
414416 reg = umac_rl(intf, UMC_CMD);
417+ if (reg & UMC_CMD_SW_RESET)
418+ return;
415419 if (enable)
416420 reg |= mask;
417421 else
@@ -430,7 +434,6 @@ static void umac_init(struct bcmasp_intf *intf) · 12 unmodified lines
430434 umac_wl(intf, 0x800, UMC_FRM_LEN);
431435 umac_wl(intf, 0xffff, UMC_PAUSE_CNTRL);
432436 umac_wl(intf, 0x800, UMC_RX_MAX_PKT_SZ);
433− umac_enable_set(intf, UMC_CMD_PROMISC, 1);
434437 }
435438
436439 static int bcmasp_tx_poll(struct napi_struct *napi, int budget)
@@ -658,6 +661,12 @@ static void bcmasp_adj_link(struct net_device *dev) · 221 unmodified lines
658661 UMC_CMD_HD_EN | UMC_CMD_RX_PAUSE_IGNORE |
659662 UMC_CMD_TX_PAUSE_IGNORE);
660663 reg |= cmd_bits;
664+ if (reg & UMC_CMD_SW_RESET) {
665+ reg &= ~UMC_CMD_SW_RESET;
666+ umac_wl(intf, reg, UMC_CMD);
667+ udelay(2);
668+ reg |= UMC_CMD_TX_EN | UMC_CMD_RX_EN | UMC_CMD_PROMISC;
669+ }
661670 umac_wl(intf, reg, UMC_CMD);
662671
663672 active = phy_init_eee(phydev, 0) >= 0;
@@ -1035,19 +1044,12 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) · 371 unmodified lines
10351044
10361045 /* Indicate that the MAC is responsible for PHY PM */
10371046 phydev->mac_managed_pm = true;
1038− } else if (!intf->wolopts) {
1039− ret = phy_resume(dev->phydev);
1040− if (ret)
1041− goto err_phy_disable;
10421047 }
10431048
10441049 umac_reset(intf);
10451050
10461051 umac_init(intf);
10471052
1048− /* Disable the UniMAC RX/TX */
1049− umac_enable_set(intf, (UMC_CMD_RX_EN | UMC_CMD_TX_EN), 0);
1050−
10511053 umac_set_hw_addr(intf, dev->dev_addr);
10521054
10531055 intf->old_duplex = -1;
@@ -1062,9 +1064,6 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) · 8 unmodified lines
10621064 netif_napi_add(intf->ndev, &intf->rx_napi, bcmasp_rx_poll);
10631065 bcmasp_enable_rx(intf, 1);
10641066
1065− /* Turn on UniMAC TX/RX */
1066− umac_enable_set(intf, (UMC_CMD_RX_EN | UMC_CMD_TX_EN), 1);
1067−
10681067 intf->crc_fwd = !!(umac_rl(intf, UMC_CMD) & UMC_CMD_CRC_FWD);
10691068
10701069 bcmasp_netif_start(dev);
@@ -1306,7 +1305,14 @@ static void bcmasp_suspend_to_wol(struct bcmasp_intf *intf) · 235 unmodified lines
13061305 if (intf->wolopts & WAKE_FILTER)
13071306 bcmasp_netfilt_suspend(intf);
13081307
1309− /* UniMAC receive needs to be turned on */
1308+ /* Bring UniMAC out of reset if needed and enable RX */
1309+ reg = umac_rl(intf, UMC_CMD);
1310+ if (reg & UMC_CMD_SW_RESET)
1311+ reg &= ~UMC_CMD_SW_RESET;
1312+
1313+ reg |= UMC_CMD_RX_EN | UMC_CMD_PROMISC;
1314+ umac_wl(intf, reg, UMC_CMD);
1315+
13101316 umac_enable_set(intf, UMC_CMD_RX_EN, 1);
13111317
13121318 if (intf->parent->wol_irq > 0) {
@@ -1324,7 +1330,6 @@ int bcmasp_interface_suspend(struct bcmasp_intf *intf) · 11 unmodified lines
13241330 {
13251331 struct device *kdev = &intf->parent->pdev->dev;
13261332 struct net_device *dev = intf->ndev;
1327− int ret = 0;
13281333
13291334 if (!netif_running(dev))
13301335 return 0;
@@ -1334,10 +1339,6 @@ int bcmasp_interface_suspend(struct bcmasp_intf *intf) · 3 unmodified lines
13341339 bcmasp_netif_deinit(dev);
13351340
13361341 if (!intf->wolopts) {
1337− ret = phy_suspend(dev->phydev);
1338− if (ret)
1339− goto out;
1340−
13411342 if (intf->internal_phy)
13421343 bcmasp_ephy_enable_set(intf, false);
13431344 else
@@ -1354,11 +1355,7 @@ int bcmasp_interface_suspend(struct bcmasp_intf *intf) · 10 unmodified lines
13541355
13551356 clk_disable_unprepare(intf->parent->clk);
13561357
1357− return ret;
1358−
1359−out:
1360− bcmasp_netif_init(dev, false);
1361− return ret;
1358+ return 0;
13621359 }
13631360
13641361 static void bcmasp_resume_from_wol(struct bcmasp_intf *intf)
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c+1−1
@@ -85,7 +85,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle, · 84 unmodified lines
8585 hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
8686 true);
8787
88− desc.data[0] = cpu_to_le32(tqp->index & 0x1ff);
88+ desc.data[0] = cpu_to_le32(tqp->index);
8989 ret = hclge_comm_cmd_send(hw, &desc, 1);
9090 if (ret) {
9191 dev_err(&hw->cmq.csq.pdev->dev,
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+17−2
@@ -78,6 +78,9 @@ static const struct hns3_stats hns3_rxq_stats[] = { · 77 unmodified lines
7878 #define HNS3_NIC_LB_TEST_NO_MEM_ERR 1
7979 #define HNS3_NIC_LB_TEST_TX_CNT_ERR 2
8080 #define HNS3_NIC_LB_TEST_RX_CNT_ERR 3
81+#define HNS3_NIC_LB_TEST_UNEXECUTED 4
82+
83+static int hns3_get_sset_count(struct net_device *netdev, int stringset);
8184
8285 static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
8386 {
@@ -418,18 +421,26 @@ static void hns3_do_external_lb(struct net_device *ndev, · 334 unmodified lines
418421 static void hns3_self_test(struct net_device *ndev,
419422 struct ethtool_test *eth_test, u64 *data)
420423 {
424+ int cnt = hns3_get_sset_count(ndev, ETH_SS_TEST);
421425 struct hns3_nic_priv *priv = netdev_priv(ndev);
422426 struct hnae3_handle *h = priv->ae_handle;
423427 int st_param[HNAE3_LOOP_NONE][2];
424428 bool if_running = netif_running(ndev);
429+ int i;
430+
431+ /* initialize the loopback test result, avoid marking an unexcuted
432+ * loopback test as PASS.
433+ */
434+ for (i = 0; i < cnt; i++)
435+ data[i] = HNS3_NIC_LB_TEST_UNEXECUTED;
425436
426437 if (hns3_nic_resetting(ndev)) {
427438 netdev_err(ndev, "dev resetting!");
428− return;
439+ goto failure;
429440 }
430441
431442 if (!(eth_test->flags & ETH_TEST_FL_OFFLINE))
432− return;
443+ goto failure;
433444
434445 if (netif_msg_ifdown(h))
435446 netdev_info(ndev, "self test start\n");
@@ -451,6 +462,10 @@ static void hns3_self_test(struct net_device *ndev, · 15 unmodified lines
451462
452463 if (netif_msg_ifdown(h))
453464 netdev_info(ndev, "self test end\n");
465+ return;
466+
467+failure:
468+ eth_test->flags |= ETH_TEST_FL_FAILED;
454469 }
455470
456471 static void hns3_update_limit_promisc_mode(struct net_device *netdev,
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c+4−0
@@ -11626,6 +11626,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) · 11625 unmodified lines
1162611626 if (ret)
1162711627 goto err_pci_uninit;
1162811628
11629+ devl_lock(hdev->devlink);
11630+
1162911631 /* Firmware command queue initialize */
1163011632 ret = hclge_comm_cmd_queue_init(hdev->pdev, &hdev->hw.hw);
1163111633 if (ret)
@@ -11805,6 +11807,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) · 173 unmodified lines
1180511807
1180611808 hclge_task_schedule(hdev, round_jiffies_relative(HZ));
1180711809
11810+ devl_unlock(hdev->devlink);
1180811811 return 0;
1180911812
1181011813 err_mdiobus_unreg:
@@ -11817,6 +11820,7 @@ err_msi_uninit: · 6 unmodified lines
1181711820 err_cmd_uninit:
1181811821 hclge_comm_cmd_uninit(hdev->ae_dev, &hdev->hw.hw);
1181911822 err_devlink_uninit:
11823+ devl_unlock(hdev->devlink);
1182011824 hclge_devlink_uninit(hdev);
1182111825 err_pci_uninit:
1182211826 pcim_iounmap(pdev, hdev->hw.hw.io_base);
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h+2−1
@@ -593,8 +593,9 @@ struct ice_aqc_recipe_data_elem { · 592 unmodified lines
593593 struct ice_aqc_recipe_to_profile {
594594 __le16 profile_id;
595595 u8 rsvd[6];
596− DECLARE_BITMAP(recipe_assoc, ICE_MAX_NUM_RECIPES);
596+ __le64 recipe_assoc;
597597 };
598+static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16);
598599
599600 /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3)
600601 */
drivers/net/ethernet/intel/ice/ice_lag.c+2−2
@@ -2041,7 +2041,7 @@ int ice_init_lag(struct ice_pf *pf) · 2040 unmodified lines
20412041 /* associate recipes to profiles */
20422042 for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) {
20432043 err = ice_aq_get_recipe_to_profile(&pf->hw, n,
2044− (u8 *)&recipe_bits, NULL);
2044+ &recipe_bits, NULL);
20452045 if (err)
20462046 continue;
20472047
@@ -2049,7 +2049,7 @@ int ice_init_lag(struct ice_pf *pf) · 1 unmodified line
20492049 recipe_bits |= BIT(lag->pf_recipe) |
20502050 BIT(lag->lport_recipe);
20512051 ice_aq_map_recipe_to_profile(&pf->hw, n,
2052− (u8 *)&recipe_bits, NULL);
2052+ recipe_bits, NULL);
20532053 }
20542054 }
20552055
drivers/net/ethernet/intel/ice/ice_lib.c+9−9
@@ -3091,7 +3091,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) · 3090 unmodified lines
30913091 {
30923092 struct ice_vsi_cfg_params params = {};
30933093 struct ice_coalesce_stored *coalesce;
3094− int prev_num_q_vectors = 0;
3094+ int prev_num_q_vectors;
30953095 struct ice_pf *pf;
30963096 int ret;
30973097
@@ -3105,13 +3105,6 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) · 7 unmodified lines
31053105 if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
31063106 return -EINVAL;
31073107
3108− coalesce = kcalloc(vsi->num_q_vectors,
3109− sizeof(struct ice_coalesce_stored), GFP_KERNEL);
3110− if (!coalesce)
3111− return -ENOMEM;
3112−
3113− prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
3114−
31153108 ret = ice_vsi_realloc_stat_arrays(vsi);
31163109 if (ret)
31173110 goto err_vsi_cfg;
@@ -3121,6 +3114,13 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) · 3 unmodified lines
31213114 if (ret)
31223115 goto err_vsi_cfg;
31233116
3117+ coalesce = kcalloc(vsi->num_q_vectors,
3118+ sizeof(struct ice_coalesce_stored), GFP_KERNEL);
3119+ if (!coalesce)
3120+ return -ENOMEM;
3121+
3122+ prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
3123+
31243124 ret = ice_vsi_cfg_tc_lan(pf, vsi);
31253125 if (ret) {
31263126 if (vsi_flags & ICE_VSI_FLAG_INIT) {
@@ -3139,8 +3139,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) · 12 unmodified lines
31393139
31403140 err_vsi_cfg_tc_lan:
31413141 ice_vsi_decfg(vsi);
3142−err_vsi_cfg:
31433142 kfree(coalesce);
3143+err_vsi_cfg:
31443144 return ret;
31453145 }
31463146
drivers/net/ethernet/intel/ice/ice_switch.c+14−10
@@ -2025,12 +2025,12 @@ error_out: · 2024 unmodified lines
20252025 * ice_aq_map_recipe_to_profile - Map recipe to packet profile
20262026 * @hw: pointer to the HW struct
20272027 * @profile_id: package profile ID to associate the recipe with
2028− * @r_bitmap: Recipe bitmap filled in and need to be returned as response
2028+ * @r_assoc: Recipe bitmap filled in and need to be returned as response
20292029 * @cd: pointer to command details structure or NULL
20302030 * Recipe to profile association (0x0291)
20312031 */
20322032 int
2033−ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
2033+ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
20342034 struct ice_sq_cd *cd)
20352035 {
20362036 struct ice_aqc_recipe_to_profile *cmd;
@@ -2042,7 +2042,7 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, · 5 unmodified lines
20422042 /* Set the recipe ID bit in the bitmask to let the device know which
20432043 * profile we are associating the recipe to
20442044 */
2045− memcpy(cmd->recipe_assoc, r_bitmap, sizeof(cmd->recipe_assoc));
2045+ cmd->recipe_assoc = cpu_to_le64(r_assoc);
20462046
20472047 return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
20482048 }
@@ -2051,12 +2051,12 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, · 2 unmodified lines
20512051 * ice_aq_get_recipe_to_profile - Map recipe to packet profile
20522052 * @hw: pointer to the HW struct
20532053 * @profile_id: package profile ID to associate the recipe with
2054− * @r_bitmap: Recipe bitmap filled in and need to be returned as response
2054+ * @r_assoc: Recipe bitmap filled in and need to be returned as response
20552055 * @cd: pointer to command details structure or NULL
20562056 * Associate profile ID with given recipe (0x0293)
20572057 */
20582058 int
2059−ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
2059+ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
20602060 struct ice_sq_cd *cd)
20612061 {
20622062 struct ice_aqc_recipe_to_profile *cmd;
@@ -2069,7 +2069,7 @@ ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, · 6 unmodified lines
20692069
20702070 status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
20712071 if (!status)
2072− memcpy(r_bitmap, cmd->recipe_assoc, sizeof(cmd->recipe_assoc));
2072+ *r_assoc = le64_to_cpu(cmd->recipe_assoc);
20732073
20742074 return status;
20752075 }
@@ -2108,6 +2108,7 @@ int ice_alloc_recipe(struct ice_hw *hw, u16 *rid) · 32 unmodified lines
21082108 static void ice_get_recp_to_prof_map(struct ice_hw *hw)
21092109 {
21102110 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
2111+ u64 recp_assoc;
21112112 u16 i;
21122113
21132114 for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) {
@@ -2115,8 +2116,9 @@ static void ice_get_recp_to_prof_map(struct ice_hw *hw) · 1 unmodified line
21152116
21162117 bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES);
21172118 bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES);
2118− if (ice_aq_get_recipe_to_profile(hw, i, (u8 *)r_bitmap, NULL))
2119+ if (ice_aq_get_recipe_to_profile(hw, i, &recp_assoc, NULL))
21192120 continue;
2121+ bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
21202122 bitmap_copy(profile_to_recipe[i], r_bitmap,
21212123 ICE_MAX_NUM_RECIPES);
21222124 for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES)
@@ -5390,22 +5392,24 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, · 3267 unmodified lines
53905392 */
53915393 list_for_each_entry(fvit, &rm->fv_list, list_entry) {
53925394 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
5395+ u64 recp_assoc;
53935396 u16 j;
53945397
53955398 status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id,
5396− (u8 *)r_bitmap, NULL);
5399+ &recp_assoc, NULL);
53975400 if (status)
53985401 goto err_unroll;
53995402
5403+ bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
54005404 bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap,
54015405 ICE_MAX_NUM_RECIPES);
54025406 status = ice_acquire_change_lock(hw, ICE_RES_WRITE);
54035407 if (status)
54045408 goto err_unroll;
54055409
5410+ bitmap_to_arr64(&recp_assoc, r_bitmap, ICE_MAX_NUM_RECIPES);
54065411 status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id,
5407− (u8 *)r_bitmap,
5408− NULL);
5412+ recp_assoc, NULL);
54095413 ice_release_change_lock(hw);
54105414
54115415 if (status)
drivers/net/ethernet/intel/ice/ice_switch.h+2−2
@@ -424,10 +424,10 @@ int ice_aq_add_recipe(struct ice_hw *hw, · 423 unmodified lines
424424 struct ice_aqc_recipe_data_elem *s_recipe_list,
425425 u16 num_recipes, struct ice_sq_cd *cd);
426426 int
427−ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
427+ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
428428 struct ice_sq_cd *cd);
429429 int
430−ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
430+ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
431431 struct ice_sq_cd *cd);
432432
433433 #endif /* _ICE_SWITCH_H_ */
drivers/net/ethernet/intel/igc/igc_main.c+0−4
@@ -1642,10 +1642,6 @@ done: · 1641 unmodified lines
16421642
16431643 if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
16441644 skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
1645− /* FIXME: add support for retrieving timestamps from
1646− * the other timer registers before skipping the
1647− * timestamping request.
1648− */
16491645 unsigned long flags;
16501646 u32 tstamp_flags;
16511647
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c+8−8
@@ -914,7 +914,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) · 913 unmodified lines
914914 goto err_out;
915915 }
916916
917− xs = kzalloc(sizeof(*xs), GFP_KERNEL);
917+ algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
918+ if (unlikely(!algo)) {
919+ err = -ENOENT;
920+ goto err_out;
921+ }
922+
923+ xs = kzalloc(sizeof(*xs), GFP_ATOMIC);
918924 if (unlikely(!xs)) {
919925 err = -ENOMEM;
920926 goto err_out;
@@ -930,14 +936,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) · 9 unmodified lines
930936 memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4));
931937 xs->xso.dev = adapter->netdev;
932938
933− algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
934− if (unlikely(!algo)) {
935− err = -ENOENT;
936− goto err_xs;
937− }
938−
939939 aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8;
940− xs->aead = kzalloc(aead_len, GFP_KERNEL);
940+ xs->aead = kzalloc(aead_len, GFP_ATOMIC);
941941 if (unlikely(!xs->aead)) {
942942 err = -ENOMEM;
943943 goto err_xs;
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+5−0
@@ -808,6 +808,11 @@ static int cgx_lmac_enadis_pause_frm(void *cgxd, int lmac_id, · 807 unmodified lines
808808 if (!is_lmac_valid(cgx, lmac_id))
809809 return -ENODEV;
810810
811+ cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL);
812+ cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK;
813+ cfg |= rx_pause ? CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK : 0x0;
814+ cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg);
815+
811816 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL);
812817 cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK;
813818 cfg |= rx_pause ? CGX_SMUX_RX_FRM_CTL_CTL_BCK : 0x0;
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c+14−7
@@ -139,13 +139,10 @@ static int mlxbf_gige_open(struct net_device *netdev) · 138 unmodified lines
139139 control |= MLXBF_GIGE_CONTROL_PORT_EN;
140140 writeq(control, priv->base + MLXBF_GIGE_CONTROL);
141141
142− err = mlxbf_gige_request_irqs(priv);
143− if (err)
144− return err;
145142 mlxbf_gige_cache_stats(priv);
146143 err = mlxbf_gige_clean_port(priv);
147144 if (err)
148− goto free_irqs;
145+ return err;
149146
150147 /* Clear driver's valid_polarity to match hardware,
151148 * since the above call to clean_port() resets the
@@ -157,7 +154,7 @@ static int mlxbf_gige_open(struct net_device *netdev) · 5 unmodified lines
157154
158155 err = mlxbf_gige_tx_init(priv);
159156 if (err)
160− goto free_irqs;
157+ goto phy_deinit;
161158 err = mlxbf_gige_rx_init(priv);
162159 if (err)
163160 goto tx_deinit;
@@ -166,6 +163,10 @@ static int mlxbf_gige_open(struct net_device *netdev) · 2 unmodified lines
166163 napi_enable(&priv->napi);
167164 netif_start_queue(netdev);
168165
166+ err = mlxbf_gige_request_irqs(priv);
167+ if (err)
168+ goto napi_deinit;
169+
169170 /* Set bits in INT_EN that we care about */
170171 int_en = MLXBF_GIGE_INT_EN_HW_ACCESS_ERROR |
171172 MLXBF_GIGE_INT_EN_TX_CHECKSUM_INPUTS |
@@ -182,11 +183,17 @@ static int mlxbf_gige_open(struct net_device *netdev) · 10 unmodified lines
182183
183184 return 0;
184185
186+napi_deinit:
187+ netif_stop_queue(netdev);
188+ napi_disable(&priv->napi);
189+ netif_napi_del(&priv->napi);
190+ mlxbf_gige_rx_deinit(priv);
191+
185192 tx_deinit:
186193 mlxbf_gige_tx_deinit(priv);
187194
188−free_irqs:
189− mlxbf_gige_free_irqs(priv);
195+phy_deinit:
196+ phy_stop(phydev);
190197 return err;
191198 }
192199
drivers/net/ethernet/microchip/lan743x_main.c+18−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #define PCS_POWER_STATE_DOWN 0x6
2626 #define PCS_POWER_STATE_UP 0x4
2727
28+#define RFE_RD_FIFO_TH_3_DWORDS 0x3
29+
2830 static void pci11x1x_strap_get_status(struct lan743x_adapter *adapter)
2931 {
3032 u32 chip_rev;
@@ -3272,6 +3274,21 @@ static void lan743x_full_cleanup(struct lan743x_adapter *adapter) · 3241 unmodified lines
32723274 lan743x_pci_cleanup(adapter);
32733275 }
32743276
3277+static void pci11x1x_set_rfe_rd_fifo_threshold(struct lan743x_adapter *adapter)
3278+{
3279+ u16 rev = adapter->csr.id_rev & ID_REV_CHIP_REV_MASK_;
3280+
3281+ if (rev == ID_REV_CHIP_REV_PCI11X1X_B0_) {
3282+ u32 misc_ctl;
3283+
3284+ misc_ctl = lan743x_csr_read(adapter, MISC_CTL_0);
3285+ misc_ctl &= ~MISC_CTL_0_RFE_READ_FIFO_MASK_;
3286+ misc_ctl |= FIELD_PREP(MISC_CTL_0_RFE_READ_FIFO_MASK_,
3287+ RFE_RD_FIFO_TH_3_DWORDS);
3288+ lan743x_csr_write(adapter, MISC_CTL_0, misc_ctl);
3289+ }
3290+}
3291+
32753292 static int lan743x_hardware_init(struct lan743x_adapter *adapter,
32763293 struct pci_dev *pdev)
32773294 {
@@ -3287,6 +3304,7 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter, · 9 unmodified lines
32873304 pci11x1x_strap_get_status(adapter);
32883305 spin_lock_init(&adapter->eth_syslock_spinlock);
32893306 mutex_init(&adapter->sgmii_rw_lock);
3307+ pci11x1x_set_rfe_rd_fifo_threshold(adapter);
32903308 } else {
32913309 adapter->max_tx_channels = LAN743X_MAX_TX_CHANNELS;
32923310 adapter->used_tx_channels = LAN743X_USED_TX_CHANNELS;
drivers/net/ethernet/microchip/lan743x_main.h+4−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #define ID_REV_CHIP_REV_MASK_ (0x0000FFFF)
2727 #define ID_REV_CHIP_REV_A0_ (0x00000000)
2828 #define ID_REV_CHIP_REV_B0_ (0x00000010)
29+#define ID_REV_CHIP_REV_PCI11X1X_B0_ (0x000000B0)
2930
3031 #define FPGA_REV (0x04)
3132 #define FPGA_REV_GET_MINOR_(fpga_rev) (((fpga_rev) >> 8) & 0x000000FF)
@@ -311,6 +312,9 @@ · 279 unmodified lines
311312 #define SGMII_CTL_LINK_STATUS_SOURCE_ BIT(8)
312313 #define SGMII_CTL_SGMII_POWER_DN_ BIT(1)
313314
315+#define MISC_CTL_0 (0x920)
316+#define MISC_CTL_0_RFE_READ_FIFO_MASK_ GENMASK(6, 4)
317+
314318 /* Vendor Specific SGMII MMD details */
315319 #define SR_VSMMD_PCS_ID1 0x0004
316320 #define SR_VSMMD_PCS_ID2 0x0005
drivers/net/ethernet/renesas/sh_eth.c+1−1
@@ -50,7 +50,7 @@ · 49 unmodified lines
5050 * the macros available to do this only define GCC 8.
5151 */
5252 __diag_push();
53−__diag_ignore(GCC, 8, "-Woverride-init",
53+__diag_ignore_all("-Woverride-init",
5454 "logic to initialize all and then override some is OK");
5555 static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
5656 SH_ETH_OFFSET_DEFAULTS,
drivers/net/ethernet/xilinx/ll_temac_main.c+1−1
@@ -1443,7 +1443,7 @@ static int temac_probe(struct platform_device *pdev) · 1442 unmodified lines
14431443 }
14441444
14451445 /* map device registers */
1446− lp->regs = devm_platform_ioremap_resource_byname(pdev, 0);
1446+ lp->regs = devm_platform_ioremap_resource(pdev, 0);
14471447 if (IS_ERR(lp->regs)) {
14481448 dev_err(&pdev->dev, "could not map TEMAC registers\n");
14491449 return -ENOMEM;
drivers/net/phy/qcom/at803x.c+3−1
@@ -797,7 +797,7 @@ static int at8031_parse_dt(struct phy_device *phydev) · 796 unmodified lines
797797
798798 static int at8031_probe(struct phy_device *phydev)
799799 {
800− struct at803x_priv *priv = phydev->priv;
800+ struct at803x_priv *priv;
801801 int mode_cfg;
802802 int ccr;
803803 int ret;
@@ -806,6 +806,8 @@ static int at8031_probe(struct phy_device *phydev) · 2 unmodified lines
806806 if (ret)
807807 return ret;
808808
809+ priv = phydev->priv;
810+
809811 /* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
810812 * options.
811813 */
drivers/net/wireless/intel/iwlwifi/fw/dbg.c+8−7
@@ -3081,8 +3081,6 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx) · 3080 unmodified lines
30813081 struct iwl_fw_dbg_params params = {0};
30823082 struct iwl_fwrt_dump_data *dump_data =
30833083 &fwrt->dump.wks[wk_idx].dump_data;
3084− u32 policy;
3085− u32 time_point;
30863084 if (!test_bit(wk_idx, &fwrt->dump.active_wks))
30873085 return;
30883086
@@ -3113,13 +3111,16 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx) · 24 unmodified lines
31133111
31143112 iwl_fw_dbg_stop_restart_recording(fwrt, &params, false);
31153113
3116− policy = le32_to_cpu(dump_data->trig->apply_policy);
3117− time_point = le32_to_cpu(dump_data->trig->time_point);
3114+ if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
3115+ u32 policy = le32_to_cpu(dump_data->trig->apply_policy);
3116+ u32 time_point = le32_to_cpu(dump_data->trig->time_point);
31183117
3119− if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
3120− IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
3121− iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
3118+ if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
3119+ IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
3120+ iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
3121+ }
31223122 }
3123+
31233124 if (fwrt->trans->dbg.last_tp_resetfw == IWL_FW_INI_RESET_FW_MODE_STOP_FW_ONLY)
31243125 iwl_force_nmi(fwrt->trans);
31253126
drivers/net/wireless/intel/iwlwifi/mvm/d3.c+9−7
@@ -1260,15 +1260,15 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, · 1259 unmodified lines
12601260 if (IS_ERR_OR_NULL(vif))
12611261 return 1;
12621262
1263− if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc) {
1263+ if (hweight16(vif->active_links) > 1) {
12641264 /*
1265− * Select the 'best' link. May need to revisit, it seems
1266− * better to not optimize for throughput but rather range,
1267− * reliability and power here - and select 2.4 GHz ...
1265+ * Select the 'best' link.
1266+ * May need to revisit, it seems better to not optimize
1267+ * for throughput but rather range, reliability and
1268+ * power here - and select 2.4 GHz ...
12681269 */
1269− primary_link =
1270− iwl_mvm_mld_get_primary_link(mvm, vif,
1271− vif->active_links);
1270+ primary_link = iwl_mvm_mld_get_primary_link(mvm, vif,
1271+ vif->active_links);
12721272
12731273 if (WARN_ONCE(primary_link < 0, "no primary link in 0x%x\n",
12741274 vif->active_links))
@@ -1277,6 +1277,8 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, · 2 unmodified lines
12771277 ret = ieee80211_set_active_links(vif, BIT(primary_link));
12781278 if (ret)
12791279 return ret;
1280+ } else if (vif->active_links) {
1281+ primary_link = __ffs(vif->active_links);
12801282 } else {
12811283 primary_link = 0;
12821284 }
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c+7−4
@@ -748,7 +748,9 @@ void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 747 unmodified lines
748748 {
749749 struct dentry *dbgfs_dir = vif->debugfs_dir;
750750 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
751− char buf[100];
751+ char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) +
752+ (7 + IFNAMSIZ + 1) + 6 + 1];
753+ char name[7 + IFNAMSIZ + 1];
752754
753755 /* this will happen in monitor mode */
754756 if (!dbgfs_dir)
@@ -761,10 +763,11 @@ void iwl_mvm_vif_dbgfs_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 6 unmodified lines
761763 * find
762764 * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/
763765 */
764− snprintf(buf, 100, "../../../%pd3/iwlmvm", dbgfs_dir);
766+ snprintf(name, sizeof(name), "%pd", dbgfs_dir);
767+ snprintf(buf, sizeof(buf), "../../../%pd3/iwlmvm", dbgfs_dir);
765768
766− mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name,
767− mvm->debugfs_dir, buf);
769+ mvmvif->dbgfs_slink =
770+ debugfs_create_symlink(name, mvm->debugfs_dir, buf);
768771 }
769772
770773 void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
drivers/net/wireless/intel/iwlwifi/mvm/link.c+45−14
@@ -46,6 +46,27 @@ static int iwl_mvm_link_cmd_send(struct iwl_mvm *mvm, · 45 unmodified lines
4646 return ret;
4747 }
4848
49+int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
50+ struct ieee80211_bss_conf *link_conf)
51+{
52+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
53+ struct iwl_mvm_vif_link_info *link_info =
54+ mvmvif->link[link_conf->link_id];
55+
56+ if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) {
57+ link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm,
58+ mvmvif);
59+ if (link_info->fw_link_id >=
60+ ARRAY_SIZE(mvm->link_id_to_link_conf))
61+ return -EINVAL;
62+
63+ rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id],
64+ link_conf);
65+ }
66+
67+ return 0;
68+}
69+
4970 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5071 struct ieee80211_bss_conf *link_conf)
5172 {
@@ -55,19 +76,14 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, · 3 unmodified lines
5576 struct iwl_link_config_cmd cmd = {};
5677 unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD);
5778 u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1);
79+ int ret;
5880
5981 if (WARN_ON_ONCE(!link_info))
6082 return -EINVAL;
6183
62− if (link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) {
63− link_info->fw_link_id = iwl_mvm_get_free_fw_link_id(mvm,
64− mvmvif);
65− if (link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf))
66− return -EINVAL;
67−
68− rcu_assign_pointer(mvm->link_id_to_link_conf[link_info->fw_link_id],
69− link_conf);
70− }
84+ ret = iwl_mvm_set_link_mapping(mvm, vif, link_conf);
85+ if (ret)
86+ return ret;
7187
7288 /* Update SF - Disable if needed. if this fails, SF might still be on
7389 * while many macs are bound, which is forbidden - so fail the binding.
@@ -248,6 +264,24 @@ send_cmd: · 174 unmodified lines
248264 return ret;
249265 }
250266
267+int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
268+ struct ieee80211_bss_conf *link_conf)
269+{
270+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
271+ struct iwl_mvm_vif_link_info *link_info =
272+ mvmvif->link[link_conf->link_id];
273+
274+ /* mac80211 thought we have the link, but it was never configured */
275+ if (WARN_ON(!link_info ||
276+ link_info->fw_link_id >=
277+ ARRAY_SIZE(mvm->link_id_to_link_conf)))
278+ return -EINVAL;
279+
280+ RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
281+ NULL);
282+ return 0;
283+}
284+
251285 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
252286 struct ieee80211_bss_conf *link_conf)
253287 {
@@ -257,13 +291,10 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, · 3 unmodified lines
257291 struct iwl_link_config_cmd cmd = {};
258292 int ret;
259293
260− /* mac80211 thought we have the link, but it was never configured */
261− if (WARN_ON(!link_info ||
262− link_info->fw_link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf)))
294+ ret = iwl_mvm_unset_link_mapping(mvm, vif, link_conf);
295+ if (ret)
263296 return 0;
264297
265− RCU_INIT_POINTER(mvm->link_id_to_link_conf[link_info->fw_link_id],
266− NULL);
267298 cmd.link_id = cpu_to_le32(link_info->fw_link_id);
268299 iwl_mvm_release_fw_link_id(mvm, link_info->fw_link_id);
269300 link_info->fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+8−1
@@ -360,7 +360,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) · 359 unmodified lines
360360 if (mvm->mld_api_is_used && mvm->nvm_data->sku_cap_11be_enable &&
361361 !iwlwifi_mod_params.disable_11ax &&
362362 !iwlwifi_mod_params.disable_11be)
363− hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
363+ hw->wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT;
364364
365365 /* With MLD FW API, it tracks timing by itself,
366366 * no need for any timing from the host
@@ -1577,8 +1577,14 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, · 1210 unmodified lines
15771577 mvmvif->mvm = mvm;
15781578
15791579 /* the first link always points to the default one */
1580+ mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID;
1581+ mvmvif->deflink.active = 0;
15801582 mvmvif->link[0] = &mvmvif->deflink;
15811583
1584+ ret = iwl_mvm_set_link_mapping(mvm, vif, &vif->bss_conf);
1585+ if (ret)
1586+ goto out;
1587+
15821588 /*
15831589 * Not much to do here. The stack will not allow interface
15841590 * types or combinations that we didn't advertise, so we
@@ -1783,6 +1789,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, · 198 unmodified lines
17831789 mvm->p2p_device_vif = NULL;
17841790 }
17851791
1792+ iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf);
17861793 iwl_mvm_mac_ctxt_remove(mvm, vif);
17871794
17881795 RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL);
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c+6−1
@@ -855,10 +855,15 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, · 854 unmodified lines
855855
856856 int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, u8 sta_id)
857857 {
858− int ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
858+ int ret;
859859
860860 lockdep_assert_held(&mvm->mutex);
861861
862+ if (WARN_ON(sta_id == IWL_MVM_INVALID_STA))
863+ return 0;
864+
865+ ret = iwl_mvm_mld_rm_sta_from_fw(mvm, sta_id);
866+
862867 RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL);
863868 RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL);
864869 return ret;
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+4−0
@@ -1916,11 +1916,15 @@ int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif); · 1915 unmodified lines
19161916 u32 iwl_mvm_get_lmac_id(struct iwl_mvm *mvm, enum nl80211_band band);
19171917
19181918 /* Links */
1919+int iwl_mvm_set_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1920+ struct ieee80211_bss_conf *link_conf);
19191921 int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19201922 struct ieee80211_bss_conf *link_conf);
19211923 int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19221924 struct ieee80211_bss_conf *link_conf,
19231925 u32 changes, bool active);
1926+int iwl_mvm_unset_link_mapping(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1927+ struct ieee80211_bss_conf *link_conf);
19241928 int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
19251929 struct ieee80211_bss_conf *link_conf);
19261930 int iwl_mvm_disable_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c+6−2
@@ -132,14 +132,18 @@ struct iwl_rfi_freq_table_resp_cmd *iwl_rfi_get_freq_table(struct iwl_mvm *mvm) · 131 unmodified lines
132132 if (ret)
133133 return ERR_PTR(ret);
134134
135− if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) != resp_size))
135+ if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) !=
136+ resp_size)) {
137+ iwl_free_resp(&cmd);
136138 return ERR_PTR(-EIO);
139+ }
137140
138141 resp = kmemdup(cmd.resp_pkt->data, resp_size, GFP_KERNEL);
142+ iwl_free_resp(&cmd);
143+
139144 if (!resp)
140145 return ERR_PTR(-ENOMEM);
141146
142− iwl_free_resp(&cmd);
143147 return resp;
144148 }
145149
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c+8−12
@@ -236,21 +236,13 @@ static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, · 235 unmodified lines
236236 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
237237 struct napi_struct *napi,
238238 struct sk_buff *skb, int queue,
239− struct ieee80211_sta *sta,
240− struct ieee80211_link_sta *link_sta)
239+ struct ieee80211_sta *sta)
241240 {
242241 if (unlikely(iwl_mvm_check_pn(mvm, skb, queue, sta))) {
243242 kfree_skb(skb);
244243 return;
245244 }
246245
247− if (sta && sta->valid_links && link_sta) {
248− struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
249−
250− rx_status->link_valid = 1;
251− rx_status->link_id = link_sta->link_id;
252− }
253−
254246 ieee80211_rx_napi(mvm->hw, sta, skb, napi);
255247 }
256248
@@ -588,7 +580,7 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, · 331 unmodified lines
588580 while ((skb = __skb_dequeue(skb_list))) {
589581 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb,
590582 reorder_buf->queue,
591− sta, NULL /* FIXME */);
583+ sta);
592584 reorder_buf->num_stored--;
593585 }
594586 }
@@ -2213,6 +2205,11 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, · 1618 unmodified lines
22132205 if (IS_ERR(sta))
22142206 sta = NULL;
22152207 link_sta = rcu_dereference(mvm->fw_id_to_link_sta[id]);
2208+
2209+ if (sta && sta->valid_links && link_sta) {
2210+ rx_status->link_valid = 1;
2211+ rx_status->link_id = link_sta->link_id;
2212+ }
22162213 }
22172214 } else if (!is_multicast_ether_addr(hdr->addr2)) {
22182215 /*
@@ -2356,8 +2353,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, · 137 unmodified lines
23562353 !(desc->amsdu_info & IWL_RX_MPDU_AMSDU_LAST_SUBFRAME))
23572354 rx_status->flag |= RX_FLAG_AMSDU_MORE;
23582355
2359− iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta,
2360− link_sta);
2356+ iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta);
23612357 }
23622358 out:
23632359 rcu_read_unlock();
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c+2−3
@@ -879,9 +879,8 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm, · 878 unmodified lines
879879 struct iwl_rx_packet *pkt = rxb_addr(rxb);
880880 struct iwl_mvm_session_prot_notif *notif = (void *)pkt->data;
881881 unsigned int ver =
882− iwl_fw_lookup_cmd_ver(mvm->fw,
883− WIDE_ID(MAC_CONF_GROUP,
884− SESSION_PROTECTION_CMD), 2);
882+ iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP,
883+ SESSION_PROTECTION_NOTIF, 2);
885884 int id = le32_to_cpu(notif->mac_link_id);
886885 struct ieee80211_vif *vif;
887886 struct iwl_mvm_vif *mvmvif;
drivers/net/wireless/intel/iwlwifi/queue/tx.c+1−1
@@ -1589,9 +1589,9 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn, · 1588 unmodified lines
15891589 return;
15901590
15911591 tfd_num = iwl_txq_get_cmd_index(txq, ssn);
1592− read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
15931592
15941593 spin_lock_bh(&txq->lock);
1594+ read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr);
15951595
15961596 if (!test_bit(txq_id, trans->txqs.queue_used)) {
15971597 IWL_DEBUG_TX_QUEUES(trans, "Q %d inactive - ignoring idx %d\n",
drivers/net/wireless/realtek/rtw89/rtw8922a.c+1−1
@@ -2233,7 +2233,7 @@ static void rtw8922a_btc_init_cfg(struct rtw89_dev *rtwdev) · 2232 unmodified lines
22332233 * Shared-Ant && BTG-path:WL mask(0x55f), others:WL THRU(0x5ff)
22342234 */
22352235 if (btc->ant_type == BTC_ANT_SHARED && btc->btg_pos == path)
2236− rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x5ff);
2236+ rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x55f);
22372237 else
22382238 rtw8922a_set_trx_mask(rtwdev, path, BTC_BT_TX_GROUP, 0x5ff);
22392239
drivers/net/wwan/t7xx/t7xx_cldma.c+2−2
@@ -106,7 +106,7 @@ bool t7xx_cldma_tx_addr_is_set(struct t7xx_cldma_hw *hw_info, unsigned int qno) · 105 unmodified lines
106106 {
107107 u32 offset = REG_CLDMA_UL_START_ADDRL_0 + qno * ADDR_SIZE;
108108
109− return ioread64(hw_info->ap_pdn_base + offset);
109+ return ioread64_lo_hi(hw_info->ap_pdn_base + offset);
110110 }
111111
112112 void t7xx_cldma_hw_set_start_addr(struct t7xx_cldma_hw *hw_info, unsigned int qno, u64 address,
@@ -117,7 +117,7 @@ void t7xx_cldma_hw_set_start_addr(struct t7xx_cldma_hw *hw_info, unsigned int qn · 4 unmodified lines
117117
118118 reg = tx_rx == MTK_RX ? hw_info->ap_ao_base + REG_CLDMA_DL_START_ADDRL_0 :
119119 hw_info->ap_pdn_base + REG_CLDMA_UL_START_ADDRL_0;
120− iowrite64(address, reg + offset);
120+ iowrite64_lo_hi(address, reg + offset);
121121 }
122122
123123 void t7xx_cldma_hw_resume_queue(struct t7xx_cldma_hw *hw_info, unsigned int qno,
drivers/net/wwan/t7xx/t7xx_hif_cldma.c+5−4
@@ -137,8 +137,9 @@ static int t7xx_cldma_gpd_rx_from_q(struct cldma_queue *queue, int budget, bool · 136 unmodified lines
137137 return -ENODEV;
138138 }
139139
140− gpd_addr = ioread64(hw_info->ap_pdn_base + REG_CLDMA_DL_CURRENT_ADDRL_0 +
141− queue->index * sizeof(u64));
140+ gpd_addr = ioread64_lo_hi(hw_info->ap_pdn_base +
141+ REG_CLDMA_DL_CURRENT_ADDRL_0 +
142+ queue->index * sizeof(u64));
142143 if (req->gpd_addr == gpd_addr || hwo_polling_count++ >= 100)
143144 return 0;
144145
@@ -316,8 +317,8 @@ static void t7xx_cldma_txq_empty_hndl(struct cldma_queue *queue) · 171 unmodified lines
316317 struct t7xx_cldma_hw *hw_info = &md_ctrl->hw_info;
317318
318319 /* Check current processing TGPD, 64-bit address is in a table by Q index */
319− ul_curr_addr = ioread64(hw_info->ap_pdn_base + REG_CLDMA_UL_CURRENT_ADDRL_0 +
320− queue->index * sizeof(u64));
320+ ul_curr_addr = ioread64_lo_hi(hw_info->ap_pdn_base + REG_CLDMA_UL_CURRENT_ADDRL_0 +
321+ queue->index * sizeof(u64));
321322 if (req->gpd_addr != ul_curr_addr) {
322323 spin_unlock_irqrestore(&md_ctrl->cldma_lock, flags);
323324 dev_err(md_ctrl->dev, "CLDMA%d queue %d is not empty\n",
drivers/net/wwan/t7xx/t7xx_pcie_mac.c+4−4
@@ -75,7 +75,7 @@ static void t7xx_pcie_mac_atr_tables_dis(void __iomem *pbase, enum t7xx_atr_src_ · 74 unmodified lines
7575 for (i = 0; i < ATR_TABLE_NUM_PER_ATR; i++) {
7676 offset = ATR_PORT_OFFSET * port + ATR_TABLE_OFFSET * i;
7777 reg = pbase + ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset;
78− iowrite64(0, reg);
78+ iowrite64_lo_hi(0, reg);
7979 }
8080 }
8181
@@ -112,17 +112,17 @@ static int t7xx_pcie_mac_atr_cfg(struct t7xx_pci_dev *t7xx_dev, struct t7xx_atr_ · 30 unmodified lines
112112
113113 reg = pbase + ATR_PCIE_WIN0_T0_TRSL_ADDR + offset;
114114 value = cfg->trsl_addr & ATR_PCIE_WIN0_ADDR_ALGMT;
115− iowrite64(value, reg);
115+ iowrite64_lo_hi(value, reg);
116116
117117 reg = pbase + ATR_PCIE_WIN0_T0_TRSL_PARAM + offset;
118118 iowrite32(cfg->trsl_id, reg);
119119
120120 reg = pbase + ATR_PCIE_WIN0_T0_ATR_PARAM_SRC_ADDR + offset;
121121 value = (cfg->src_addr & ATR_PCIE_WIN0_ADDR_ALGMT) | (atr_size << 1) | BIT(0);
122− iowrite64(value, reg);
122+ iowrite64_lo_hi(value, reg);
123123
124124 /* Ensure ATR is set */
125− ioread64(reg);
125+ ioread64_lo_hi(reg);
126126 return 0;
127127 }
128128
drivers/pinctrl/aspeed/Makefile+1−1
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 # Aspeed pinctrl support
33
4−ccflags-y += $(call cc-option,-Woverride-init)
4+ccflags-y += -Woverride-init
55 obj-$(CONFIG_PINCTRL_ASPEED) += pinctrl-aspeed.o pinmux-aspeed.o
66 obj-$(CONFIG_PINCTRL_ASPEED_G4) += pinctrl-aspeed-g4.o
77 obj-$(CONFIG_PINCTRL_ASPEED_G5) += pinctrl-aspeed-g5.o
drivers/pinctrl/pinctrl-amd.c+1−1
@@ -1159,7 +1159,7 @@ static int amd_gpio_probe(struct platform_device *pdev) · 1158 unmodified lines
11591159 }
11601160
11611161 ret = devm_request_irq(&pdev->dev, gpio_dev->irq, amd_gpio_irq_handler,
1162− IRQF_SHARED | IRQF_ONESHOT, KBUILD_MODNAME, gpio_dev);
1162+ IRQF_SHARED | IRQF_COND_ONESHOT, KBUILD_MODNAME, gpio_dev);
11631163 if (ret)
11641164 goto out2;
11651165
drivers/pwm/pwm-img.c+2−2
@@ -284,9 +284,9 @@ static int img_pwm_probe(struct platform_device *pdev) · 283 unmodified lines
284284 return PTR_ERR(imgchip->sys_clk);
285285 }
286286
287− imgchip->pwm_clk = devm_clk_get(&pdev->dev, "imgchip");
287+ imgchip->pwm_clk = devm_clk_get(&pdev->dev, "pwm");
288288 if (IS_ERR(imgchip->pwm_clk)) {
289− dev_err(&pdev->dev, "failed to get imgchip clock\n");
289+ dev_err(&pdev->dev, "failed to get pwm clock\n");
290290 return PTR_ERR(imgchip->pwm_clk);
291291 }
292292
drivers/ras/amd/fmpm.c+39−18
@@ -150,6 +150,8 @@ static unsigned int max_nr_fru; · 149 unmodified lines
150150 /* Total length of record including headers and list of descriptor entries. */
151151 static size_t max_rec_len;
152152
153+#define FMPM_MAX_REC_LEN (sizeof(struct fru_rec) + (sizeof(struct cper_fru_poison_desc) * 255))
154+
153155 /* Total number of SPA entries across all FRUs. */
154156 static unsigned int spa_nr_entries;
155157
@@ -475,6 +477,16 @@ static void set_rec_fields(struct fru_rec *rec) · 319 unmodified lines
475477 struct cper_section_descriptor *sec_desc = &rec->sec_desc;
476478 struct cper_record_header *hdr = &rec->hdr;
477479
480+ /*
481+ * This is a saved record created with fewer max_nr_entries.
482+ * Update the record lengths and keep everything else as-is.
483+ */
484+ if (hdr->record_length && hdr->record_length < max_rec_len) {
485+ pr_debug("Growing record 0x%016llx from %u to %zu bytes\n",
486+ hdr->record_id, hdr->record_length, max_rec_len);
487+ goto update_lengths;
488+ }
489+
478490 memcpy(hdr->signature, CPER_SIG_RECORD, CPER_SIG_SIZE);
479491 hdr->revision = CPER_RECORD_REV;
480492 hdr->signature_end = CPER_SIG_END;
@@ -489,19 +501,21 @@ static void set_rec_fields(struct fru_rec *rec) · 8 unmodified lines
489501 hdr->error_severity = CPER_SEV_RECOVERABLE;
490502
491503 hdr->validation_bits = 0;
492− hdr->record_length = max_rec_len;
493504 hdr->creator_id = CPER_CREATOR_FMP;
494505 hdr->notification_type = CPER_NOTIFY_MCE;
495506 hdr->record_id = cper_next_record_id();
496507 hdr->flags = CPER_HW_ERROR_FLAGS_PREVERR;
497508
498509 sec_desc->section_offset = sizeof(struct cper_record_header);
499− sec_desc->section_length = max_rec_len - sizeof(struct cper_record_header);
500510 sec_desc->revision = CPER_SEC_REV;
501511 sec_desc->validation_bits = 0;
502512 sec_desc->flags = CPER_SEC_PRIMARY;
503513 sec_desc->section_type = CPER_SECTION_TYPE_FMP;
504514 sec_desc->section_severity = CPER_SEV_RECOVERABLE;
515+
516+update_lengths:
517+ hdr->record_length = max_rec_len;
518+ sec_desc->section_length = max_rec_len - sizeof(struct cper_record_header);
505519 }
506520
507521 static int save_new_records(void)
@@ -512,16 +526,18 @@ static int save_new_records(void) · 4 unmodified lines
512526 int ret = 0;
513527
514528 for_each_fru(i, rec) {
515− if (rec->hdr.record_length)
529+ /* No need to update saved records that match the current record size. */
530+ if (rec->hdr.record_length == max_rec_len)
516531 continue;
517532
533+ if (!rec->hdr.record_length)
534+ set_bit(i, new_records);
535+
518536 set_rec_fields(rec);
519537
520538 ret = update_record_on_storage(rec);
521539 if (ret)
522540 goto out_clear;
523−
524− set_bit(i, new_records);
525541 }
526542
527543 return ret;
@@ -641,12 +657,7 @@ static int get_saved_records(void) · 113 unmodified lines
641657 int ret, pos;
642658 ssize_t len;
643659
644− /*
645− * Assume saved records match current max size.
646− *
647− * However, this may not be true depending on module parameters.
648− */
649− old = kmalloc(max_rec_len, GFP_KERNEL);
660+ old = kmalloc(FMPM_MAX_REC_LEN, GFP_KERNEL);
650661 if (!old) {
651662 ret = -ENOMEM;
652663 goto out;
@@ -663,21 +674,31 @@ static int get_saved_records(void) · 10 unmodified lines
663674 * Make sure to clear temporary buffer between reads to avoid
664675 * leftover data from records of various sizes.
665676 */
666− memset(old, 0, max_rec_len);
677+ memset(old, 0, FMPM_MAX_REC_LEN);
667678
668− len = erst_read_record(record_id, &old->hdr, max_rec_len,
679+ len = erst_read_record(record_id, &old->hdr, FMPM_MAX_REC_LEN,
669680 sizeof(struct fru_rec), &CPER_CREATOR_FMP);
670681 if (len < 0)
671682 continue;
672683
673− if (len > max_rec_len) {
674− pr_debug("Found record larger than max_rec_len\n");
684+ new = get_valid_record(old);
685+ if (!new) {
686+ erst_clear(record_id);
675687 continue;
676688 }
677689
678− new = get_valid_record(old);
679− if (!new)
680− erst_clear(record_id);
690+ if (len > max_rec_len) {
691+ unsigned int saved_nr_entries;
692+
693+ saved_nr_entries = len - sizeof(struct fru_rec);
694+ saved_nr_entries /= sizeof(struct cper_fru_poison_desc);
695+
696+ pr_warn("Saved record found with %u entries.\n", saved_nr_entries);
697+ pr_warn("Please increase max_nr_entries to %u.\n", saved_nr_entries);
698+
699+ ret = -EINVAL;
700+ goto out_end;
701+ }
681702
682703 /* Restore the record */
683704 memcpy(new, old, len);
drivers/ras/debugfs.h+4−0
@@ -4,6 +4,10 @@ · 3 unmodified lines
44
55 #include <linux/debugfs.h>
66
7+#if IS_ENABLED(CONFIG_DEBUG_FS)
78 struct dentry *ras_get_debugfs_root(void);
9+#else
10+static inline struct dentry *ras_get_debugfs_root(void) { return NULL; }
11+#endif /* DEBUG_FS */
812
913 #endif /* __RAS_DEBUGFS_H__ */
drivers/s390/net/qeth_core_main.c+36−2
@@ -1179,6 +1179,20 @@ static int qeth_check_irb_error(struct qeth_card *card, struct ccw_device *cdev, · 1178 unmodified lines
11791179 }
11801180 }
11811181
1182+/**
1183+ * qeth_irq() - qeth interrupt handler
1184+ * @cdev: ccw device
1185+ * @intparm: expect pointer to iob
1186+ * @irb: Interruption Response Block
1187+ *
1188+ * In the good path:
1189+ * corresponding qeth channel is locked with last used iob as active_cmd.
1190+ * But this function is also called for error interrupts.
1191+ *
1192+ * Caller ensures that:
1193+ * Interrupts are disabled; ccw device lock is held;
1194+ *
1195+ */
11821196 static void qeth_irq(struct ccw_device *cdev, unsigned long intparm,
11831197 struct irb *irb)
11841198 {
@@ -1220,11 +1234,10 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 35 unmodified lines
12201234 iob = (struct qeth_cmd_buffer *) (addr_t)intparm;
12211235 }
12221236
1223− qeth_unlock_channel(card, channel);
1224−
12251237 rc = qeth_check_irb_error(card, cdev, irb);
12261238 if (rc) {
12271239 /* IO was terminated, free its resources. */
1240+ qeth_unlock_channel(card, channel);
12281241 if (iob)
12291242 qeth_cancel_cmd(iob, rc);
12301243 return;
@@ -1268,6 +1281,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 37 unmodified lines
12681281 rc = qeth_get_problem(card, cdev, irb);
12691282 if (rc) {
12701283 card->read_or_write_problem = 1;
1284+ qeth_unlock_channel(card, channel);
12711285 if (iob)
12721286 qeth_cancel_cmd(iob, rc);
12731287 qeth_clear_ipacmd_list(card);
@@ -1276,6 +1290,26 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 2 unmodified lines
12761290 }
12771291 }
12781292
1293+ if (scsw_cmd_is_valid_cc(&irb->scsw) && irb->scsw.cmd.cc == 1 && iob) {
1294+ /* channel command hasn't started: retry.
1295+ * active_cmd is still set to last iob
1296+ */
1297+ QETH_CARD_TEXT(card, 2, "irqcc1");
1298+ rc = ccw_device_start_timeout(cdev, __ccw_from_cmd(iob),
1299+ (addr_t)iob, 0, 0, iob->timeout);
1300+ if (rc) {
1301+ QETH_DBF_MESSAGE(2,
1302+ "ccw retry on %x failed, rc = %i\n",
1303+ CARD_DEVID(card), rc);
1304+ QETH_CARD_TEXT_(card, 2, " err%d", rc);
1305+ qeth_unlock_channel(card, channel);
1306+ qeth_cancel_cmd(iob, rc);
1307+ }
1308+ return;
1309+ }
1310+
1311+ qeth_unlock_channel(card, channel);
1312+
12791313 if (iob) {
12801314 /* sanity check: */
12811315 if (irb->scsw.cmd.count > iob->length) {
drivers/scsi/bnx2fc/bnx2fc_tgt.c+0−2
@@ -833,7 +833,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, · 832 unmodified lines
833833
834834 BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");
835835
836− spin_lock_bh(&tgt->cq_lock);
837836 ctx_base_ptr = tgt->ctx_base;
838837 tgt->ctx_base = NULL;
839838
@@ -889,7 +888,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, · 49 unmodified lines
889888 tgt->sq, tgt->sq_dma);
890889 tgt->sq = NULL;
891890 }
892− spin_unlock_bh(&tgt->cq_lock);
893891
894892 if (ctx_base_ptr)
895893 iounmap(ctx_base_ptr);
drivers/scsi/ch.c+10−10
@@ -102,7 +102,9 @@ do { \ · 101 unmodified lines
102102
103103 #define MAX_RETRIES 1
104104
105−static struct class * ch_sysfs_class;
105+static const struct class ch_sysfs_class = {
106+ .name = "scsi_changer",
107+};
106108
107109 typedef struct {
108110 struct kref ref;
@@ -930,7 +932,7 @@ static int ch_probe(struct device *dev) · 821 unmodified lines
930932 mutex_init(&ch->lock);
931933 kref_init(&ch->ref);
932934 ch->device = sd;
933− class_dev = device_create(ch_sysfs_class, dev,
935+ class_dev = device_create(&ch_sysfs_class, dev,
934936 MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
935937 "s%s", ch->name);
936938 if (IS_ERR(class_dev)) {
@@ -955,7 +957,7 @@ static int ch_probe(struct device *dev) · 18 unmodified lines
955957
956958 return 0;
957959 destroy_dev:
958− device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
960+ device_destroy(&ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
959961 put_device:
960962 scsi_device_put(sd);
961963 remove_idr:
@@ -974,7 +976,7 @@ static int ch_remove(struct device *dev) · 12 unmodified lines
974976 dev_set_drvdata(dev, NULL);
975977 spin_unlock(&ch_index_lock);
976978
977− device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
979+ device_destroy(&ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor));
978980 scsi_device_put(ch->device);
979981 kref_put(&ch->ref, ch_destroy);
980982 return 0;
@@ -1003,11 +1005,9 @@ static int __init init_ch_module(void) · 22 unmodified lines
10031005 int rc;
10041006
10051007 printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n");
1006− ch_sysfs_class = class_create("scsi_changer");
1007− if (IS_ERR(ch_sysfs_class)) {
1008− rc = PTR_ERR(ch_sysfs_class);
1008+ rc = class_register(&ch_sysfs_class);
1009+ if (rc)
10091010 return rc;
1010− }
10111011 rc = register_chrdev(SCSI_CHANGER_MAJOR,"ch",&changer_fops);
10121012 if (rc < 0) {
10131013 printk("Unable to get major %d for SCSI-Changer\n",
@@ -1022,7 +1022,7 @@ static int __init init_ch_module(void) · 8 unmodified lines
10221022 fail2:
10231023 unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
10241024 fail1:
1025− class_destroy(ch_sysfs_class);
1025+ class_unregister(&ch_sysfs_class);
10261026 return rc;
10271027 }
10281028
@@ -1030,7 +1030,7 @@ static void __exit exit_ch_module(void) · 1 unmodified line
10301030 {
10311031 scsi_unregister_driver(&ch_template.gendrv);
10321032 unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
1033− class_destroy(ch_sysfs_class);
1033+ class_unregister(&ch_sysfs_class);
10341034 idr_destroy(&ch_index_idr);
10351035 }
10361036
drivers/scsi/cxlflash/main.c+10−7
@@ -28,7 +28,12 @@ MODULE_AUTHOR("Manoj N. Kumar <manoj@linux.vnet.ibm.com>"); · 27 unmodified lines
2828 MODULE_AUTHOR("Matthew R. Ochs <mrochs@linux.vnet.ibm.com>");
2929 MODULE_LICENSE("GPL");
3030
31−static struct class *cxlflash_class;
31+static char *cxlflash_devnode(const struct device *dev, umode_t *mode);
32+static const struct class cxlflash_class = {
33+ .name = "cxlflash",
34+ .devnode = cxlflash_devnode,
35+};
36+
3237 static u32 cxlflash_major;
3338 static DECLARE_BITMAP(cxlflash_minor, CXLFLASH_MAX_ADAPTERS);
3439
@@ -3602,7 +3607,7 @@ static int init_chrdev(struct cxlflash_cfg *cfg) · 3567 unmodified lines
36023607 goto err1;
36033608 }
36043609
3605− char_dev = device_create(cxlflash_class, NULL, devno,
3610+ char_dev = device_create(&cxlflash_class, NULL, devno,
36063611 NULL, "cxlflash%d", minor);
36073612 if (IS_ERR(char_dev)) {
36083613 rc = PTR_ERR(char_dev);
@@ -3880,14 +3885,12 @@ static int cxlflash_class_init(void) · 271 unmodified lines
38803885
38813886 cxlflash_major = MAJOR(devno);
38823887
3883− cxlflash_class = class_create("cxlflash");
3884− if (IS_ERR(cxlflash_class)) {
3885− rc = PTR_ERR(cxlflash_class);
3888+ rc = class_register(&cxlflash_class);
3889+ if (rc) {
38863890 pr_err("%s: class_create failed rc=%d\n", __func__, rc);
38873891 goto err;
38883892 }
38893893
3890− cxlflash_class->devnode = cxlflash_devnode;
38913894 out:
38923895 pr_debug("%s: returning rc=%d\n", __func__, rc);
38933896 return rc;
@@ -3903,7 +3906,7 @@ static void cxlflash_class_exit(void) · 9 unmodified lines
39033906 {
39043907 dev_t devno = MKDEV(cxlflash_major, 0);
39053908
3906− class_destroy(cxlflash_class);
3909+ class_unregister(&cxlflash_class);
39073910 unregister_chrdev_region(devno, CXLFLASH_MAX_ADAPTERS);
39083911 }
39093912
drivers/scsi/hosts.c+4−3
@@ -353,12 +353,13 @@ static void scsi_host_dev_release(struct device *dev) · 352 unmodified lines
353353
354354 if (shost->shost_state == SHOST_CREATED) {
355355 /*
356− * Free the shost_dev device name here if scsi_host_alloc()
357− * and scsi_host_put() have been called but neither
356+ * Free the shost_dev device name and remove the proc host dir
357+ * here if scsi_host_{alloc,put}() have been called but neither
358358 * scsi_host_add() nor scsi_remove_host() has been called.
359359 * This avoids that the memory allocated for the shost_dev
360− * name is leaked.
360+ * name as well as the proc dir structure are leaked.
361361 */
362+ scsi_proc_hostdir_rm(shost->hostt);
362363 kfree(dev_name(&shost->shost_dev));
363364 }
364365
drivers/scsi/libsas/sas_expander.c+34−17
@@ -1621,6 +1621,16 @@ out_err: · 1620 unmodified lines
16211621
16221622 /* ---------- Domain revalidation ---------- */
16231623
1624+static void sas_get_sas_addr_and_dev_type(struct smp_disc_resp *disc_resp,
1625+ u8 *sas_addr,
1626+ enum sas_device_type *type)
1627+{
1628+ memcpy(sas_addr, disc_resp->disc.attached_sas_addr, SAS_ADDR_SIZE);
1629+ *type = to_dev_type(&disc_resp->disc);
1630+ if (*type == SAS_PHY_UNUSED)
1631+ memset(sas_addr, 0, SAS_ADDR_SIZE);
1632+}
1633+
16241634 static int sas_get_phy_discover(struct domain_device *dev,
16251635 int phy_id, struct smp_disc_resp *disc_resp)
16261636 {
@@ -1674,13 +1684,8 @@ int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, · 47 unmodified lines
16741684 return -ENOMEM;
16751685
16761686 res = sas_get_phy_discover(dev, phy_id, disc_resp);
1677− if (res == 0) {
1678− memcpy(sas_addr, disc_resp->disc.attached_sas_addr,
1679− SAS_ADDR_SIZE);
1680− *type = to_dev_type(&disc_resp->disc);
1681− if (*type == 0)
1682− memset(sas_addr, 0, SAS_ADDR_SIZE);
1683− }
1687+ if (res == 0)
1688+ sas_get_sas_addr_and_dev_type(disc_resp, sas_addr, type);
16841689 kfree(disc_resp);
16851690 return res;
16861691 }
@@ -1940,6 +1945,7 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, · 253 unmodified lines
19401945 struct expander_device *ex = &dev->ex_dev;
19411946 struct ex_phy *phy = &ex->ex_phy[phy_id];
19421947 enum sas_device_type type = SAS_PHY_UNUSED;
1948+ struct smp_disc_resp *disc_resp;
19431949 u8 sas_addr[SAS_ADDR_SIZE];
19441950 char msg[80] = "";
19451951 int res;
@@ -1951,33 +1957,41 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, · 5 unmodified lines
19511957 SAS_ADDR(dev->sas_addr), phy_id, msg);
19521958
19531959 memset(sas_addr, 0, SAS_ADDR_SIZE);
1954− res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type);
1960+ disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
1961+ if (!disc_resp)
1962+ return -ENOMEM;
1963+
1964+ res = sas_get_phy_discover(dev, phy_id, disc_resp);
19551965 switch (res) {
19561966 case SMP_RESP_NO_PHY:
19571967 phy->phy_state = PHY_NOT_PRESENT;
19581968 sas_unregister_devs_sas_addr(dev, phy_id, last);
1959− return res;
1969+ goto out_free_resp;
19601970 case SMP_RESP_PHY_VACANT:
19611971 phy->phy_state = PHY_VACANT;
19621972 sas_unregister_devs_sas_addr(dev, phy_id, last);
1963− return res;
1973+ goto out_free_resp;
19641974 case SMP_RESP_FUNC_ACC:
19651975 break;
19661976 case -ECOMM:
19671977 break;
19681978 default:
1969− return res;
1979+ goto out_free_resp;
19701980 }
19711981
1982+ if (res == 0)
1983+ sas_get_sas_addr_and_dev_type(disc_resp, sas_addr, &type);
1984+
19721985 if ((SAS_ADDR(sas_addr) == 0) || (res == -ECOMM)) {
19731986 phy->phy_state = PHY_EMPTY;
19741987 sas_unregister_devs_sas_addr(dev, phy_id, last);
19751988 /*
1976− * Even though the PHY is empty, for convenience we discover
1977− * the PHY to update the PHY info, like negotiated linkrate.
1989+ * Even though the PHY is empty, for convenience we update
1990+ * the PHY info, like negotiated linkrate.
19781991 */
1979− sas_ex_phy_discover(dev, phy_id);
1980− return res;
1992+ if (res == 0)
1993+ sas_set_ex_phy(dev, phy_id, disc_resp);
1994+ goto out_free_resp;
19811995 } else if (SAS_ADDR(sas_addr) == SAS_ADDR(phy->attached_sas_addr) &&
19821996 dev_type_flutter(type, phy->attached_dev_type)) {
19831997 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id);
@@ -1989,7 +2003,7 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, · 5 unmodified lines
19892003 action = ", needs recovery";
19902004 pr_debug("ex %016llx phy%02d broadcast flutter%s\n",
19912005 SAS_ADDR(dev->sas_addr), phy_id, action);
1992− return res;
2006+ goto out_free_resp;
19932007 }
19942008
19952009 /* we always have to delete the old device when we went here */
@@ -1998,7 +2012,10 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, · 2 unmodified lines
19982012 SAS_ADDR(phy->attached_sas_addr));
19992013 sas_unregister_devs_sas_addr(dev, phy_id, last);
20002014
2001− return sas_discover_new(dev, phy_id);
2015+ res = sas_discover_new(dev, phy_id);
2016+out_free_resp:
2017+ kfree(disc_resp);
2018+ return res;
20022019 }
20032020
20042021 /**
drivers/scsi/lpfc/lpfc.h+1−1
@@ -1333,7 +1333,6 @@ struct lpfc_hba { · 1332 unmodified lines
13331333 struct timer_list fabric_block_timer;
13341334 unsigned long bit_flags;
13351335 atomic_t num_rsrc_err;
1336− atomic_t num_cmd_success;
13371336 unsigned long last_rsrc_error_time;
13381337 unsigned long last_ramp_down_time;
13391338 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
@@ -1438,6 +1437,7 @@ struct lpfc_hba { · 98 unmodified lines
14381437 struct timer_list inactive_vmid_poll;
14391438
14401439 /* RAS Support */
1440+ spinlock_t ras_fwlog_lock; /* do not take while holding another lock */
14411441 struct lpfc_ras_fwlog ras_fwlog;
14421442
14431443 uint32_t iocb_cnt;
drivers/scsi/lpfc/lpfc_attr.c+2−2
@@ -5865,9 +5865,9 @@ lpfc_ras_fwlog_buffsize_set(struct lpfc_hba *phba, uint val) · 5864 unmodified lines
58655865 if (phba->cfg_ras_fwlog_func != PCI_FUNC(phba->pcidev->devfn))
58665866 return -EINVAL;
58675867
5868− spin_lock_irq(&phba->hbalock);
5868+ spin_lock_irq(&phba->ras_fwlog_lock);
58695869 state = phba->ras_fwlog.state;
5870− spin_unlock_irq(&phba->hbalock);
5870+ spin_unlock_irq(&phba->ras_fwlog_lock);
58715871
58725872 if (state == REG_INPROGRESS) {
58735873 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, "6147 RAS Logging "
drivers/scsi/lpfc/lpfc_bsg.c+20−20
@@ -2513,7 +2513,7 @@ static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t *rpi) · 2512 unmodified lines
25132513 return -ENOMEM;
25142514 }
25152515
2516− dmabuff = (struct lpfc_dmabuf *)mbox->ctx_buf;
2516+ dmabuff = mbox->ctx_buf;
25172517 mbox->ctx_buf = NULL;
25182518 mbox->ctx_ndlp = NULL;
25192519 status = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
@@ -3169,10 +3169,10 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) · 649 unmodified lines
31693169 }
31703170
31713171 cmdwqe = &cmdiocbq->wqe;
3172− memset(cmdwqe, 0, sizeof(union lpfc_wqe));
3172+ memset(cmdwqe, 0, sizeof(*cmdwqe));
31733173 if (phba->sli_rev < LPFC_SLI_REV4) {
31743174 rspwqe = &rspiocbq->wqe;
3175− memset(rspwqe, 0, sizeof(union lpfc_wqe));
3175+ memset(rspwqe, 0, sizeof(*rspwqe));
31763176 }
31773177
31783178 INIT_LIST_HEAD(&head);
@@ -3376,7 +3376,7 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) · 197 unmodified lines
33763376 unsigned long flags;
33773377 uint8_t *pmb, *pmb_buf;
33783378
3379− dd_data = pmboxq->ctx_ndlp;
3379+ dd_data = pmboxq->ctx_u.dd_data;
33803380
33813381 /*
33823382 * The outgoing buffer is readily referred from the dma buffer,
@@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) · 170 unmodified lines
35533553 struct lpfc_sli_config_mbox *sli_cfg_mbx;
35543554 uint8_t *pmbx;
35553555
3556− dd_data = pmboxq->ctx_buf;
3556+ dd_data = pmboxq->ctx_u.dd_data;
35573557
35583558 /* Determine if job has been aborted */
35593559 spin_lock_irqsave(&phba->ct_ev_lock, flags);
@@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, · 380 unmodified lines
39403940 pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl;
39413941
39423942 /* context fields to callback function */
3943− pmboxq->ctx_buf = dd_data;
3943+ pmboxq->ctx_u.dd_data = dd_data;
39443944 dd_data->type = TYPE_MBOX;
39453945 dd_data->set_job = job;
39463946 dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, · 165 unmodified lines
41124112 pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl;
41134113
41144114 /* context fields to callback function */
4115− pmboxq->ctx_buf = dd_data;
4115+ pmboxq->ctx_u.dd_data = dd_data;
41164116 dd_data->type = TYPE_MBOX;
41174117 dd_data->set_job = job;
41184118 dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, · 341 unmodified lines
44604460 pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl;
44614461
44624462 /* context fields to callback function */
4463− pmboxq->ctx_buf = dd_data;
4463+ pmboxq->ctx_u.dd_data = dd_data;
44644464 dd_data->type = TYPE_MBOX;
44654465 dd_data->set_job = job;
44664466 dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4747,7 +4747,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, · 280 unmodified lines
47474747 if (mbox_req->inExtWLen || mbox_req->outExtWLen) {
47484748 from = pmbx;
47494749 ext = from + sizeof(MAILBOX_t);
4750− pmboxq->ctx_buf = ext;
4750+ pmboxq->ext_buf = ext;
47514751 pmboxq->in_ext_byte_len =
47524752 mbox_req->inExtWLen * sizeof(uint32_t);
47534753 pmboxq->out_ext_byte_len =
@@ -4875,7 +4875,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, · 121 unmodified lines
48754875 pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl;
48764876
48774877 /* setup context field to pass wait_queue pointer to wake function */
4878− pmboxq->ctx_ndlp = dd_data;
4878+ pmboxq->ctx_u.dd_data = dd_data;
48794879 dd_data->type = TYPE_MBOX;
48804880 dd_data->set_job = job;
48814881 dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -5070,12 +5070,12 @@ lpfc_bsg_get_ras_config(struct bsg_job *job) · 188 unmodified lines
50705070 bsg_reply->reply_data.vendor_reply.vendor_rsp;
50715071
50725072 /* Current logging state */
5073− spin_lock_irq(&phba->hbalock);
5073+ spin_lock_irq(&phba->ras_fwlog_lock);
50745074 if (ras_fwlog->state == ACTIVE)
50755075 ras_reply->state = LPFC_RASLOG_STATE_RUNNING;
50765076 else
50775077 ras_reply->state = LPFC_RASLOG_STATE_STOPPED;
5078− spin_unlock_irq(&phba->hbalock);
5078+ spin_unlock_irq(&phba->ras_fwlog_lock);
50795079
50805080 ras_reply->log_level = phba->ras_fwlog.fw_loglevel;
50815081 ras_reply->log_buff_sz = phba->cfg_ras_fwlog_buffsize;
@@ -5132,13 +5132,13 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) · 50 unmodified lines
51325132
51335133 if (action == LPFC_RASACTION_STOP_LOGGING) {
51345134 /* Check if already disabled */
5135− spin_lock_irq(&phba->hbalock);
5135+ spin_lock_irq(&phba->ras_fwlog_lock);
51365136 if (ras_fwlog->state != ACTIVE) {
5137− spin_unlock_irq(&phba->hbalock);
5137+ spin_unlock_irq(&phba->ras_fwlog_lock);
51385138 rc = -ESRCH;
51395139 goto ras_job_error;
51405140 }
5141− spin_unlock_irq(&phba->hbalock);
5141+ spin_unlock_irq(&phba->ras_fwlog_lock);
51425142
51435143 /* Disable logging */
51445144 lpfc_ras_stop_fwlog(phba);
@@ -5149,10 +5149,10 @@ lpfc_bsg_set_ras_config(struct bsg_job *job) · 4 unmodified lines
51495149 * FW-logging with new log-level. Return status
51505150 * "Logging already Running" to caller.
51515151 **/
5152− spin_lock_irq(&phba->hbalock);
5152+ spin_lock_irq(&phba->ras_fwlog_lock);
51535153 if (ras_fwlog->state != INACTIVE)
51545154 action_status = -EINPROGRESS;
5155− spin_unlock_irq(&phba->hbalock);
5155+ spin_unlock_irq(&phba->ras_fwlog_lock);
51565156
51575157 /* Enable logging */
51585158 rc = lpfc_sli4_ras_fwlog_init(phba, log_level,
@@ -5268,13 +5268,13 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job) · 109 unmodified lines
52685268 goto ras_job_error;
52695269
52705270 /* Logging to be stopped before reading */
5271− spin_lock_irq(&phba->hbalock);
5271+ spin_lock_irq(&phba->ras_fwlog_lock);
52725272 if (ras_fwlog->state == ACTIVE) {
5273− spin_unlock_irq(&phba->hbalock);
5273+ spin_unlock_irq(&phba->ras_fwlog_lock);
52745274 rc = -EINPROGRESS;
52755275 goto ras_job_error;
52765276 }
5277− spin_unlock_irq(&phba->hbalock);
5277+ spin_unlock_irq(&phba->ras_fwlog_lock);
52785278
52795279 if (job->request_len <
52805280 sizeof(struct fc_bsg_request) +
drivers/scsi/lpfc/lpfc_debugfs.c+6−6
@@ -2194,12 +2194,12 @@ static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, · 2193 unmodified lines
21942194
21952195 memset(buffer, 0, size);
21962196
2197− spin_lock_irq(&phba->hbalock);
2197+ spin_lock_irq(&phba->ras_fwlog_lock);
21982198 if (phba->ras_fwlog.state != ACTIVE) {
2199− spin_unlock_irq(&phba->hbalock);
2199+ spin_unlock_irq(&phba->ras_fwlog_lock);
22002200 return -EINVAL;
22012201 }
2202− spin_unlock_irq(&phba->hbalock);
2202+ spin_unlock_irq(&phba->ras_fwlog_lock);
22032203
22042204 list_for_each_entry_safe(dmabuf, next,
22052205 &phba->ras_fwlog.fwlog_buff_list, list) {
@@ -2250,13 +2250,13 @@ lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) · 44 unmodified lines
22502250 int size;
22512251 int rc = -ENOMEM;
22522252
2253− spin_lock_irq(&phba->hbalock);
2253+ spin_lock_irq(&phba->ras_fwlog_lock);
22542254 if (phba->ras_fwlog.state != ACTIVE) {
2255− spin_unlock_irq(&phba->hbalock);
2255+ spin_unlock_irq(&phba->ras_fwlog_lock);
22562256 rc = -EINVAL;
22572257 goto out;
22582258 }
2259− spin_unlock_irq(&phba->hbalock);
2259+ spin_unlock_irq(&phba->ras_fwlog_lock);
22602260
22612261 if (check_mul_overflow(LPFC_RAS_MIN_BUFF_POST_SIZE,
22622262 phba->cfg_ras_fwlog_buffsize, &size))
drivers/scsi/lpfc/lpfc_els.c+21−24
@@ -4437,23 +4437,23 @@ lpfc_els_retry_delay(struct timer_list *t) · 4436 unmodified lines
44374437 unsigned long flags;
44384438 struct lpfc_work_evt *evtp = &ndlp->els_retry_evt;
44394439
4440+ /* Hold a node reference for outstanding queued work */
4441+ if (!lpfc_nlp_get(ndlp))
4442+ return;
4443+
44404444 spin_lock_irqsave(&phba->hbalock, flags);
44414445 if (!list_empty(&evtp->evt_listp)) {
44424446 spin_unlock_irqrestore(&phba->hbalock, flags);
4447+ lpfc_nlp_put(ndlp);
44434448 return;
44444449 }
44454450
4446− /* We need to hold the node by incrementing the reference
4447− * count until the queued work is done
4448− */
4449− evtp->evt_arg1 = lpfc_nlp_get(ndlp);
4450− if (evtp->evt_arg1) {
4451− evtp->evt = LPFC_EVT_ELS_RETRY;
4452− list_add_tail(&evtp->evt_listp, &phba->work_list);
4453− lpfc_worker_wake_up(phba);
4454− }
4451+ evtp->evt_arg1 = ndlp;
4452+ evtp->evt = LPFC_EVT_ELS_RETRY;
4453+ list_add_tail(&evtp->evt_listp, &phba->work_list);
44554454 spin_unlock_irqrestore(&phba->hbalock, flags);
4456− return;
4455+
4456+ lpfc_worker_wake_up(phba);
44574457 }
44584458
44594459 /**
@@ -7238,7 +7238,7 @@ lpfc_get_rdp_info(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context) · 2778 unmodified lines
72387238 goto rdp_fail;
72397239 mbox->vport = rdp_context->ndlp->vport;
72407240 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0;
7241− mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
7241+ mbox->ctx_u.rdp = rdp_context;
72427242 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
72437243 if (rc == MBX_NOT_FINISHED) {
72447244 lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
@@ -7290,7 +7290,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, · 45 unmodified lines
72907290 mbox->in_ext_byte_len = DMP_SFF_PAGE_A0_SIZE;
72917291 mbox->out_ext_byte_len = DMP_SFF_PAGE_A0_SIZE;
72927292 mbox->mbox_offset_word = 5;
7293− mbox->ctx_buf = virt;
7293+ mbox->ext_buf = virt;
72947294 } else {
72957295 bf_set(lpfc_mbx_memory_dump_type3_length,
72967296 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE);
@@ -7298,7 +7298,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, · 1 unmodified line
72987298 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
72997299 }
73007300 mbox->vport = phba->pport;
7301− mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
73027301
73037302 rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
73047303 if (rc == MBX_NOT_FINISHED) {
@@ -7307,7 +7306,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, · 2 unmodified lines
73077306 }
73087307
73097308 if (phba->sli_rev == LPFC_SLI_REV4)
7310− mp = (struct lpfc_dmabuf *)(mbox->ctx_buf);
7309+ mp = mbox->ctx_buf;
73117310 else
73127311 mp = mpsave;
73137312
@@ -7350,7 +7349,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, · 36 unmodified lines
73507349 mbox->in_ext_byte_len = DMP_SFF_PAGE_A2_SIZE;
73517350 mbox->out_ext_byte_len = DMP_SFF_PAGE_A2_SIZE;
73527351 mbox->mbox_offset_word = 5;
7353− mbox->ctx_buf = virt;
7352+ mbox->ext_buf = virt;
73547353 } else {
73557354 bf_set(lpfc_mbx_memory_dump_type3_length,
73567355 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE);
@@ -7358,7 +7357,6 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba, · 1 unmodified line
73587357 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
73597358 }
73607359
7361− mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
73627360 rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
73637361 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) {
73647362 rc = 1;
@@ -7500,9 +7498,9 @@ lpfc_els_lcb_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 135 unmodified lines
75007498 int rc;
75017499
75027500 mb = &pmb->u.mb;
7503− lcb_context = (struct lpfc_lcb_context *)pmb->ctx_ndlp;
7501+ lcb_context = pmb->ctx_u.lcb;
75047502 ndlp = lcb_context->ndlp;
7505− pmb->ctx_ndlp = NULL;
7503+ memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u));
75067504 pmb->ctx_buf = NULL;
75077505
75087506 shdr = (union lpfc_sli4_cfg_shdr *)
@@ -7642,7 +7640,7 @@ lpfc_sli4_set_beacon(struct lpfc_vport *vport, · 133 unmodified lines
76427640 lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON,
76437641 LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len,
76447642 LPFC_SLI4_MBX_EMBED);
7645− mbox->ctx_ndlp = (void *)lcb_context;
7643+ mbox->ctx_u.lcb = lcb_context;
76467644 mbox->vport = phba->pport;
76477645 mbox->mbox_cmpl = lpfc_els_lcb_rsp;
76487646 bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config,
@@ -8639,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 990 unmodified lines
86398637 mb = &pmb->u.mb;
86408638
86418639 ndlp = pmb->ctx_ndlp;
8642− rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff);
8643− oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff);
8644− pmb->ctx_buf = NULL;
8640+ rxid = (uint16_t)(pmb->ctx_u.ox_rx_id & 0xffff);
8641+ oxid = (uint16_t)((pmb->ctx_u.ox_rx_id >> 16) & 0xffff);
8642+ memset(&pmb->ctx_u, 0, sizeof(pmb->ctx_u));
86458643 pmb->ctx_ndlp = NULL;
86468644
86478645 if (mb->mbxStatus) {
@@ -8745,8 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, · 97 unmodified lines
87458743 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC);
87468744 if (mbox) {
87478745 lpfc_read_lnk_stat(phba, mbox);
8748− mbox->ctx_buf = (void *)((unsigned long)
8749− (ox_id << 16 | ctx));
8746+ mbox->ctx_u.ox_rx_id = ox_id << 16 | ctx;
87508747 mbox->ctx_ndlp = lpfc_nlp_get(ndlp);
87518748 if (!mbox->ctx_ndlp)
87528749 goto node_err;
drivers/scsi/lpfc/lpfc_hbadisc.c+16−17
@@ -257,7 +257,9 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) · 256 unmodified lines
257257 if (evtp->evt_arg1) {
258258 evtp->evt = LPFC_EVT_DEV_LOSS;
259259 list_add_tail(&evtp->evt_listp, &phba->work_list);
260+ spin_unlock_irqrestore(&phba->hbalock, iflags);
260261 lpfc_worker_wake_up(phba);
262+ return;
261263 }
262264 spin_unlock_irqrestore(&phba->hbalock, iflags);
263265 } else {
@@ -275,10 +277,7 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) · 11 unmodified lines
275277 lpfc_disc_state_machine(vport, ndlp, NULL,
276278 NLP_EVT_DEVICE_RM);
277279 }
278−
279280 }
280−
281− return;
282281 }
283282
284283 /**
@@ -3429,7 +3428,7 @@ static void · 3144 unmodified lines
34293428 lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
34303429 {
34313430 MAILBOX_t *mb = &pmb->u.mb;
3432− struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
3431+ struct lpfc_dmabuf *mp = pmb->ctx_buf;
34333432 struct lpfc_vport *vport = pmb->vport;
34343433 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
34353434 struct serv_parm *sp = &vport->fc_sparam;
@@ -3737,7 +3736,7 @@ lpfc_mbx_cmpl_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 301 unmodified lines
37373736 struct lpfc_mbx_read_top *la;
37383737 struct lpfc_sli_ring *pring;
37393738 MAILBOX_t *mb = &pmb->u.mb;
3740− struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf);
3739+ struct lpfc_dmabuf *mp = pmb->ctx_buf;
37413740 uint8_t attn_type;
37423741
37433742 /* Unblock ELS traffic */
@@ -3851,8 +3850,8 @@ void · 107 unmodified lines
38513850 lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
38523851 {
38533852 struct lpfc_vport *vport = pmb->vport;
3854− struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
3855− struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
3853+ struct lpfc_dmabuf *mp = pmb->ctx_buf;
3854+ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
38563855
38573856 /* The driver calls the state machine with the pmb pointer
38583857 * but wants to make sure a stale ctx_buf isn't acted on.
@@ -4066,7 +4065,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) · 207 unmodified lines
40664065 * the dump routine is a single-use construct.
40674066 */
40684067 if (pmb->ctx_buf) {
4069− mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
4068+ mp = pmb->ctx_buf;
40704069 lpfc_mbuf_free(phba, mp->virt, mp->phys);
40714070 kfree(mp);
40724071 pmb->ctx_buf = NULL;
@@ -4089,7 +4088,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) · 16 unmodified lines
40894088
40904089 if (phba->sli_rev == LPFC_SLI_REV4) {
40914090 byte_count = pmb->u.mqe.un.mb_words[5];
4092− mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
4091+ mp = pmb->ctx_buf;
40934092 if (byte_count > sizeof(struct static_vport_info) -
40944093 offset)
40954094 byte_count = sizeof(struct static_vport_info)
@@ -4169,7 +4168,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 73 unmodified lines
41694168 {
41704169 struct lpfc_vport *vport = pmb->vport;
41714170 MAILBOX_t *mb = &pmb->u.mb;
4172− struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
4171+ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
41734172
41744173 pmb->ctx_ndlp = NULL;
41754174
@@ -4307,7 +4306,7 @@ void · 131 unmodified lines
43074306 lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
43084307 {
43094308 MAILBOX_t *mb = &pmb->u.mb;
4310− struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
4309+ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
43114310 struct lpfc_vport *vport = pmb->vport;
43124311 int rc;
43134312
@@ -4431,7 +4430,7 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 117 unmodified lines
44314430 {
44324431 struct lpfc_vport *vport = pmb->vport;
44334432 MAILBOX_t *mb = &pmb->u.mb;
4434− struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
4433+ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
44354434
44364435 pmb->ctx_ndlp = NULL;
44374436 if (mb->mbxStatus) {
@@ -5174,7 +5173,7 @@ lpfc_nlp_logo_unreg(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 736 unmodified lines
51745173 struct lpfc_vport *vport = pmb->vport;
51755174 struct lpfc_nodelist *ndlp;
51765175
5177− ndlp = (struct lpfc_nodelist *)(pmb->ctx_ndlp);
5176+ ndlp = pmb->ctx_ndlp;
51785177 if (!ndlp)
51795178 return;
51805179 lpfc_issue_els_logo(vport, ndlp, 0);
@@ -5496,7 +5495,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 315 unmodified lines
54965495 if ((mb = phba->sli.mbox_active)) {
54975496 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) &&
54985497 !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) &&
5499− (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) {
5498+ (ndlp == mb->ctx_ndlp)) {
55005499 mb->ctx_ndlp = NULL;
55015500 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
55025501 }
@@ -5507,7 +5506,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 4 unmodified lines
55075506 list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) {
55085507 if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) ||
55095508 (mb->mbox_flag & LPFC_MBX_IMED_UNREG) ||
5510− (ndlp != (struct lpfc_nodelist *)mb->ctx_ndlp))
5509+ (ndlp != mb->ctx_ndlp))
55115510 continue;
55125511
55135512 mb->ctx_ndlp = NULL;
@@ -5517,7 +5516,7 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 3 unmodified lines
55175516 list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) {
55185517 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) &&
55195518 !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) &&
5520− (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) {
5519+ (ndlp == mb->ctx_ndlp)) {
55215520 list_del(&mb->list);
55225521 lpfc_mbox_rsrc_cleanup(phba, mb, MBOX_THD_LOCKED);
55235522
@@ -6357,7 +6356,7 @@ void · 833 unmodified lines
63576356 lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
63586357 {
63596358 MAILBOX_t *mb = &pmb->u.mb;
6360− struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
6359+ struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
63616360 struct lpfc_vport *vport = pmb->vport;
63626361
63636362 pmb->ctx_ndlp = NULL;
drivers/scsi/lpfc/lpfc_init.c+8−5
@@ -460,7 +460,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 459 unmodified lines
460460 return -EIO;
461461 }
462462
463− mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
463+ mp = pmb->ctx_buf;
464464
465465 /* This dmabuf was allocated by lpfc_read_sparam. The dmabuf is no
466466 * longer needed. Prevent unintended ctx_buf access as the mbox is
@@ -2217,7 +2217,7 @@ lpfc_handle_latt(struct lpfc_hba *phba) · 1750 unmodified lines
22172217 /* Cleanup any outstanding ELS commands */
22182218 lpfc_els_flush_all_cmd(phba);
22192219 psli->slistat.link_event++;
2220− lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
2220+ lpfc_read_topology(phba, pmb, pmb->ctx_buf);
22212221 pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
22222222 pmb->vport = vport;
22232223 /* Block ELS IOCBs until we have processed this mbox command */
@@ -5454,7 +5454,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba, · 3230 unmodified lines
54545454 phba->sli.slistat.link_event++;
54555455
54565456 /* Create lpfc_handle_latt mailbox command from link ACQE */
5457− lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
5457+ lpfc_read_topology(phba, pmb, pmb->ctx_buf);
54585458 pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
54595459 pmb->vport = phba->pport;
54605460
@@ -6347,7 +6347,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba *phba, struct lpfc_acqe_fc_la *acqe_fc) · 886 unmodified lines
63476347 phba->sli.slistat.link_event++;
63486348
63496349 /* Create lpfc_handle_latt mailbox command from link ACQE */
6350− lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
6350+ lpfc_read_topology(phba, pmb, pmb->ctx_buf);
63516351 pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
63526352 pmb->vport = phba->pport;
63536353
@@ -7705,6 +7705,9 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba) · 1351 unmodified lines
77057705 "NVME" : " "),
77067706 (phba->nvmet_support ? "NVMET" : " "));
77077707
7708+ /* ras_fwlog state */
7709+ spin_lock_init(&phba->ras_fwlog_lock);
7710+
77087711 /* Initialize the IO buffer list used by driver for SLI3 SCSI */
77097712 spin_lock_init(&phba->scsi_buf_list_get_lock);
77107713 INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_get);
@@ -13055,7 +13058,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) · 5344 unmodified lines
1305513058 rc = request_threaded_irq(eqhdl->irq,
1305613059 &lpfc_sli4_hba_intr_handler,
1305713060 &lpfc_sli4_hba_intr_handler_th,
13058− IRQF_ONESHOT, name, eqhdl);
13061+ 0, name, eqhdl);
1305913062 if (rc) {
1306013063 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
1306113064 "0486 MSI-X fast-path (%d) "
drivers/scsi/lpfc/lpfc_mbox.c+10−20
@@ -102,7 +102,7 @@ lpfc_mbox_rsrc_cleanup(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox, · 101 unmodified lines
102102 {
103103 struct lpfc_dmabuf *mp;
104104
105− mp = (struct lpfc_dmabuf *)mbox->ctx_buf;
105+ mp = mbox->ctx_buf;
106106 mbox->ctx_buf = NULL;
107107
108108 /* Release the generic BPL buffer memory. */
@@ -204,10 +204,8 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset, · 95 unmodified lines
204204 uint16_t region_id)
205205 {
206206 MAILBOX_t *mb;
207− void *ctx;
208207
209208 mb = &pmb->u.mb;
210− ctx = pmb->ctx_buf;
211209
212210 /* Setup to dump VPD region */
213211 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
@@ -219,7 +217,6 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset, · 5 unmodified lines
219217 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t));
220218 mb->un.varDmp.co = 0;
221219 mb->un.varDmp.resp_offset = 0;
222− pmb->ctx_buf = ctx;
223220 mb->mbxOwner = OWN_HOST;
224221 return;
225222 }
@@ -236,11 +233,8 @@ void · 10 unmodified lines
236233 lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
237234 {
238235 MAILBOX_t *mb;
239− void *ctx;
240236
241237 mb = &pmb->u.mb;
242− /* Save context so that we can restore after memset */
243− ctx = pmb->ctx_buf;
244238
245239 /* Setup to dump VPD region */
246240 memset(pmb, 0, sizeof(LPFC_MBOXQ_t));
@@ -254,7 +248,6 @@ lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 7 unmodified lines
254248 mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE;
255249 mb->un.varDmp.co = 0;
256250 mb->un.varDmp.resp_offset = 0;
257− pmb->ctx_buf = ctx;
258251 return;
259252 }
260253
@@ -372,7 +365,7 @@ lpfc_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, · 111 unmodified lines
372365 /* Save address for later completion and set the owner to host so that
373366 * the FW knows this mailbox is available for processing.
374367 */
375− pmb->ctx_buf = (uint8_t *)mp;
368+ pmb->ctx_buf = mp;
376369 mb->mbxOwner = OWN_HOST;
377370 return (0);
378371 }
@@ -1816,7 +1809,7 @@ lpfc_sli4_mbox_cmd_free(struct lpfc_hba *phba, struct lpfcMboxq *mbox) · 1437 unmodified lines
18161809 }
18171810 /* Reinitialize the context pointers to avoid stale usage. */
18181811 mbox->ctx_buf = NULL;
1819− mbox->context3 = NULL;
1812+ memset(&mbox->ctx_u, 0, sizeof(mbox->ctx_u));
18201813 kfree(mbox->sge_array);
18211814 /* Finally, free the mailbox command itself */
18221815 mempool_free(mbox, phba->mbox_mem_pool);
@@ -2366,8 +2359,7 @@ lpfc_mbx_cmpl_rdp_link_stat(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 543 unmodified lines
23662359 {
23672360 MAILBOX_t *mb;
23682361 int rc = FAILURE;
2369− struct lpfc_rdp_context *rdp_context =
2370− (struct lpfc_rdp_context *)(mboxq->ctx_ndlp);
2362+ struct lpfc_rdp_context *rdp_context = mboxq->ctx_u.rdp;
23712363
23722364 mb = &mboxq->u.mb;
23732365 if (mb->mbxStatus)
@@ -2385,9 +2377,8 @@ mbx_failed: · 11 unmodified lines
23852377 static void
23862378 lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
23872379 {
2388− struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf;
2389− struct lpfc_rdp_context *rdp_context =
2390− (struct lpfc_rdp_context *)(mbox->ctx_ndlp);
2380+ struct lpfc_dmabuf *mp = mbox->ctx_buf;
2381+ struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp;
23912382
23922383 if (bf_get(lpfc_mqe_status, &mbox->u.mqe))
23932384 goto error_mbox_free;
@@ -2401,7 +2392,7 @@ lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) · 7 unmodified lines
24012392 /* Save the dma buffer for cleanup in the final completion. */
24022393 mbox->ctx_buf = mp;
24032394 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat;
2404− mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
2395+ mbox->ctx_u.rdp = rdp_context;
24052396 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED)
24062397 goto error_mbox_free;
24072398
@@ -2416,9 +2407,8 @@ void · 8 unmodified lines
24162407 lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
24172408 {
24182409 int rc;
2419− struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf);
2420− struct lpfc_rdp_context *rdp_context =
2421− (struct lpfc_rdp_context *)(mbox->ctx_ndlp);
2410+ struct lpfc_dmabuf *mp = mbox->ctx_buf;
2411+ struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp;
24222412
24232413 if (bf_get(lpfc_mqe_status, &mbox->u.mqe))
24242414 goto error;
@@ -2448,7 +2438,7 @@ lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) · 23 unmodified lines
24482438 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
24492439
24502440 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2;
2451− mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context;
2441+ mbox->ctx_u.rdp = rdp_context;
24522442 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
24532443 if (rc == MBX_NOT_FINISHED)
24542444 goto error;
drivers/scsi/lpfc/lpfc_nportdisc.c+6−6
@@ -300,7 +300,7 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox) · 299 unmodified lines
300300 int rc;
301301
302302 ndlp = login_mbox->ctx_ndlp;
303− save_iocb = login_mbox->context3;
303+ save_iocb = login_mbox->ctx_u.save_iocb;
304304
305305 if (mb->mbxStatus == MBX_SUCCESS) {
306306 /* Now that REG_RPI completed successfully,
@@ -640,7 +640,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 333 unmodified lines
640640 if (!login_mbox->ctx_ndlp)
641641 goto out;
642642
643− login_mbox->context3 = save_iocb; /* For PLOGI ACC */
643+ login_mbox->ctx_u.save_iocb = save_iocb; /* For PLOGI ACC */
644644
645645 spin_lock_irq(&ndlp->lock);
646646 ndlp->nlp_flag |= (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI);
@@ -682,8 +682,8 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 35 unmodified lines
682682 struct lpfc_nodelist *ndlp;
683683 uint32_t cmd;
684684
685− elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf;
686− ndlp = (struct lpfc_nodelist *)mboxq->ctx_ndlp;
685+ elsiocb = mboxq->ctx_u.save_iocb;
686+ ndlp = mboxq->ctx_ndlp;
687687 vport = mboxq->vport;
688688 cmd = elsiocb->drvrTimeout;
689689
@@ -1875,7 +1875,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, · 1185 unmodified lines
18751875 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */
18761876 if ((mb = phba->sli.mbox_active)) {
18771877 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) &&
1878− (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) {
1878+ (ndlp == mb->ctx_ndlp)) {
18791879 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND;
18801880 lpfc_nlp_put(ndlp);
18811881 mb->ctx_ndlp = NULL;
@@ -1886,7 +1886,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, · 4 unmodified lines
18861886 spin_lock_irq(&phba->hbalock);
18871887 list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) {
18881888 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) &&
1889− (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) {
1889+ (ndlp == mb->ctx_ndlp)) {
18901890 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND;
18911891 lpfc_nlp_put(ndlp);
18921892 list_del(&mb->list);
drivers/scsi/lpfc/lpfc_nvme.c+2−2
@@ -2616,9 +2616,9 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 2615 unmodified lines
26162616 /* No concern about the role change on the nvme remoteport.
26172617 * The transport will update it.
26182618 */
2619− spin_lock_irq(&vport->phba->hbalock);
2619+ spin_lock_irq(&ndlp->lock);
26202620 ndlp->fc4_xpt_flags |= NVME_XPT_UNREG_WAIT;
2621− spin_unlock_irq(&vport->phba->hbalock);
2621+ spin_unlock_irq(&ndlp->lock);
26222622
26232623 /* Don't let the host nvme transport keep sending keep-alives
26242624 * on this remoteport. Vport is unloading, no recovery. The
drivers/scsi/lpfc/lpfc_nvmet.c+1−1
@@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 1585 unmodified lines
15861586 wqe = &nvmewqe->wqe;
15871587
15881588 /* Initialize WQE */
1589− memset(wqe, 0, sizeof(union lpfc_wqe));
1589+ memset(wqe, 0, sizeof(*wqe));
15901590
15911591 ctx_buf->iocbq->cmd_dmabuf = NULL;
15921592 spin_lock(&phba->sli4_hba.sgl_list_lock);
drivers/scsi/lpfc/lpfc_scsi.c+4−19
@@ -167,11 +167,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) · 166 unmodified lines
167167 struct Scsi_Host *shost;
168168 struct scsi_device *sdev;
169169 unsigned long new_queue_depth;
170− unsigned long num_rsrc_err, num_cmd_success;
170+ unsigned long num_rsrc_err;
171171 int i;
172172
173173 num_rsrc_err = atomic_read(&phba->num_rsrc_err);
174− num_cmd_success = atomic_read(&phba->num_cmd_success);
175174
176175 /*
177176 * The error and success command counters are global per
@@ -186,20 +185,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) · 8 unmodified lines
186185 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
187186 shost = lpfc_shost_from_vport(vports[i]);
188187 shost_for_each_device(sdev, shost) {
189− new_queue_depth =
190− sdev->queue_depth * num_rsrc_err /
191− (num_rsrc_err + num_cmd_success);
192− if (!new_queue_depth)
193− new_queue_depth = sdev->queue_depth - 1;
188+ if (num_rsrc_err >= sdev->queue_depth)
189+ new_queue_depth = 1;
194190 else
195191 new_queue_depth = sdev->queue_depth -
196− new_queue_depth;
192+ num_rsrc_err;
197193 scsi_change_queue_depth(sdev, new_queue_depth);
198194 }
199195 }
200196 lpfc_destroy_vport_work_array(phba, vports);
201197 atomic_set(&phba->num_rsrc_err, 0);
202− atomic_set(&phba->num_cmd_success, 0);
203198 }
204199
205200 /**
@@ -5336,16 +5331,6 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) · 5130 unmodified lines
53365331 }
53375332 err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd);
53385333 } else {
5339− if (vport->phba->cfg_enable_bg) {
5340− lpfc_printf_vlog(vport,
5341− KERN_INFO, LOG_SCSI_CMD,
5342− "9038 BLKGRD: rcvd PROT_NORMAL cmd: "
5343− "x%x reftag x%x cnt %u pt %x\n",
5344− cmnd->cmnd[0],
5345− scsi_prot_ref_tag(cmnd),
5346− scsi_logical_block_count(cmnd),
5347− (cmnd->cmnd[1]>>5));
5348− }
53495334 err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd);
53505335 }
53515336
drivers/scsi/lpfc/lpfc_sli.c+49−50
@@ -1217,9 +1217,9 @@ lpfc_set_rrq_active(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, · 1216 unmodified lines
12171217 empty = list_empty(&phba->active_rrq_list);
12181218 list_add_tail(&rrq->list, &phba->active_rrq_list);
12191219 phba->hba_flag |= HBA_RRQ_ACTIVE;
1220+ spin_unlock_irqrestore(&phba->hbalock, iflags);
12201221 if (empty)
12211222 lpfc_worker_wake_up(phba);
1222− spin_unlock_irqrestore(&phba->hbalock, iflags);
12231223 return 0;
12241224 out:
12251225 spin_unlock_irqrestore(&phba->hbalock, iflags);
@@ -2830,7 +2830,7 @@ lpfc_sli_wake_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq) · 1604 unmodified lines
28302830 */
28312831 pmboxq->mbox_flag |= LPFC_MBX_WAKE;
28322832 spin_lock_irqsave(&phba->hbalock, drvr_flag);
2833− pmbox_done = (struct completion *)pmboxq->context3;
2833+ pmbox_done = pmboxq->ctx_u.mbox_wait;
28342834 if (pmbox_done)
28352835 complete(pmbox_done);
28362836 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
@@ -2885,7 +2885,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 48 unmodified lines
28852885 if (!test_bit(FC_UNLOADING, &phba->pport->load_flag) &&
28862886 pmb->u.mb.mbxCommand == MBX_REG_LOGIN64 &&
28872887 !pmb->u.mb.mbxStatus) {
2888− mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
2888+ mp = pmb->ctx_buf;
28892889 if (mp) {
28902890 pmb->ctx_buf = NULL;
28912891 lpfc_mbuf_free(phba, mp->virt, mp->phys);
@@ -2914,12 +2914,12 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 22 unmodified lines
29142914 }
29152915
29162916 if (pmb->u.mb.mbxCommand == MBX_REG_LOGIN64) {
2917− ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
2917+ ndlp = pmb->ctx_ndlp;
29182918 lpfc_nlp_put(ndlp);
29192919 }
29202920
29212921 if (pmb->u.mb.mbxCommand == MBX_UNREG_LOGIN) {
2922− ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
2922+ ndlp = pmb->ctx_ndlp;
29232923
29242924 /* Check to see if there are any deferred events to process */
29252925 if (ndlp) {
@@ -2952,7 +2952,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 26 unmodified lines
29522952
29532953 /* This nlp_put pairs with lpfc_sli4_resume_rpi */
29542954 if (pmb->u.mb.mbxCommand == MBX_RESUME_RPI) {
2955− ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
2955+ ndlp = pmb->ctx_ndlp;
29562956 lpfc_nlp_put(ndlp);
29572957 }
29582958
@@ -5819,7 +5819,7 @@ lpfc_sli4_read_fcoe_params(struct lpfc_hba *phba) · 2860 unmodified lines
58195819 goto out_free_mboxq;
58205820 }
58215821
5822− mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
5822+ mp = mboxq->ctx_buf;
58235823 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
58245824
58255825 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
@@ -6849,9 +6849,9 @@ lpfc_ras_stop_fwlog(struct lpfc_hba *phba) · 1023 unmodified lines
68496849 {
68506850 struct lpfc_ras_fwlog *ras_fwlog = &phba->ras_fwlog;
68516851
6852− spin_lock_irq(&phba->hbalock);
6852+ spin_lock_irq(&phba->ras_fwlog_lock);
68536853 ras_fwlog->state = INACTIVE;
6854− spin_unlock_irq(&phba->hbalock);
6854+ spin_unlock_irq(&phba->ras_fwlog_lock);
68556855
68566856 /* Disable FW logging to host memory */
68576857 writel(LPFC_CTL_PDEV_CTL_DDL_RAS,
@@ -6894,9 +6894,9 @@ lpfc_sli4_ras_dma_free(struct lpfc_hba *phba) · 36 unmodified lines
68946894 ras_fwlog->lwpd.virt = NULL;
68956895 }
68966896
6897− spin_lock_irq(&phba->hbalock);
6897+ spin_lock_irq(&phba->ras_fwlog_lock);
68986898 ras_fwlog->state = INACTIVE;
6899− spin_unlock_irq(&phba->hbalock);
6899+ spin_unlock_irq(&phba->ras_fwlog_lock);
69006900 }
69016901
69026902 /**
@@ -6998,9 +6998,9 @@ lpfc_sli4_ras_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 95 unmodified lines
69986998 goto disable_ras;
69996999 }
70007000
7001− spin_lock_irq(&phba->hbalock);
7001+ spin_lock_irq(&phba->ras_fwlog_lock);
70027002 ras_fwlog->state = ACTIVE;
7003− spin_unlock_irq(&phba->hbalock);
7003+ spin_unlock_irq(&phba->ras_fwlog_lock);
70047004 mempool_free(pmb, phba->mbox_mem_pool);
70057005
70067006 return;
@@ -7032,9 +7032,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, · 25 unmodified lines
70327032 uint32_t len = 0, fwlog_buffsize, fwlog_entry_count;
70337033 int rc = 0;
70347034
7035− spin_lock_irq(&phba->hbalock);
7035+ spin_lock_irq(&phba->ras_fwlog_lock);
70367036 ras_fwlog->state = INACTIVE;
7037− spin_unlock_irq(&phba->hbalock);
7037+ spin_unlock_irq(&phba->ras_fwlog_lock);
70387038
70397039 fwlog_buffsize = (LPFC_RAS_MIN_BUFF_POST_SIZE *
70407040 phba->cfg_ras_fwlog_buffsize);
@@ -7095,9 +7095,9 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, · 54 unmodified lines
70957095 mbx_fwlog->u.request.lwpd.addr_lo = putPaddrLow(ras_fwlog->lwpd.phys);
70967096 mbx_fwlog->u.request.lwpd.addr_hi = putPaddrHigh(ras_fwlog->lwpd.phys);
70977097
7098− spin_lock_irq(&phba->hbalock);
7098+ spin_lock_irq(&phba->ras_fwlog_lock);
70997099 ras_fwlog->state = REG_INPROGRESS;
7100− spin_unlock_irq(&phba->hbalock);
7100+ spin_unlock_irq(&phba->ras_fwlog_lock);
71017101 mbox->vport = phba->pport;
71027102 mbox->mbox_cmpl = lpfc_sli4_ras_mbox_cmpl;
71037103
@@ -8766,7 +8766,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 1662 unmodified lines
87668766
87678767 mboxq->vport = vport;
87688768 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
8769− mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
8769+ mp = mboxq->ctx_buf;
87708770 if (rc == MBX_SUCCESS) {
87718771 memcpy(&vport->fc_sparam, mp->virt, sizeof(struct serv_parm));
87728772 rc = 0;
@@ -9548,8 +9548,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 775 unmodified lines
95489548 }
95499549
95509550 /* Copy the mailbox extension data */
9551− if (pmbox->in_ext_byte_len && pmbox->ctx_buf) {
9552− lpfc_sli_pcimem_bcopy(pmbox->ctx_buf,
9551+ if (pmbox->in_ext_byte_len && pmbox->ext_buf) {
9552+ lpfc_sli_pcimem_bcopy(pmbox->ext_buf,
95539553 (uint8_t *)phba->mbox_ext,
95549554 pmbox->in_ext_byte_len);
95559555 }
@@ -9562,10 +9562,10 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 6 unmodified lines
95629562 = MAILBOX_HBA_EXT_OFFSET;
95639563
95649564 /* Copy the mailbox extension data */
9565− if (pmbox->in_ext_byte_len && pmbox->ctx_buf)
9565+ if (pmbox->in_ext_byte_len && pmbox->ext_buf)
95669566 lpfc_memcpy_to_slim(phba->MBslimaddr +
95679567 MAILBOX_HBA_EXT_OFFSET,
9568− pmbox->ctx_buf, pmbox->in_ext_byte_len);
9568+ pmbox->ext_buf, pmbox->in_ext_byte_len);
95699569
95709570 if (mbx->mbxCommand == MBX_CONFIG_PORT)
95719571 /* copy command data into host mbox for cmpl */
@@ -9688,9 +9688,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 116 unmodified lines
96889688 lpfc_sli_pcimem_bcopy(phba->mbox, mbx,
96899689 MAILBOX_CMD_SIZE);
96909690 /* Copy the mailbox extension data */
9691− if (pmbox->out_ext_byte_len && pmbox->ctx_buf) {
9691+ if (pmbox->out_ext_byte_len && pmbox->ext_buf) {
96929692 lpfc_sli_pcimem_bcopy(phba->mbox_ext,
9693− pmbox->ctx_buf,
9693+ pmbox->ext_buf,
96949694 pmbox->out_ext_byte_len);
96959695 }
96969696 } else {
@@ -9698,9 +9698,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 1 unmodified line
96989698 lpfc_memcpy_from_slim(mbx, phba->MBslimaddr,
96999699 MAILBOX_CMD_SIZE);
97009700 /* Copy the mailbox extension data */
9701− if (pmbox->out_ext_byte_len && pmbox->ctx_buf) {
9701+ if (pmbox->out_ext_byte_len && pmbox->ext_buf) {
97029702 lpfc_memcpy_from_slim(
9703− pmbox->ctx_buf,
9703+ pmbox->ext_buf,
97049704 phba->MBslimaddr +
97059705 MAILBOX_HBA_EXT_OFFSET,
97069706 pmbox->out_ext_byte_len);
@@ -11373,18 +11373,18 @@ lpfc_sli_post_recovery_event(struct lpfc_hba *phba, · 1666 unmodified lines
1137311373 unsigned long iflags;
1137411374 struct lpfc_work_evt *evtp = &ndlp->recovery_evt;
1137511375
11376+ /* Hold a node reference for outstanding queued work */
11377+ if (!lpfc_nlp_get(ndlp))
11378+ return;
11379+
1137611380 spin_lock_irqsave(&phba->hbalock, iflags);
1137711381 if (!list_empty(&evtp->evt_listp)) {
1137811382 spin_unlock_irqrestore(&phba->hbalock, iflags);
11383+ lpfc_nlp_put(ndlp);
1137911384 return;
1138011385 }
1138111386
11382− /* Incrementing the reference count until the queued work is done. */
11383− evtp->evt_arg1 = lpfc_nlp_get(ndlp);
11384− if (!evtp->evt_arg1) {
11385− spin_unlock_irqrestore(&phba->hbalock, iflags);
11386− return;
11387− }
11387+ evtp->evt_arg1 = ndlp;
1138811388 evtp->evt = LPFC_EVT_RECOVER_PORT;
1138911389 list_add_tail(&evtp->evt_listp, &phba->work_list);
1139011390 spin_unlock_irqrestore(&phba->hbalock, iflags);
@@ -13262,9 +13262,9 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, · 1871 unmodified lines
1326213262 /* setup wake call as IOCB callback */
1326313263 pmboxq->mbox_cmpl = lpfc_sli_wake_mbox_wait;
1326413264
13265− /* setup context3 field to pass wait_queue pointer to wake function */
13265+ /* setup ctx_u field to pass wait_queue pointer to wake function */
1326613266 init_completion(&mbox_done);
13267− pmboxq->context3 = &mbox_done;
13267+ pmboxq->ctx_u.mbox_wait = &mbox_done;
1326813268 /* now issue the command */
1326913269 retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT);
1327013270 if (retval == MBX_BUSY || retval == MBX_SUCCESS) {
@@ -13272,7 +13272,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, · 1 unmodified line
1327213272 msecs_to_jiffies(timeout * 1000));
1327313273
1327413274 spin_lock_irqsave(&phba->hbalock, flag);
13275− pmboxq->context3 = NULL;
13275+ pmboxq->ctx_u.mbox_wait = NULL;
1327613276 /*
1327713277 * if LPFC_MBX_WAKE flag is set the mailbox is completed
1327813278 * else do not free the resources.
@@ -13813,10 +13813,10 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) · 534 unmodified lines
1381313813 lpfc_sli_pcimem_bcopy(mbox, pmbox,
1381413814 MAILBOX_CMD_SIZE);
1381513815 if (pmb->out_ext_byte_len &&
13816− pmb->ctx_buf)
13816+ pmb->ext_buf)
1381713817 lpfc_sli_pcimem_bcopy(
1381813818 phba->mbox_ext,
13819− pmb->ctx_buf,
13819+ pmb->ext_buf,
1382013820 pmb->out_ext_byte_len);
1382113821 }
1382213822 if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) {
@@ -13830,10 +13830,8 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) · 7 unmodified lines
1383013830 pmbox->un.varWords[0], 0);
1383113831
1383213832 if (!pmbox->mbxStatus) {
13833− mp = (struct lpfc_dmabuf *)
13834− (pmb->ctx_buf);
13835− ndlp = (struct lpfc_nodelist *)
13836− pmb->ctx_ndlp;
13833+ mp = pmb->ctx_buf;
13834+ ndlp = pmb->ctx_ndlp;
1383713835
1383813836 /* Reg_LOGIN of dflt RPI was
1383913837 * successful. new lets get
@@ -14340,8 +14338,8 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) · 500 unmodified lines
1434014338 mcqe_status,
1434114339 pmbox->un.varWords[0], 0);
1434214340 if (mcqe_status == MB_CQE_STATUS_SUCCESS) {
14343− mp = (struct lpfc_dmabuf *)(pmb->ctx_buf);
14344− ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp;
14341+ mp = pmb->ctx_buf;
14342+ ndlp = pmb->ctx_ndlp;
1434514343
1434614344 /* Reg_LOGIN of dflt RPI was successful. Mark the
1434714345 * node as having an UNREG_LOGIN in progress to stop
@@ -19823,14 +19821,15 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *phba) · 5475 unmodified lines
1982319821 * lpfc_sli4_resume_rpi - Remove the rpi bitmask region
1982419822 * @ndlp: pointer to lpfc nodelist data structure.
1982519823 * @cmpl: completion call-back.
19826− * @arg: data to load as MBox 'caller buffer information'
19824+ * @iocbq: data to load as mbox ctx_u information
1982719825 *
1982819826 * This routine is invoked to remove the memory region that
1982919827 * provided rpi via a bitmask.
1983019828 **/
1983119829 int
1983219830 lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp,
19833− void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *arg)
19831+ void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *),
19832+ struct lpfc_iocbq *iocbq)
1983419833 {
1983519834 LPFC_MBOXQ_t *mboxq;
1983619835 struct lpfc_hba *phba = ndlp->phba;
@@ -19859,7 +19858,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, · 22 unmodified lines
1985919858 lpfc_resume_rpi(mboxq, ndlp);
1986019859 if (cmpl) {
1986119860 mboxq->mbox_cmpl = cmpl;
19862− mboxq->ctx_buf = arg;
19861+ mboxq->ctx_u.save_iocb = iocbq;
1986319862 } else
1986419863 mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1986519864 mboxq->ctx_ndlp = ndlp;
@@ -20676,7 +20675,7 @@ lpfc_sli4_get_config_region23(struct lpfc_hba *phba, char *rgn23_data) · 810 unmodified lines
2067620675 if (lpfc_sli4_dump_cfg_rg23(phba, mboxq))
2067720676 goto out;
2067820677 mqe = &mboxq->u.mqe;
20679− mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
20678+ mp = mboxq->ctx_buf;
2068020679 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
2068120680 if (rc)
2068220681 goto out;
@@ -21035,7 +21034,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) · 352 unmodified lines
2103521034 (mb->u.mb.mbxCommand == MBX_REG_VPI))
2103621035 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
2103721036 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) {
21038− act_mbx_ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp;
21037+ act_mbx_ndlp = mb->ctx_ndlp;
2103921038
2104021039 /* This reference is local to this routine. The
2104121040 * reference is removed at routine exit.
@@ -21064,7 +21063,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) · 22 unmodified lines
2106421063
2106521064 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
2106621065 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) {
21067− ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp;
21066+ ndlp = mb->ctx_ndlp;
2106821067 /* Unregister the RPI when mailbox complete */
2106921068 mb->mbox_flag |= LPFC_MBX_IMED_UNREG;
2107021069 restart_loop = 1;
@@ -21084,7 +21083,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport) · 13 unmodified lines
2108421083 while (!list_empty(&mbox_cmd_list)) {
2108521084 list_remove_head(&mbox_cmd_list, mb, LPFC_MBOXQ_t, list);
2108621085 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) {
21087− ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp;
21086+ ndlp = mb->ctx_ndlp;
2108821087 mb->ctx_ndlp = NULL;
2108921088 if (ndlp) {
2109021089 spin_lock(&ndlp->lock);
drivers/scsi/lpfc/lpfc_sli.h+24−6
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
4+ * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
55 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
77 * EMULEX and SLI are trademarks of Emulex. *
@@ -182,11 +182,29 @@ typedef struct lpfcMboxq { · 174 unmodified lines
182182 struct lpfc_mqe mqe;
183183 } u;
184184 struct lpfc_vport *vport; /* virtual port pointer */
185− void *ctx_ndlp; /* an lpfc_nodelist pointer */
186− void *ctx_buf; /* an lpfc_dmabuf pointer */
187− void *context3; /* a generic pointer. Code must
188− * accommodate the actual datatype.
189− */
185+ struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */
186+ struct lpfc_dmabuf *ctx_buf; /* caller buffer information */
187+ void *ext_buf; /* extended buffer for extended mbox
188+ * cmds. Not a generic pointer.
189+ * Use for storing virtual address.
190+ */
191+
192+ /* Pointers that are seldom used during mbox execution, but require
193+ * a saved context.
194+ */
195+ union {
196+ unsigned long ox_rx_id; /* Used in els_rsp_rls_acc */
197+ struct lpfc_rdp_context *rdp; /* Used in get_rdp_info */
198+ struct lpfc_lcb_context *lcb; /* Used in set_beacon */
199+ struct completion *mbox_wait; /* Used in issue_mbox_wait */
200+ struct bsg_job_data *dd_data; /* Used in bsg_issue_mbox_cmpl
201+ * and
202+ * bsg_issue_mbox_ext_handle_job
203+ */
204+ struct lpfc_iocbq *save_iocb; /* Used in defer_plogi_acc and
205+ * lpfc_mbx_cmpl_resume_rpi
206+ */
207+ } ctx_u;
190208
191209 void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *);
192210 uint8_t mbox_flag;
drivers/scsi/lpfc/lpfc_sli4.h+4−3
@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4− * Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
4+ * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
55 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66 * Copyright (C) 2009-2016 Emulex. All rights reserved. *
77 * EMULEX and SLI are trademarks of Emulex. *
@@ -1118,8 +1118,9 @@ void lpfc_sli4_free_rpi(struct lpfc_hba *, int); · 1110 unmodified lines
11181118 void lpfc_sli4_remove_rpis(struct lpfc_hba *);
11191119 void lpfc_sli4_async_event_proc(struct lpfc_hba *);
11201120 void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *);
1121−int lpfc_sli4_resume_rpi(struct lpfc_nodelist *,
1122− void (*)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *);
1121+int lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp,
1122+ void (*cmpl)(struct lpfc_hba *, LPFC_MBOXQ_t *),
1123+ struct lpfc_iocbq *iocbq);
11231124 void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *phba);
11241125 void lpfc_sli4_nvme_pci_offline_aborted(struct lpfc_hba *phba,
11251126 struct lpfc_io_buf *lpfc_ncmd);
drivers/scsi/lpfc/lpfc_version.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * included with this package. *
2121 *******************************************************************/
2222
23−#define LPFC_DRIVER_VERSION "14.4.0.0"
23+#define LPFC_DRIVER_VERSION "14.4.0.1"
2424 #define LPFC_DRIVER_NAME "lpfc"
2525
2626 /* Used for SLI 2/3 */
drivers/scsi/lpfc/lpfc_vport.c+5−5
@@ -166,7 +166,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) · 165 unmodified lines
166166 }
167167 }
168168
169− mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
169+ mp = pmb->ctx_buf;
170170 memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm));
171171 memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName,
172172 sizeof (struct lpfc_name));
@@ -674,10 +674,6 @@ lpfc_vport_delete(struct fc_vport *fc_vport) · 501 unmodified lines
674674 lpfc_free_sysfs_attr(vport);
675675 lpfc_debugfs_terminate(vport);
676676
677− /* Remove FC host to break driver binding. */
678− fc_remove_host(shost);
679− scsi_remove_host(shost);
680−
681677 /* Send the DA_ID and Fabric LOGO to cleanup Nameserver entries. */
682678 ndlp = lpfc_findnode_did(vport, Fabric_DID);
683679 if (!ndlp)
@@ -721,6 +717,10 @@ lpfc_vport_delete(struct fc_vport *fc_vport) · 37 unmodified lines
721717
722718 skip_logo:
723719
720+ /* Remove FC host to break driver binding. */
721+ fc_remove_host(shost);
722+ scsi_remove_host(shost);
723+
724724 lpfc_cleanup(vport);
725725
726726 /* Remove scsi host now. The nodes are cleaned up. */
drivers/scsi/mpi3mr/mpi3mr_app.c+1−1
@@ -1644,7 +1644,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job) · 1643 unmodified lines
16441644 if ((mpirep_offset != 0xFF) &&
16451645 drv_bufs[mpirep_offset].bsg_buf_len) {
16461646 drv_buf_iter = &drv_bufs[mpirep_offset];
1647− drv_buf_iter->kern_buf_len = (sizeof(*bsg_reply_buf) - 1 +
1647+ drv_buf_iter->kern_buf_len = (sizeof(*bsg_reply_buf) +
16481648 mrioc->reply_sz);
16491649 bsg_reply_buf = kzalloc(drv_buf_iter->kern_buf_len, GFP_KERNEL);
16501650
drivers/scsi/pmcraid.c+11−9
@@ -61,7 +61,9 @@ static atomic_t pmcraid_adapter_count = ATOMIC_INIT(0); · 60 unmodified lines
6161 * pmcraid_minor - minor number(s) to use
6262 */
6363 static unsigned int pmcraid_major;
64−static struct class *pmcraid_class;
64+static const struct class pmcraid_class = {
65+ .name = PMCRAID_DEVFILE,
66+};
6567 static DECLARE_BITMAP(pmcraid_minor, PMCRAID_MAX_ADAPTERS);
6668
6769 /*
@@ -4723,7 +4725,7 @@ static int pmcraid_setup_chrdev(struct pmcraid_instance *pinstance) · 4655 unmodified lines
47234725 if (error)
47244726 pmcraid_release_minor(minor);
47254727 else
4726− device_create(pmcraid_class, NULL, MKDEV(pmcraid_major, minor),
4728+ device_create(&pmcraid_class, NULL, MKDEV(pmcraid_major, minor),
47274729 NULL, "%s%u", PMCRAID_DEVFILE, minor);
47284730 return error;
47294731 }
@@ -4739,7 +4741,7 @@ static int pmcraid_setup_chrdev(struct pmcraid_instance *pinstance) · 9 unmodified lines
47394741 static void pmcraid_release_chrdev(struct pmcraid_instance *pinstance)
47404742 {
47414743 pmcraid_release_minor(MINOR(pinstance->cdev.dev));
4742− device_destroy(pmcraid_class,
4744+ device_destroy(&pmcraid_class,
47434745 MKDEV(pmcraid_major, MINOR(pinstance->cdev.dev)));
47444746 cdev_del(&pinstance->cdev);
47454747 }
@@ -5390,10 +5392,10 @@ static int __init pmcraid_init(void) · 644 unmodified lines
53905392 }
53915393
53925394 pmcraid_major = MAJOR(dev);
5393− pmcraid_class = class_create(PMCRAID_DEVFILE);
53945395
5395− if (IS_ERR(pmcraid_class)) {
5396− error = PTR_ERR(pmcraid_class);
5396+ error = class_register(&pmcraid_class);
5397+
5398+ if (error) {
53975399 pmcraid_err("failed to register with sysfs, error = %x\n",
53985400 error);
53995401 goto out_unreg_chrdev;
@@ -5402,7 +5404,7 @@ static int __init pmcraid_init(void) · 2 unmodified lines
54025404 error = pmcraid_netlink_init();
54035405
54045406 if (error) {
5405− class_destroy(pmcraid_class);
5407+ class_unregister(&pmcraid_class);
54065408 goto out_unreg_chrdev;
54075409 }
54085410
@@ -5413,7 +5415,7 @@ static int __init pmcraid_init(void) · 4 unmodified lines
54135415
54145416 pmcraid_err("failed to register pmcraid driver, error = %x\n",
54155417 error);
5416− class_destroy(pmcraid_class);
5418+ class_unregister(&pmcraid_class);
54175419 pmcraid_netlink_release();
54185420
54195421 out_unreg_chrdev:
@@ -5432,7 +5434,7 @@ static void __exit pmcraid_exit(void) · 12 unmodified lines
54325434 unregister_chrdev_region(MKDEV(pmcraid_major, 0),
54335435 PMCRAID_MAX_ADAPTERS);
54345436 pci_unregister_driver(&pmcraid_driver);
5435− class_destroy(pmcraid_class);
5437+ class_unregister(&pmcraid_class);
54365438 }
54375439
54385440 module_init(pmcraid_init);
drivers/scsi/qla2xxx/qla_attr.c+12−2
@@ -2741,7 +2741,13 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) · 2740 unmodified lines
27412741 return;
27422742
27432743 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2744− qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2744+ /* Will wait for wind down of adapter */
2745+ ql_dbg(ql_dbg_aer, fcport->vha, 0x900c,
2746+ "%s pci offline detected (id %06x)\n", __func__,
2747+ fcport->d_id.b24);
2748+ qla_pci_set_eeh_busy(fcport->vha);
2749+ qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
2750+ 0, WAIT_TARGET);
27452751 return;
27462752 }
27472753 }
@@ -2763,7 +2769,11 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) · 15 unmodified lines
27632769 vha = fcport->vha;
27642770
27652771 if (unlikely(pci_channel_offline(fcport->vha->hw->pdev))) {
2766− qla2x00_abort_all_cmds(fcport->vha, DID_NO_CONNECT << 16);
2772+ /* Will wait for wind down of adapter */
2773+ ql_dbg(ql_dbg_aer, fcport->vha, 0x900b,
2774+ "%s pci offline detected (id %06x)\n", __func__,
2775+ fcport->d_id.b24);
2776+ qla_pci_set_eeh_busy(vha);
27672777 qla2x00_eh_wait_for_pending_commands(fcport->vha, fcport->d_id.b24,
27682778 0, WAIT_TARGET);
27692779 return;
drivers/scsi/qla2xxx/qla_def.h+1−1
@@ -82,7 +82,7 @@ typedef union { · 81 unmodified lines
8282 #include "qla_nvme.h"
8383 #define QLA2XXX_DRIVER_NAME "qla2xxx"
8484 #define QLA2XXX_APIDEV "ql2xapidev"
85−#define QLA2XXX_MANUFACTURER "Marvell Semiconductor, Inc."
85+#define QLA2XXX_MANUFACTURER "Marvell"
8686
8787 /*
8888 * We have MAILBOX_REGISTER_COUNT sized arrays in a few places,
drivers/scsi/qla2xxx/qla_gbl.h+1−1
@@ -44,7 +44,7 @@ extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *); · 43 unmodified lines
4444 extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *);
4545
4646 extern int qla24xx_els_dcmd_iocb(scsi_qla_host_t *, int, port_id_t);
47−extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *, bool);
47+extern int qla24xx_els_dcmd2_iocb(scsi_qla_host_t *, int, fc_port_t *);
4848 extern void qla2x00_els_dcmd2_free(scsi_qla_host_t *vha,
4949 struct els_plogi *els_plogi);
5050
drivers/scsi/qla2xxx/qla_init.c+65−63
@@ -1193,8 +1193,12 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) · 1192 unmodified lines
11931193 return rval;
11941194
11951195 done_free_sp:
1196− /* ref: INIT */
1197− kref_put(&sp->cmd_kref, qla2x00_sp_release);
1196+ /*
1197+ * use qla24xx_async_gnl_sp_done to purge all pending gnl request.
1198+ * kref_put is call behind the scene.
1199+ */
1200+ sp->u.iocb_cmd.u.mbx.in_mb[0] = MBS_COMMAND_ERROR;
1201+ qla24xx_async_gnl_sp_done(sp, QLA_COMMAND_ERROR);
11981202 fcport->flags &= ~(FCF_ASYNC_SENT);
11991203 done:
12001204 fcport->flags &= ~(FCF_ASYNC_ACTIVE);
@@ -2665,6 +2669,40 @@ exit: · 1464 unmodified lines
26652669 return rval;
26662670 }
26672671
2672+static void qla_enable_fce_trace(scsi_qla_host_t *vha)
2673+{
2674+ int rval;
2675+ struct qla_hw_data *ha = vha->hw;
2676+
2677+ if (ha->fce) {
2678+ ha->flags.fce_enabled = 1;
2679+ memset(ha->fce, 0, fce_calc_size(ha->fce_bufs));
2680+ rval = qla2x00_enable_fce_trace(vha,
2681+ ha->fce_dma, ha->fce_bufs, ha->fce_mb, &ha->fce_bufs);
2682+
2683+ if (rval) {
2684+ ql_log(ql_log_warn, vha, 0x8033,
2685+ "Unable to reinitialize FCE (%d).\n", rval);
2686+ ha->flags.fce_enabled = 0;
2687+ }
2688+ }
2689+}
2690+
2691+static void qla_enable_eft_trace(scsi_qla_host_t *vha)
2692+{
2693+ int rval;
2694+ struct qla_hw_data *ha = vha->hw;
2695+
2696+ if (ha->eft) {
2697+ memset(ha->eft, 0, EFT_SIZE);
2698+ rval = qla2x00_enable_eft_trace(vha, ha->eft_dma, EFT_NUM_BUFFERS);
2699+
2700+ if (rval) {
2701+ ql_log(ql_log_warn, vha, 0x8034,
2702+ "Unable to reinitialize EFT (%d).\n", rval);
2703+ }
2704+ }
2705+}
26682706 /*
26692707 * qla2x00_initialize_adapter
26702708 * Initialize board.
@@ -3668,9 +3706,8 @@ qla24xx_chip_diag(scsi_qla_host_t *vha) · 997 unmodified lines
36683706 }
36693707
36703708 static void
3671−qla2x00_init_fce_trace(scsi_qla_host_t *vha)
3709+qla2x00_alloc_fce_trace(scsi_qla_host_t *vha)
36723710 {
3673− int rval;
36743711 dma_addr_t tc_dma;
36753712 void *tc;
36763713 struct qla_hw_data *ha = vha->hw;
@@ -3699,27 +3736,17 @@ qla2x00_init_fce_trace(scsi_qla_host_t *vha) · 22 unmodified lines
36993736 return;
37003737 }
37013738
3702− rval = qla2x00_enable_fce_trace(vha, tc_dma, FCE_NUM_BUFFERS,
3703− ha->fce_mb, &ha->fce_bufs);
3704− if (rval) {
3705− ql_log(ql_log_warn, vha, 0x00bf,
3706− "Unable to initialize FCE (%d).\n", rval);
3707− dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc, tc_dma);
3708− return;
3709− }
3710−
37113739 ql_dbg(ql_dbg_init, vha, 0x00c0,
37123740 "Allocated (%d KB) for FCE...\n", FCE_SIZE / 1024);
37133741
3714− ha->flags.fce_enabled = 1;
37153742 ha->fce_dma = tc_dma;
37163743 ha->fce = tc;
3744+ ha->fce_bufs = FCE_NUM_BUFFERS;
37173745 }
37183746
37193747 static void
3720−qla2x00_init_eft_trace(scsi_qla_host_t *vha)
3748+qla2x00_alloc_eft_trace(scsi_qla_host_t *vha)
37213749 {
3722− int rval;
37233750 dma_addr_t tc_dma;
37243751 void *tc;
37253752 struct qla_hw_data *ha = vha->hw;
@@ -3744,14 +3771,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t *vha) · 18 unmodified lines
37443771 return;
37453772 }
37463773
3747− rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS);
3748− if (rval) {
3749− ql_log(ql_log_warn, vha, 0x00c2,
3750− "Unable to initialize EFT (%d).\n", rval);
3751− dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, tc_dma);
3752− return;
3753− }
3754−
37553774 ql_dbg(ql_dbg_init, vha, 0x00c3,
37563775 "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024);
37573776
@@ -3759,13 +3778,6 @@ qla2x00_init_eft_trace(scsi_qla_host_t *vha) · 1 unmodified line
37593778 ha->eft = tc;
37603779 }
37613780
3762−static void
3763−qla2x00_alloc_offload_mem(scsi_qla_host_t *vha)
3764−{
3765− qla2x00_init_fce_trace(vha);
3766− qla2x00_init_eft_trace(vha);
3767−}
3768−
37693781 void
37703782 qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
37713783 {
@@ -3820,10 +3832,10 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) · 48 unmodified lines
38203832 if (ha->tgt.atio_ring)
38213833 mq_size += ha->tgt.atio_q_length * sizeof(request_t);
38223834
3823− qla2x00_init_fce_trace(vha);
3835+ qla2x00_alloc_fce_trace(vha);
38243836 if (ha->fce)
38253837 fce_size = sizeof(struct qla2xxx_fce_chain) + FCE_SIZE;
3826− qla2x00_init_eft_trace(vha);
3838+ qla2x00_alloc_eft_trace(vha);
38273839 if (ha->eft)
38283840 eft_size = EFT_SIZE;
38293841 }
@@ -4253,7 +4265,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) · 423 unmodified lines
42534265 struct qla_hw_data *ha = vha->hw;
42544266 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
42554267 unsigned long flags;
4256− uint16_t fw_major_version;
42574268 int done_once = 0;
42584269
42594270 if (IS_P3P_TYPE(ha)) {
@@ -4320,7 +4331,6 @@ execute_fw_with_lr: · 60 unmodified lines
43204331 goto failed;
43214332
43224333 enable_82xx_npiv:
4323− fw_major_version = ha->fw_major_version;
43244334 if (IS_P3P_TYPE(ha))
43254335 qla82xx_check_md_needed(vha);
43264336 else
@@ -4349,12 +4359,11 @@ enable_82xx_npiv: · 22 unmodified lines
43494359 if (rval != QLA_SUCCESS)
43504360 goto failed;
43514361
4352− if (!fw_major_version && !(IS_P3P_TYPE(ha)))
4353− qla2x00_alloc_offload_mem(vha);
4354−
43554362 if (ql2xallocfwdump && !(IS_P3P_TYPE(ha)))
43564363 qla2x00_alloc_fw_dump(vha);
43574364
4365+ qla_enable_fce_trace(vha);
4366+ qla_enable_eft_trace(vha);
43584367 } else {
43594368 goto failed;
43604369 }
@@ -7487,12 +7496,12 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) · 3126 unmodified lines
74877496 int
74887497 qla2x00_abort_isp(scsi_qla_host_t *vha)
74897498 {
7490− int rval;
74917499 uint8_t status = 0;
74927500 struct qla_hw_data *ha = vha->hw;
74937501 struct scsi_qla_host *vp, *tvp;
74947502 struct req_que *req = ha->req_q_map[0];
74957503 unsigned long flags;
7504+ fc_port_t *fcport;
74967505
74977506 if (vha->flags.online) {
74987507 qla2x00_abort_isp_cleanup(vha);
@@ -7561,6 +7570,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) · 62 unmodified lines
75617570 "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n");
75627571 return status;
75637572 }
7573+
7574+ /* User may have updated [fcp|nvme] prefer in flash */
7575+ list_for_each_entry(fcport, &vha->vp_fcports, list) {
7576+ if (NVME_PRIORITY(ha, fcport))
7577+ fcport->do_prli_nvme = 1;
7578+ else
7579+ fcport->do_prli_nvme = 0;
7580+ }
7581+
75647582 if (!qla2x00_restart_isp(vha)) {
75657583 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
75667584
@@ -7581,31 +7599,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) · 14 unmodified lines
75817599
75827600 if (IS_QLA81XX(ha) || IS_QLA8031(ha))
75837601 qla2x00_get_fw_version(vha);
7584− if (ha->fce) {
7585− ha->flags.fce_enabled = 1;
7586− memset(ha->fce, 0,
7587− fce_calc_size(ha->fce_bufs));
7588− rval = qla2x00_enable_fce_trace(vha,
7589− ha->fce_dma, ha->fce_bufs, ha->fce_mb,
7590− &ha->fce_bufs);
7591− if (rval) {
7592− ql_log(ql_log_warn, vha, 0x8033,
7593− "Unable to reinitialize FCE "
7594− "(%d).\n", rval);
7595− ha->flags.fce_enabled = 0;
7596− }
7597− }
75987602
7599− if (ha->eft) {
7600− memset(ha->eft, 0, EFT_SIZE);
7601− rval = qla2x00_enable_eft_trace(vha,
7602− ha->eft_dma, EFT_NUM_BUFFERS);
7603− if (rval) {
7604− ql_log(ql_log_warn, vha, 0x8034,
7605− "Unable to reinitialize EFT "
7606− "(%d).\n", rval);
7607− }
7608− }
76097603 } else { /* failed the ISP abort */
76107604 vha->flags.online = 1;
76117605 if (test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
@@ -7655,6 +7649,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) · 43 unmodified lines
76557649 atomic_inc(&vp->vref_count);
76567650 spin_unlock_irqrestore(&ha->vport_slock, flags);
76577651
7652+ /* User may have updated [fcp|nvme] prefer in flash */
7653+ list_for_each_entry(fcport, &vp->vp_fcports, list) {
7654+ if (NVME_PRIORITY(ha, fcport))
7655+ fcport->do_prli_nvme = 1;
7656+ else
7657+ fcport->do_prli_nvme = 0;
7658+ }
7659+
76587660 qla2x00_vp_abort_isp(vp);
76597661
76607662 spin_lock_irqsave(&ha->vport_slock, flags);
drivers/scsi/qla2xxx/qla_iocb.c+44−24
@@ -2587,6 +2587,33 @@ void · 2586 unmodified lines
25872587 qla2x00_sp_release(struct kref *kref)
25882588 {
25892589 struct srb *sp = container_of(kref, struct srb, cmd_kref);
2590+ struct scsi_qla_host *vha = sp->vha;
2591+
2592+ switch (sp->type) {
2593+ case SRB_CT_PTHRU_CMD:
2594+ /* GPSC & GFPNID use fcport->ct_desc.ct_sns for both req & rsp */
2595+ if (sp->u.iocb_cmd.u.ctarg.req &&
2596+ (!sp->fcport ||
2597+ sp->u.iocb_cmd.u.ctarg.req != sp->fcport->ct_desc.ct_sns)) {
2598+ dma_free_coherent(&vha->hw->pdev->dev,
2599+ sp->u.iocb_cmd.u.ctarg.req_allocated_size,
2600+ sp->u.iocb_cmd.u.ctarg.req,
2601+ sp->u.iocb_cmd.u.ctarg.req_dma);
2602+ sp->u.iocb_cmd.u.ctarg.req = NULL;
2603+ }
2604+ if (sp->u.iocb_cmd.u.ctarg.rsp &&
2605+ (!sp->fcport ||
2606+ sp->u.iocb_cmd.u.ctarg.rsp != sp->fcport->ct_desc.ct_sns)) {
2607+ dma_free_coherent(&vha->hw->pdev->dev,
2608+ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size,
2609+ sp->u.iocb_cmd.u.ctarg.rsp,
2610+ sp->u.iocb_cmd.u.ctarg.rsp_dma);
2611+ sp->u.iocb_cmd.u.ctarg.rsp = NULL;
2612+ }
2613+ break;
2614+ default:
2615+ break;
2616+ }
25902617
25912618 sp->free(sp);
25922619 }
@@ -2610,7 +2637,8 @@ static void qla2x00_els_dcmd_sp_free(srb_t *sp) · 17 unmodified lines
26102637 {
26112638 struct srb_iocb *elsio = &sp->u.iocb_cmd;
26122639
2613− kfree(sp->fcport);
2640+ if (sp->fcport)
2641+ qla2x00_free_fcport(sp->fcport);
26142642
26152643 if (elsio->u.els_logo.els_logo_pyld)
26162644 dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE,
@@ -2692,7 +2720,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, · 75 unmodified lines
26922720 */
26932721 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
26942722 if (!sp) {
2695− kfree(fcport);
2723+ qla2x00_free_fcport(fcport);
26962724 ql_log(ql_log_info, vha, 0x70e6,
26972725 "SRB allocation failed\n");
26982726 return -ENOMEM;
@@ -2723,6 +2751,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, · 24 unmodified lines
27232751 if (!elsio->u.els_logo.els_logo_pyld) {
27242752 /* ref: INIT */
27252753 kref_put(&sp->cmd_kref, qla2x00_sp_release);
2754+ qla2x00_free_fcport(fcport);
27262755 return QLA_FUNCTION_FAILED;
27272756 }
27282757
@@ -2747,6 +2776,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vha, int els_opcode, · 18 unmodified lines
27472776 if (rval != QLA_SUCCESS) {
27482777 /* ref: INIT */
27492778 kref_put(&sp->cmd_kref, qla2x00_sp_release);
2779+ qla2x00_free_fcport(fcport);
27502780 return QLA_FUNCTION_FAILED;
27512781 }
27522782
@@ -3012,7 +3042,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) · 259 unmodified lines
30123042
30133043 int
30143044 qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3015− fc_port_t *fcport, bool wait)
3045+ fc_port_t *fcport)
30163046 {
30173047 srb_t *sp;
30183048 struct srb_iocb *elsio = NULL;
@@ -3027,8 +3057,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 8 unmodified lines
30273057 if (!sp) {
30283058 ql_log(ql_log_info, vha, 0x70e6,
30293059 "SRB allocation failed\n");
3030− fcport->flags &= ~FCF_ASYNC_ACTIVE;
3031− return -ENOMEM;
3060+ goto done;
30323061 }
30333062
30343063 fcport->flags |= FCF_ASYNC_SENT;
@@ -3037,9 +3066,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 2 unmodified lines
30373066 ql_dbg(ql_dbg_io, vha, 0x3073,
30383067 "%s Enter: PLOGI portid=%06x\n", __func__, fcport->d_id.b24);
30393068
3040− if (wait)
3041− sp->flags = SRB_WAKEUP_ON_COMP;
3042−
30433069 sp->type = SRB_ELS_DCMD;
30443070 sp->name = "ELS_DCMD";
30453071 sp->fcport = fcport;
@@ -3055,7 +3081,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 9 unmodified lines
30553081
30563082 if (!elsio->u.els_plogi.els_plogi_pyld) {
30573083 rval = QLA_FUNCTION_FAILED;
3058− goto out;
3084+ goto done_free_sp;
30593085 }
30603086
30613087 resp_ptr = elsio->u.els_plogi.els_resp_pyld =
@@ -3064,7 +3090,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 2 unmodified lines
30643090
30653091 if (!elsio->u.els_plogi.els_resp_pyld) {
30663092 rval = QLA_FUNCTION_FAILED;
3067− goto out;
3093+ goto done_free_sp;
30683094 }
30693095
30703096 ql_dbg(ql_dbg_io, vha, 0x3073, "PLOGI %p %p\n", ptr, resp_ptr);
@@ -3080,7 +3106,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 9 unmodified lines
30803106
30813107 if (els_opcode == ELS_DCMD_PLOGI && DBELL_ACTIVE(vha)) {
30823108 struct fc_els_flogi *p = ptr;
3083−
30843109 p->fl_csp.sp_features |= cpu_to_be16(FC_SP_FT_SEC);
30853110 }
30863111
@@ -3089,10 +3114,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 2 unmodified lines
30893114 (uint8_t *)elsio->u.els_plogi.els_plogi_pyld,
30903115 sizeof(*elsio->u.els_plogi.els_plogi_pyld));
30913116
3092− init_completion(&elsio->u.els_plogi.comp);
30933117 rval = qla2x00_start_sp(sp);
30943118 if (rval != QLA_SUCCESS) {
3095− rval = QLA_FUNCTION_FAILED;
3119+ fcport->flags |= FCF_LOGIN_NEEDED;
3120+ set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
3121+ goto done_free_sp;
30963122 } else {
30973123 ql_dbg(ql_dbg_disc, vha, 0x3074,
30983124 "%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n",
@@ -3100,21 +3126,15 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, · 1 unmodified line
31003126 fcport->d_id.b24, vha->d_id.b24);
31013127 }
31023128
3103− if (wait) {
3104− wait_for_completion(&elsio->u.els_plogi.comp);
3105−
3106− if (elsio->u.els_plogi.comp_status != CS_COMPLETE)
3107− rval = QLA_FUNCTION_FAILED;
3108− } else {
3109− goto done;
3110− }
3129+ return rval;
31113130
3112−out:
3113− fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
3131+done_free_sp:
31143132 qla2x00_els_dcmd2_free(vha, &elsio->u.els_plogi);
31153133 /* ref: INIT */
31163134 kref_put(&sp->cmd_kref, qla2x00_sp_release);
31173135 done:
3136+ fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
3137+ qla2x00_set_fcport_disc_state(fcport, DSC_DELETED);
31183138 return rval;
31193139 }
31203140
@@ -3918,7 +3938,7 @@ qla2x00_start_sp(srb_t *sp) · 797 unmodified lines
39183938 return -EAGAIN;
39193939 }
39203940
3921− pkt = __qla2x00_alloc_iocbs(sp->qpair, sp);
3941+ pkt = qla2x00_alloc_iocbs_ready(sp->qpair, sp);
39223942 if (!pkt) {
39233943 rval = -EAGAIN;
39243944 ql_log(ql_log_warn, vha, 0x700c,
drivers/scsi/qla2xxx/qla_mbx.c+1−1
@@ -194,7 +194,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) · 193 unmodified lines
194194 if (ha->flags.purge_mbox || chip_reset != ha->chip_reset ||
195195 ha->flags.eeh_busy) {
196196 ql_log(ql_log_warn, vha, 0xd035,
197− "Error detected: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n",
197+ "Purge mbox: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n",
198198 ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0]);
199199 rval = QLA_ABORTED;
200200 goto premature_exit;
drivers/scsi/qla2xxx/qla_os.c+2−1
@@ -4602,6 +4602,7 @@ fail_free_init_cb: · 4601 unmodified lines
46024602 ha->init_cb_dma = 0;
46034603 fail_free_vp_map:
46044604 kfree(ha->vp_map);
4605+ ha->vp_map = NULL;
46054606 fail:
46064607 ql_log(ql_log_fatal, NULL, 0x0030,
46074608 "Memory allocation failure.\n");
@@ -5583,7 +5584,7 @@ qla2x00_do_work(struct scsi_qla_host *vha) · 975 unmodified lines
55835584 break;
55845585 case QLA_EVT_ELS_PLOGI:
55855586 qla24xx_els_dcmd2_iocb(vha, ELS_DCMD_PLOGI,
5586− e->u.fcport.fcport, false);
5587+ e->u.fcport.fcport);
55875588 break;
55885589 case QLA_EVT_SA_REPLACE:
55895590 rc = qla24xx_issue_sa_replace_iocb(vha, e);
drivers/scsi/qla2xxx/qla_target.c+10−0
@@ -1062,6 +1062,16 @@ void qlt_free_session_done(struct work_struct *work) · 1061 unmodified lines
10621062 "%s: sess %p logout completed\n", __func__, sess);
10631063 }
10641064
1065+ /* check for any straggling io left behind */
1066+ if (!(sess->flags & FCF_FCP2_DEVICE) &&
1067+ qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) {
1068+ ql_log(ql_log_warn, vha, 0x3027,
1069+ "IO not return. Resetting.\n");
1070+ set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
1071+ qla2xxx_wake_dpc(vha);
1072+ qla2x00_wait_for_chip_reset(vha);
1073+ }
1074+
10651075 if (sess->logo_ack_needed) {
10661076 sess->logo_ack_needed = 0;
10671077 qla24xx_async_notify_ack(vha, sess,
drivers/scsi/qla2xxx/qla_version.h+2−2
@@ -6,9 +6,9 @@ · 5 unmodified lines
66 /*
77 * Driver version
88 */
9−#define QLA2XXX_VERSION "10.02.09.100-k"
9+#define QLA2XXX_VERSION "10.02.09.200-k"
1010
1111 #define QLA_DRIVER_MAJOR_VER 10
1212 #define QLA_DRIVER_MINOR_VER 2
1313 #define QLA_DRIVER_PATCH_VER 9
14−#define QLA_DRIVER_BETA_VER 100
14+#define QLA_DRIVER_BETA_VER 200
drivers/scsi/scsi_scan.c+34−0
@@ -1642,6 +1642,40 @@ int scsi_add_device(struct Scsi_Host *host, uint channel, · 1641 unmodified lines
16421642 }
16431643 EXPORT_SYMBOL(scsi_add_device);
16441644
1645+int scsi_resume_device(struct scsi_device *sdev)
1646+{
1647+ struct device *dev = &sdev->sdev_gendev;
1648+ int ret = 0;
1649+
1650+ device_lock(dev);
1651+
1652+ /*
1653+ * Bail out if the device or its queue are not running. Otherwise,
1654+ * the rescan may block waiting for commands to be executed, with us
1655+ * holding the device lock. This can result in a potential deadlock
1656+ * in the power management core code when system resume is on-going.
1657+ */
1658+ if (sdev->sdev_state != SDEV_RUNNING ||
1659+ blk_queue_pm_only(sdev->request_queue)) {
1660+ ret = -EWOULDBLOCK;
1661+ goto unlock;
1662+ }
1663+
1664+ if (dev->driver && try_module_get(dev->driver->owner)) {
1665+ struct scsi_driver *drv = to_scsi_driver(dev->driver);
1666+
1667+ if (drv->resume)
1668+ ret = drv->resume(dev);
1669+ module_put(dev->driver->owner);
1670+ }
1671+
1672+unlock:
1673+ device_unlock(dev);
1674+
1675+ return ret;
1676+}
1677+EXPORT_SYMBOL(scsi_resume_device);
1678+
16451679 int scsi_rescan_device(struct scsi_device *sdev)
16461680 {
16471681 struct device *dev = &sdev->sdev_gendev;
drivers/scsi/sd.c+19−4
@@ -4108,7 +4108,21 @@ static int sd_suspend_runtime(struct device *dev) · 4107 unmodified lines
41084108 return sd_suspend_common(dev, true);
41094109 }
41104110
4111−static int sd_resume(struct device *dev, bool runtime)
4111+static int sd_resume(struct device *dev)
4112+{
4113+ struct scsi_disk *sdkp = dev_get_drvdata(dev);
4114+
4115+ sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
4116+
4117+ if (opal_unlock_from_suspend(sdkp->opal_dev)) {
4118+ sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n");
4119+ return -EIO;
4120+ }
4121+
4122+ return 0;
4123+}
4124+
4125+static int sd_resume_common(struct device *dev, bool runtime)
41124126 {
41134127 struct scsi_disk *sdkp = dev_get_drvdata(dev);
41144128 int ret;
@@ -4124,7 +4138,7 @@ static int sd_resume(struct device *dev, bool runtime) · 9 unmodified lines
41244138 sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
41254139 ret = sd_start_stop_device(sdkp, 1);
41264140 if (!ret) {
4127− opal_unlock_from_suspend(sdkp->opal_dev);
4141+ sd_resume(dev);
41284142 sdkp->suspended = false;
41294143 }
41304144
@@ -4143,7 +4157,7 @@ static int sd_resume_system(struct device *dev) · 12 unmodified lines
41434157 return 0;
41444158 }
41454159
4146− return sd_resume(dev, false);
4160+ return sd_resume_common(dev, false);
41474161 }
41484162
41494163 static int sd_resume_runtime(struct device *dev)
@@ -4170,7 +4184,7 @@ static int sd_resume_runtime(struct device *dev) · 20 unmodified lines
41704184 "Failed to clear sense data\n");
41714185 }
41724186
4173− return sd_resume(dev, true);
4187+ return sd_resume_common(dev, true);
41744188 }
41754189
41764190 static const struct dev_pm_ops sd_pm_ops = {
@@ -4193,6 +4207,7 @@ static struct scsi_driver sd_template = { · 16 unmodified lines
41934207 .pm = &sd_pm_ops,
41944208 },
41954209 .rescan = sd_rescan,
4210+ .resume = sd_resume,
41964211 .init_command = sd_init_command,
41974212 .uninit_command = sd_uninit_command,
41984213 .done = sd_done,
drivers/scsi/sg.c+12−10
@@ -1424,7 +1424,9 @@ static const struct file_operations sg_fops = { · 1423 unmodified lines
14241424 .llseek = no_llseek,
14251425 };
14261426
1427−static struct class *sg_sysfs_class;
1427+static const struct class sg_sysfs_class = {
1428+ .name = "scsi_generic"
1429+};
14281430
14291431 static int sg_sysfs_valid = 0;
14301432
@@ -1526,7 +1528,7 @@ sg_add_device(struct device *cl_dev) · 95 unmodified lines
15261528 if (sg_sysfs_valid) {
15271529 struct device *sg_class_member;
15281530
1529− sg_class_member = device_create(sg_sysfs_class, cl_dev->parent,
1531+ sg_class_member = device_create(&sg_sysfs_class, cl_dev->parent,
15301532 MKDEV(SCSI_GENERIC_MAJOR,
15311533 sdp->index),
15321534 sdp, "%s", sdp->name);
@@ -1616,7 +1618,7 @@ sg_remove_device(struct device *cl_dev) · 83 unmodified lines
16161618 read_unlock_irqrestore(&sdp->sfd_lock, iflags);
16171619
16181620 sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
1619− device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, sdp->index));
1621+ device_destroy(&sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, sdp->index));
16201622 cdev_del(sdp->cdev);
16211623 sdp->cdev = NULL;
16221624
@@ -1687,11 +1689,9 @@ init_sg(void) · 64 unmodified lines
16871689 SG_MAX_DEVS, "sg");
16881690 if (rc)
16891691 return rc;
1690− sg_sysfs_class = class_create("scsi_generic");
1691− if ( IS_ERR(sg_sysfs_class) ) {
1692− rc = PTR_ERR(sg_sysfs_class);
1692+ rc = class_register(&sg_sysfs_class);
1693+ if (rc)
16931694 goto err_out;
1694− }
16951695 sg_sysfs_valid = 1;
16961696 rc = scsi_register_interface(&sg_interface);
16971697 if (0 == rc) {
@@ -1700,7 +1700,7 @@ init_sg(void) · 2 unmodified lines
17001700 #endif /* CONFIG_SCSI_PROC_FS */
17011701 return 0;
17021702 }
1703− class_destroy(sg_sysfs_class);
1703+ class_unregister(&sg_sysfs_class);
17041704 register_sg_sysctls();
17051705 err_out:
17061706 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);
@@ -1715,7 +1715,7 @@ exit_sg(void) · 8 unmodified lines
17151715 remove_proc_subtree("scsi/sg", NULL);
17161716 #endif /* CONFIG_SCSI_PROC_FS */
17171717 scsi_unregister_interface(&sg_interface);
1718− class_destroy(sg_sysfs_class);
1718+ class_unregister(&sg_sysfs_class);
17191719 sg_sysfs_valid = 0;
17201720 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
17211721 SG_MAX_DEVS);
@@ -2207,6 +2207,7 @@ sg_remove_sfp_usercontext(struct work_struct *work) · 485 unmodified lines
22072207 {
22082208 struct sg_fd *sfp = container_of(work, struct sg_fd, ew.work);
22092209 struct sg_device *sdp = sfp->parentdp;
2210+ struct scsi_device *device = sdp->device;
22102211 Sg_request *srp;
22112212 unsigned long iflags;
22122213
@@ -2232,8 +2233,9 @@ sg_remove_sfp_usercontext(struct work_struct *work) · 19 unmodified lines
22322233 "sg_remove_sfp: sfp=0x%p\n", sfp));
22332234 kfree(sfp);
22342235
2235− scsi_device_put(sdp->device);
2236+ WARN_ON_ONCE(kref_read(&sdp->d_ref) != 1);
22362237 kref_put(&sdp->d_ref, sg_device_destroy);
2238+ scsi_device_put(device);
22372239 module_put(THIS_MODULE);
22382240 }
22392241
drivers/scsi/st.c+2−2
@@ -87,7 +87,7 @@ static int try_rdio = 1; · 86 unmodified lines
8787 static int try_wdio = 1;
8888 static int debug_flag;
8989
90−static struct class st_sysfs_class;
90+static const struct class st_sysfs_class;
9191 static const struct attribute_group *st_dev_groups[];
9292 static const struct attribute_group *st_drv_groups[];
9393
@@ -4438,7 +4438,7 @@ static void scsi_tape_release(struct kref *kref) · 4344 unmodified lines
44384438 return;
44394439 }
44404440
4441−static struct class st_sysfs_class = {
4441+static const struct class st_sysfs_class = {
44424442 .name = "scsi_tape",
44434443 .dev_groups = st_dev_groups,
44444444 };
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c+3−2
@@ -937,8 +937,9 @@ static int create_component(struct vchiq_mmal_instance *instance, · 936 unmodified lines
937937 /* build component create message */
938938 m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE;
939939 m.u.component_create.client_component = component->client_component;
940− strncpy(m.u.component_create.name, name,
941− sizeof(m.u.component_create.name));
940+ strscpy_pad(m.u.component_create.name, name,
941+ sizeof(m.u.component_create.name));
942+ m.u.component_create.pid = 0;
942943
943944 ret = send_synchronous_mmal_msg(instance, &m,
944945 sizeof(m.u.component_create),
drivers/target/iscsi/iscsi_target_erl1.c+1−2
@@ -583,7 +583,7 @@ int iscsit_dataout_datapduinorder_no_fbit( · 582 unmodified lines
583583 struct iscsi_pdu *pdu)
584584 {
585585 int i, send_recovery_r2t = 0, recovery = 0;
586− u32 length = 0, offset = 0, pdu_count = 0, xfer_len = 0;
586+ u32 length = 0, offset = 0, pdu_count = 0;
587587 struct iscsit_conn *conn = cmd->conn;
588588 struct iscsi_pdu *first_pdu = NULL;
589589
@@ -596,7 +596,6 @@ int iscsit_dataout_datapduinorder_no_fbit( · 6 unmodified lines
596596 if (cmd->pdu_list[i].seq_no == pdu->seq_no) {
597597 if (!first_pdu)
598598 first_pdu = &cmd->pdu_list[i];
599− xfer_len += cmd->pdu_list[i].length;
600599 pdu_count++;
601600 } else if (pdu_count)
602601 break;
drivers/thermal/devfreq_cooling.c+1−1
@@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd · 213 unmodified lines
214214
215215 res = dfc->power_ops->get_real_power(df, power, freq, voltage);
216216 if (!res) {
217− state = dfc->capped_state;
217+ state = dfc->max_state - dfc->capped_state;
218218
219219 /* Convert EM power into milli-Watts first */
220220 rcu_read_lock();
drivers/thermal/thermal_trip.c+2−17
@@ -65,7 +65,6 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz) · 64 unmodified lines
6565 {
6666 const struct thermal_trip *trip;
6767 int low = -INT_MAX, high = INT_MAX;
68− bool same_trip = false;
6968 int ret;
7069
7170 lockdep_assert_held(&tz->lock);
@@ -74,36 +73,22 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz) · 2 unmodified lines
7473 return;
7574
7675 for_each_trip(tz, trip) {
77− bool low_set = false;
7876 int trip_low;
7977
8078 trip_low = trip->temperature - trip->hysteresis;
8179
82− if (trip_low < tz->temperature && trip_low > low) {
80+ if (trip_low < tz->temperature && trip_low > low)
8381 low = trip_low;
84− low_set = true;
85− same_trip = false;
86− }
8782
8883 if (trip->temperature > tz->temperature &&
89− trip->temperature < high) {
84+ trip->temperature < high)
9085 high = trip->temperature;
91− same_trip = low_set;
92− }
9386 }
9487
9588 /* No need to change trip points */
9689 if (tz->prev_low_trip == low && tz->prev_high_trip == high)
9790 return;
9891
99− /*
100− * If "high" and "low" are the same, skip the change unless this is the
101− * first time.
102− */
103− if (same_trip && (tz->prev_low_trip != -INT_MAX ||
104− tz->prev_high_trip != INT_MAX))
105− return;
106−
10792 tz->prev_low_trip = low;
10893 tz->prev_high_trip = high;
10994
drivers/ufs/core/ufs-mcq.c+1−1
@@ -94,7 +94,7 @@ void ufshcd_mcq_config_mac(struct ufs_hba *hba, u32 max_active_cmds) · 93 unmodified lines
9494
9595 val = ufshcd_readl(hba, REG_UFS_MCQ_CFG);
9696 val &= ~MCQ_CFG_MAC_MASK;
97− val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds);
97+ val |= FIELD_PREP(MCQ_CFG_MAC_MASK, max_active_cmds - 1);
9898 ufshcd_writel(hba, val, REG_UFS_MCQ_CFG);
9999 }
100100 EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac);
drivers/ufs/host/ufs-qcom.c+4−2
@@ -1210,8 +1210,10 @@ static int ufs_qcom_set_core_clk_ctrl(struct ufs_hba *hba, bool is_scale_up) · 1209 unmodified lines
12101210
12111211 list_for_each_entry(clki, head, list) {
12121212 if (!IS_ERR_OR_NULL(clki->clk) &&
1213− !strcmp(clki->name, "core_clk_unipro")) {
1214− if (is_scale_up)
1213+ !strcmp(clki->name, "core_clk_unipro")) {
1214+ if (!clki->max_freq)
1215+ cycles_in_1us = 150; /* default for backwards compatibility */
1216+ else if (is_scale_up)
12151217 cycles_in_1us = ceil(clki->max_freq, (1000 * 1000));
12161218 else
12171219 cycles_in_1us = ceil(clk_get_rate(clki->clk), (1000 * 1000));
drivers/uio/uio.c+1−1
@@ -792,7 +792,7 @@ static int uio_mmap_dma_coherent(struct vm_area_struct *vma) · 791 unmodified lines
792792 */
793793 vma->vm_pgoff = 0;
794794
795− addr = (void *)mem->addr;
795+ addr = (void *)(uintptr_t)mem->addr;
796796 ret = dma_mmap_coherent(mem->dma_device,
797797 vma,
798798 addr,
drivers/uio/uio_dmem_genirq.c+2−2
@@ -60,7 +60,7 @@ static int uio_dmem_genirq_open(struct uio_info *info, struct inode *inode) · 59 unmodified lines
6060
6161 addr = dma_alloc_coherent(&priv->pdev->dev, uiomem->size,
6262 &uiomem->dma_addr, GFP_KERNEL);
63− uiomem->addr = addr ? (phys_addr_t) addr : DMEM_MAP_ERROR;
63+ uiomem->addr = addr ? (uintptr_t) addr : DMEM_MAP_ERROR;
6464 ++uiomem;
6565 }
6666 priv->refcnt++;
@@ -89,7 +89,7 @@ static int uio_dmem_genirq_release(struct uio_info *info, struct inode *inode) · 22 unmodified lines
8989 break;
9090 if (uiomem->addr) {
9191 dma_free_coherent(uiomem->dma_device, uiomem->size,
92− (void *) uiomem->addr,
92+ (void *) (uintptr_t) uiomem->addr,
9393 uiomem->dma_addr);
9494 }
9595 uiomem->addr = DMEM_MAP_ERROR;
drivers/uio/uio_pruss.c+1−1
@@ -191,7 +191,7 @@ static int pruss_probe(struct platform_device *pdev) · 190 unmodified lines
191191 p->mem[1].size = sram_pool_sz;
192192 p->mem[1].memtype = UIO_MEM_PHYS;
193193
194− p->mem[2].addr = (phys_addr_t) gdev->ddr_vaddr;
194+ p->mem[2].addr = (uintptr_t) gdev->ddr_vaddr;
195195 p->mem[2].dma_addr = gdev->ddr_paddr;
196196 p->mem[2].size = extram_pool_sz;
197197 p->mem[2].memtype = UIO_MEM_DMA_COHERENT;
drivers/usb/class/cdc-wdm.c+5−1
@@ -485,6 +485,7 @@ out_free_mem: · 484 unmodified lines
485485 static int service_outstanding_interrupt(struct wdm_device *desc)
486486 {
487487 int rv = 0;
488+ int used;
488489
489490 /* submit read urb only if the device is waiting for it */
490491 if (!desc->resp_count || !--desc->resp_count)
@@ -499,7 +500,10 @@ static int service_outstanding_interrupt(struct wdm_device *desc) · 8 unmodified lines
499500 goto out;
500501 }
501502
502− set_bit(WDM_RESPONDING, &desc->flags);
503+ used = test_and_set_bit(WDM_RESPONDING, &desc->flags);
504+ if (used)
505+ goto out;
506+
503507 spin_unlock_irq(&desc->iuspin);
504508 rv = usb_submit_urb(desc->response, GFP_KERNEL);
505509 spin_lock_irq(&desc->iuspin);
drivers/usb/core/hub.c+16−7
@@ -130,7 +130,6 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem); · 129 unmodified lines
130130 #define HUB_DEBOUNCE_STEP 25
131131 #define HUB_DEBOUNCE_STABLE 100
132132
133−static void hub_release(struct kref *kref);
134133 static int usb_reset_and_verify_device(struct usb_device *udev);
135134 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state);
136135 static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1,
@@ -720,14 +719,14 @@ static void kick_hub_wq(struct usb_hub *hub) · 583 unmodified lines
720719 */
721720 intf = to_usb_interface(hub->intfdev);
722721 usb_autopm_get_interface_no_resume(intf);
723− kref_get(&hub->kref);
722+ hub_get(hub);
724723
725724 if (queue_work(hub_wq, &hub->events))
726725 return;
727726
728727 /* the work has already been scheduled */
729728 usb_autopm_put_interface_async(intf);
730− kref_put(&hub->kref, hub_release);
729+ hub_put(hub);
731730 }
732731
733732 void usb_kick_hub_wq(struct usb_device *hdev)
@@ -1095,7 +1094,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 361 unmodified lines
10951094 goto init2;
10961095 goto init3;
10971096 }
1098− kref_get(&hub->kref);
1097+ hub_get(hub);
10991098
11001099 /* The superspeed hub except for root hub has to use Hub Depth
11011100 * value as an offset into the route string to locate the bits
@@ -1343,7 +1342,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 241 unmodified lines
13431342 device_unlock(&hdev->dev);
13441343 }
13451344
1346− kref_put(&hub->kref, hub_release);
1345+ hub_put(hub);
13471346 }
13481347
13491348 /* Implement the continuations for the delays above */
@@ -1759,6 +1758,16 @@ static void hub_release(struct kref *kref) · 409 unmodified lines
17591758 kfree(hub);
17601759 }
17611760
1761+void hub_get(struct usb_hub *hub)
1762+{
1763+ kref_get(&hub->kref);
1764+}
1765+
1766+void hub_put(struct usb_hub *hub)
1767+{
1768+ kref_put(&hub->kref, hub_release);
1769+}
1770+
17621771 static unsigned highspeed_hubs;
17631772
17641773 static void hub_disconnect(struct usb_interface *intf)
@@ -1807,7 +1816,7 @@ static void hub_disconnect(struct usb_interface *intf) · 42 unmodified lines
18071816
18081817 onboard_hub_destroy_pdevs(&hub->onboard_hub_devs);
18091818
1810− kref_put(&hub->kref, hub_release);
1819+ hub_put(hub);
18111820 }
18121821
18131822 static bool hub_descriptor_is_sane(struct usb_host_interface *desc)
@@ -5934,7 +5943,7 @@ out_hdev_lock: · 4120 unmodified lines
59345943
59355944 /* Balance the stuff in kick_hub_wq() and allow autosuspend */
59365945 usb_autopm_put_interface(intf);
5937− kref_put(&hub->kref, hub_release);
5946+ hub_put(hub);
59385947
59395948 kcov_remote_stop();
59405949 }
drivers/usb/core/hub.h+2−0
@@ -129,6 +129,8 @@ extern void usb_hub_remove_port_device(struct usb_hub *hub, · 128 unmodified lines
129129 extern int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub,
130130 int port1, bool set);
131131 extern struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev);
132+extern void hub_get(struct usb_hub *hub);
133+extern void hub_put(struct usb_hub *hub);
132134 extern int hub_port_debounce(struct usb_hub *hub, int port1,
133135 bool must_be_connected);
134136 extern int usb_clear_port_feature(struct usb_device *hdev,
drivers/usb/core/port.c+34−4
@@ -56,11 +56,22 @@ static ssize_t disable_show(struct device *dev, · 55 unmodified lines
5656 u16 portstatus, unused;
5757 bool disabled;
5858 int rc;
59+ struct kernfs_node *kn;
5960
61+ hub_get(hub);
6062 rc = usb_autopm_get_interface(intf);
6163 if (rc < 0)
62− return rc;
64+ goto out_hub_get;
6365
66+ /*
67+ * Prevent deadlock if another process is concurrently
68+ * trying to unregister hdev.
69+ */
70+ kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
71+ if (!kn) {
72+ rc = -ENODEV;
73+ goto out_autopm;
74+ }
6475 usb_lock_device(hdev);
6576 if (hub->disconnected) {
6677 rc = -ENODEV;
@@ -70,9 +81,13 @@ static ssize_t disable_show(struct device *dev, · 3 unmodified lines
7081 usb_hub_port_status(hub, port1, &portstatus, &unused);
7182 disabled = !usb_port_is_power_on(hub, portstatus);
7283
73−out_hdev_lock:
84+ out_hdev_lock:
7485 usb_unlock_device(hdev);
86+ sysfs_unbreak_active_protection(kn);
87+ out_autopm:
7588 usb_autopm_put_interface(intf);
89+ out_hub_get:
90+ hub_put(hub);
7691
7792 if (rc)
7893 return rc;
@@ -90,15 +105,26 @@ static ssize_t disable_store(struct device *dev, struct device_attribute *attr, · 11 unmodified lines
90105 int port1 = port_dev->portnum;
91106 bool disabled;
92107 int rc;
108+ struct kernfs_node *kn;
93109
94110 rc = kstrtobool(buf, &disabled);
95111 if (rc)
96112 return rc;
97113
114+ hub_get(hub);
98115 rc = usb_autopm_get_interface(intf);
99116 if (rc < 0)
100− return rc;
117+ goto out_hub_get;
101118
119+ /*
120+ * Prevent deadlock if another process is concurrently
121+ * trying to unregister hdev.
122+ */
123+ kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
124+ if (!kn) {
125+ rc = -ENODEV;
126+ goto out_autopm;
127+ }
102128 usb_lock_device(hdev);
103129 if (hub->disconnected) {
104130 rc = -ENODEV;
@@ -119,9 +145,13 @@ static ssize_t disable_store(struct device *dev, struct device_attribute *attr, · 14 unmodified lines
119145 if (!rc)
120146 rc = count;
121147
122−out_hdev_lock:
148+ out_hdev_lock:
123149 usb_unlock_device(hdev);
150+ sysfs_unbreak_active_protection(kn);
151+ out_autopm:
124152 usb_autopm_put_interface(intf);
153+ out_hub_get:
154+ hub_put(hub);
125155
126156 return rc;
127157 }
drivers/usb/core/sysfs.c+13−3
@@ -1217,14 +1217,24 @@ static ssize_t interface_authorized_store(struct device *dev, · 1216 unmodified lines
12171217 {
12181218 struct usb_interface *intf = to_usb_interface(dev);
12191219 bool val;
1220+ struct kernfs_node *kn;
12201221
12211222 if (kstrtobool(buf, &val) != 0)
12221223 return -EINVAL;
12231224
1224− if (val)
1225+ if (val) {
12251226 usb_authorize_interface(intf);
1226− else
1227− usb_deauthorize_interface(intf);
1227+ } else {
1228+ /*
1229+ * Prevent deadlock if another process is concurrently
1230+ * trying to unregister intf.
1231+ */
1232+ kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
1233+ if (kn) {
1234+ usb_deauthorize_interface(intf);
1235+ sysfs_unbreak_active_protection(kn);
1236+ }
1237+ }
12281238
12291239 return count;
12301240 }
drivers/usb/dwc2/core.h+14−0
@@ -729,8 +729,14 @@ struct dwc2_dregs_backup { · 728 unmodified lines
729729 * struct dwc2_hregs_backup - Holds host registers state before
730730 * entering partial power down
731731 * @hcfg: Backup of HCFG register
732+ * @hflbaddr: Backup of HFLBADDR register
732733 * @haintmsk: Backup of HAINTMSK register
734+ * @hcchar: Backup of HCCHAR register
735+ * @hcsplt: Backup of HCSPLT register
733736 * @hcintmsk: Backup of HCINTMSK register
737+ * @hctsiz: Backup of HCTSIZ register
738+ * @hdma: Backup of HCDMA register
739+ * @hcdmab: Backup of HCDMAB register
734740 * @hprt0: Backup of HPTR0 register
735741 * @hfir: Backup of HFIR register
736742 * @hptxfsiz: Backup of HPTXFSIZ register
@@ -738,8 +744,14 @@ struct dwc2_dregs_backup { · 1 unmodified line
738744 */
739745 struct dwc2_hregs_backup {
740746 u32 hcfg;
747+ u32 hflbaddr;
741748 u32 haintmsk;
749+ u32 hcchar[MAX_EPS_CHANNELS];
750+ u32 hcsplt[MAX_EPS_CHANNELS];
742751 u32 hcintmsk[MAX_EPS_CHANNELS];
752+ u32 hctsiz[MAX_EPS_CHANNELS];
753+ u32 hcidma[MAX_EPS_CHANNELS];
754+ u32 hcidmab[MAX_EPS_CHANNELS];
743755 u32 hprt0;
744756 u32 hfir;
745757 u32 hptxfsiz;
@@ -1086,6 +1098,7 @@ struct dwc2_hsotg { · 340 unmodified lines
10861098 bool needs_byte_swap;
10871099
10881100 /* DWC OTG HW Release versions */
1101+#define DWC2_CORE_REV_4_30a 0x4f54430a
10891102 #define DWC2_CORE_REV_2_71a 0x4f54271a
10901103 #define DWC2_CORE_REV_2_72a 0x4f54272a
10911104 #define DWC2_CORE_REV_2_80a 0x4f54280a
@@ -1323,6 +1336,7 @@ int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg); · 231 unmodified lines
13231336 int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg);
13241337
13251338 void dwc2_enable_acg(struct dwc2_hsotg *hsotg);
1339+void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg, bool remotewakeup);
13261340
13271341 /* This function should be called on every hardware interrupt. */
13281342 irqreturn_t dwc2_handle_common_intr(int irq, void *dev);
drivers/usb/dwc2/core_intr.c+48−24
@@ -297,7 +297,8 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) · 296 unmodified lines
297297
298298 /* Exit gadget mode clock gating. */
299299 if (hsotg->params.power_down ==
300− DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended)
300+ DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended &&
301+ !hsotg->params.no_clock_gating)
301302 dwc2_gadget_exit_clock_gating(hsotg, 0);
302303 }
303304
@@ -322,10 +323,11 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg) · 18 unmodified lines
322323 * @hsotg: Programming view of DWC_otg controller
323324 *
324325 */
325−static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg)
326+void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg, bool remotewakeup)
326327 {
327328 u32 glpmcfg;
328− u32 i = 0;
329+ u32 pcgctl;
330+ u32 dctl;
329331
330332 if (hsotg->lx_state != DWC2_L1) {
331333 dev_err(hsotg->dev, "Core isn't in DWC2_L1 state\n");
@@ -334,37 +336,57 @@ static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg) · 2 unmodified lines
334336
335337 glpmcfg = dwc2_readl(hsotg, GLPMCFG);
336338 if (dwc2_is_device_mode(hsotg)) {
337− dev_dbg(hsotg->dev, "Exit from L1 state\n");
339+ dev_dbg(hsotg->dev, "Exit from L1 state, remotewakeup=%d\n", remotewakeup);
338340 glpmcfg &= ~GLPMCFG_ENBLSLPM;
339− glpmcfg &= ~GLPMCFG_HIRD_THRES_EN;
341+ glpmcfg &= ~GLPMCFG_HIRD_THRES_MASK;
340342 dwc2_writel(hsotg, glpmcfg, GLPMCFG);
341343
342− do {
343− glpmcfg = dwc2_readl(hsotg, GLPMCFG);
344+ pcgctl = dwc2_readl(hsotg, PCGCTL);
345+ pcgctl &= ~PCGCTL_ENBL_SLEEP_GATING;
346+ dwc2_writel(hsotg, pcgctl, PCGCTL);
344347
345− if (!(glpmcfg & (GLPMCFG_COREL1RES_MASK |
346− GLPMCFG_L1RESUMEOK | GLPMCFG_SLPSTS)))
347− break;
348+ glpmcfg = dwc2_readl(hsotg, GLPMCFG);
349+ if (glpmcfg & GLPMCFG_ENBESL) {
350+ glpmcfg |= GLPMCFG_RSTRSLPSTS;
351+ dwc2_writel(hsotg, glpmcfg, GLPMCFG);
352+ }
353+
354+ if (remotewakeup) {
355+ if (dwc2_hsotg_wait_bit_set(hsotg, GLPMCFG, GLPMCFG_L1RESUMEOK, 1000)) {
356+ dev_warn(hsotg->dev, "%s: timeout GLPMCFG_L1RESUMEOK\n", __func__);
357+ goto fail;
358+ return;
359+ }
360+
361+ dctl = dwc2_readl(hsotg, DCTL);
362+ dctl |= DCTL_RMTWKUPSIG;
363+ dwc2_writel(hsotg, dctl, DCTL);
348364
349− udelay(1);
350− } while (++i < 200);
365+ if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS, GINTSTS_WKUPINT, 1000)) {
366+ dev_warn(hsotg->dev, "%s: timeout GINTSTS_WKUPINT\n", __func__);
367+ goto fail;
368+ return;
369+ }
370+ }
351371
352− if (i == 200) {
353− dev_err(hsotg->dev, "Failed to exit L1 sleep state in 200us.\n");
372+ glpmcfg = dwc2_readl(hsotg, GLPMCFG);
373+ if (glpmcfg & GLPMCFG_COREL1RES_MASK || glpmcfg & GLPMCFG_SLPSTS ||
374+ glpmcfg & GLPMCFG_L1RESUMEOK) {
375+ goto fail;
354376 return;
355377 }
356− dwc2_gadget_init_lpm(hsotg);
378+
379+ /* Inform gadget to exit from L1 */
380+ call_gadget(hsotg, resume);
381+ /* Change to L0 state */
382+ hsotg->lx_state = DWC2_L0;
383+ hsotg->bus_suspended = false;
384+fail: dwc2_gadget_init_lpm(hsotg);
357385 } else {
358386 /* TODO */
359387 dev_err(hsotg->dev, "Host side LPM is not supported.\n");
360388 return;
361389 }
362−
363− /* Change to L0 state */
364− hsotg->lx_state = DWC2_L0;
365−
366− /* Inform gadget to exit from L1 */
367− call_gadget(hsotg, resume);
368390 }
369391
370392 /*
@@ -385,7 +407,7 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) · 14 unmodified lines
385407 dev_dbg(hsotg->dev, "%s lxstate = %d\n", __func__, hsotg->lx_state);
386408
387409 if (hsotg->lx_state == DWC2_L1) {
388− dwc2_wakeup_from_lpm_l1(hsotg);
410+ dwc2_wakeup_from_lpm_l1(hsotg, false);
389411 return;
390412 }
391413
@@ -408,7 +430,8 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) · 16 unmodified lines
408430
409431 /* Exit gadget mode clock gating. */
410432 if (hsotg->params.power_down ==
411− DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended)
433+ DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended &&
434+ !hsotg->params.no_clock_gating)
412435 dwc2_gadget_exit_clock_gating(hsotg, 0);
413436 } else {
414437 /* Change to L0 state */
@@ -425,7 +448,8 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) · 10 unmodified lines
425448 }
426449
427450 if (hsotg->params.power_down ==
428− DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended)
451+ DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended &&
452+ !hsotg->params.no_clock_gating)
429453 dwc2_host_exit_clock_gating(hsotg, 1);
430454
431455 /*
drivers/usb/dwc2/gadget.c+10−0
@@ -1415,6 +1415,10 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req, · 1414 unmodified lines
14151415 ep->name, req, req->length, req->buf, req->no_interrupt,
14161416 req->zero, req->short_not_ok);
14171417
1418+ if (hs->lx_state == DWC2_L1) {
1419+ dwc2_wakeup_from_lpm_l1(hs, true);
1420+ }
1421+
14181422 /* Prevent new request submission when controller is suspended */
14191423 if (hs->lx_state != DWC2_L0) {
14201424 dev_dbg(hs->dev, "%s: submit request only in active state\n",
@@ -3727,6 +3731,12 @@ irq_retry: · 2306 unmodified lines
37273731 if (hsotg->in_ppd && hsotg->lx_state == DWC2_L2)
37283732 dwc2_exit_partial_power_down(hsotg, 0, true);
37293733
3734+ /* Exit gadget mode clock gating. */
3735+ if (hsotg->params.power_down ==
3736+ DWC2_POWER_DOWN_PARAM_NONE && hsotg->bus_suspended &&
3737+ !hsotg->params.no_clock_gating)
3738+ dwc2_gadget_exit_clock_gating(hsotg, 0);
3739+
37303740 hsotg->lx_state = DWC2_L0;
37313741 }
37323742
drivers/usb/dwc2/hcd.c+40−9
@@ -2701,8 +2701,11 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions( · 2700 unmodified lines
27012701 hsotg->available_host_channels--;
27022702 }
27032703 qh = list_entry(qh_ptr, struct dwc2_qh, qh_list_entry);
2704− if (dwc2_assign_and_init_hc(hsotg, qh))
2704+ if (dwc2_assign_and_init_hc(hsotg, qh)) {
2705+ if (hsotg->params.uframe_sched)
2706+ hsotg->available_host_channels++;
27052707 break;
2708+ }
27062709
27072710 /*
27082711 * Move the QH from the periodic ready schedule to the
@@ -2735,8 +2738,11 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions( · 26 unmodified lines
27352738 hsotg->available_host_channels--;
27362739 }
27372740
2738− if (dwc2_assign_and_init_hc(hsotg, qh))
2741+ if (dwc2_assign_and_init_hc(hsotg, qh)) {
2742+ if (hsotg->params.uframe_sched)
2743+ hsotg->available_host_channels++;
27392744 break;
2745+ }
27402746
27412747 /*
27422748 * Move the QH from the non-periodic inactive schedule to the
@@ -4143,6 +4149,8 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd, · 1400 unmodified lines
41434149 urb->actual_length);
41444150
41454151 if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
4152+ if (!hsotg->params.dma_desc_enable)
4153+ urb->start_frame = qtd->qh->start_active_frame;
41464154 urb->error_count = dwc2_hcd_urb_get_error_count(qtd->urb);
41474155 for (i = 0; i < urb->number_of_packets; ++i) {
41484156 urb->iso_frame_desc[i].actual_length =
@@ -4649,7 +4657,7 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, · 500 unmodified lines
46494657 }
46504658
46514659 if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_NONE &&
4652− hsotg->bus_suspended) {
4660+ hsotg->bus_suspended && !hsotg->params.no_clock_gating) {
46534661 if (dwc2_is_device_mode(hsotg))
46544662 dwc2_gadget_exit_clock_gating(hsotg, 0);
46554663 else
@@ -5406,9 +5414,16 @@ int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) · 750 unmodified lines
54065414 /* Backup Host regs */
54075415 hr = &hsotg->hr_backup;
54085416 hr->hcfg = dwc2_readl(hsotg, HCFG);
5417+ hr->hflbaddr = dwc2_readl(hsotg, HFLBADDR);
54095418 hr->haintmsk = dwc2_readl(hsotg, HAINTMSK);
5410− for (i = 0; i < hsotg->params.host_channels; ++i)
5419+ for (i = 0; i < hsotg->params.host_channels; ++i) {
5420+ hr->hcchar[i] = dwc2_readl(hsotg, HCCHAR(i));
5421+ hr->hcsplt[i] = dwc2_readl(hsotg, HCSPLT(i));
54115422 hr->hcintmsk[i] = dwc2_readl(hsotg, HCINTMSK(i));
5423+ hr->hctsiz[i] = dwc2_readl(hsotg, HCTSIZ(i));
5424+ hr->hcidma[i] = dwc2_readl(hsotg, HCDMA(i));
5425+ hr->hcidmab[i] = dwc2_readl(hsotg, HCDMAB(i));
5426+ }
54125427
54135428 hr->hprt0 = dwc2_read_hprt0(hsotg);
54145429 hr->hfir = dwc2_readl(hsotg, HFIR);
@@ -5442,10 +5457,17 @@ int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) · 27 unmodified lines
54425457 hr->valid = false;
54435458
54445459 dwc2_writel(hsotg, hr->hcfg, HCFG);
5460+ dwc2_writel(hsotg, hr->hflbaddr, HFLBADDR);
54455461 dwc2_writel(hsotg, hr->haintmsk, HAINTMSK);
54465462
5447− for (i = 0; i < hsotg->params.host_channels; ++i)
5463+ for (i = 0; i < hsotg->params.host_channels; ++i) {
5464+ dwc2_writel(hsotg, hr->hcchar[i], HCCHAR(i));
5465+ dwc2_writel(hsotg, hr->hcsplt[i], HCSPLT(i));
54485466 dwc2_writel(hsotg, hr->hcintmsk[i], HCINTMSK(i));
5467+ dwc2_writel(hsotg, hr->hctsiz[i], HCTSIZ(i));
5468+ dwc2_writel(hsotg, hr->hcidma[i], HCDMA(i));
5469+ dwc2_writel(hsotg, hr->hcidmab[i], HCDMAB(i));
5470+ }
54495471
54505472 dwc2_writel(hsotg, hr->hprt0, HPRT0);
54515473 dwc2_writel(hsotg, hr->hfir, HFIR);
@@ -5610,10 +5632,12 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, · 158 unmodified lines
56105632 dwc2_writel(hsotg, hr->hcfg, HCFG);
56115633
56125634 /* De-assert Wakeup Logic */
5613− gpwrdn = dwc2_readl(hsotg, GPWRDN);
5614− gpwrdn &= ~GPWRDN_PMUACTV;
5615− dwc2_writel(hsotg, gpwrdn, GPWRDN);
5616− udelay(10);
5635+ if (!(rem_wakeup && hsotg->hw_params.snpsid >= DWC2_CORE_REV_4_30a)) {
5636+ gpwrdn = dwc2_readl(hsotg, GPWRDN);
5637+ gpwrdn &= ~GPWRDN_PMUACTV;
5638+ dwc2_writel(hsotg, gpwrdn, GPWRDN);
5639+ udelay(10);
5640+ }
56175641
56185642 hprt0 = hr->hprt0;
56195643 hprt0 |= HPRT0_PWR;
@@ -5638,6 +5662,13 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, · 18 unmodified lines
56385662 hprt0 |= HPRT0_RES;
56395663 dwc2_writel(hsotg, hprt0, HPRT0);
56405664
5665+ /* De-assert Wakeup Logic */
5666+ if ((rem_wakeup && hsotg->hw_params.snpsid >= DWC2_CORE_REV_4_30a)) {
5667+ gpwrdn = dwc2_readl(hsotg, GPWRDN);
5668+ gpwrdn &= ~GPWRDN_PMUACTV;
5669+ dwc2_writel(hsotg, gpwrdn, GPWRDN);
5670+ udelay(10);
5671+ }
56415672 /* Wait for Resume time and then program HPRT again */
56425673 mdelay(100);
56435674 hprt0 &= ~HPRT0_RES;
drivers/usb/dwc2/hcd_ddma.c+11−6
@@ -559,7 +559,7 @@ static void dwc2_init_isoc_dma_desc(struct dwc2_hsotg *hsotg, · 558 unmodified lines
559559 idx = qh->td_last;
560560 inc = qh->host_interval;
561561 hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg);
562− cur_idx = dwc2_frame_list_idx(hsotg->frame_number);
562+ cur_idx = idx;
563563 next_idx = dwc2_desclist_idx_inc(qh->td_last, inc, qh->dev_speed);
564564
565565 /*
@@ -866,6 +866,8 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg, · 300 unmodified lines
866866 {
867867 struct dwc2_dma_desc *dma_desc;
868868 struct dwc2_hcd_iso_packet_desc *frame_desc;
869+ u16 frame_desc_idx;
870+ struct urb *usb_urb = qtd->urb->priv;
869871 u16 remain = 0;
870872 int rc = 0;
871873
@@ -878,8 +880,11 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg, · 6 unmodified lines
878880 DMA_FROM_DEVICE);
879881
880882 dma_desc = &qh->desc_list[idx];
883+ frame_desc_idx = (idx - qtd->isoc_td_first) & (usb_urb->number_of_packets - 1);
881884
882− frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index_last];
885+ frame_desc = &qtd->urb->iso_descs[frame_desc_idx];
886+ if (idx == qtd->isoc_td_first)
887+ usb_urb->start_frame = dwc2_hcd_get_frame_number(hsotg);
883888 dma_desc->buf = (u32)(qtd->urb->dma + frame_desc->offset);
884889 if (chan->ep_is_in)
885890 remain = (dma_desc->status & HOST_DMA_ISOC_NBYTES_MASK) >>
@@ -900,7 +905,7 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg, · 14 unmodified lines
900905 frame_desc->status = 0;
901906 }
902907
903− if (++qtd->isoc_frame_index == qtd->urb->packet_count) {
908+ if (++qtd->isoc_frame_index == usb_urb->number_of_packets) {
904909 /*
905910 * urb->status is not used for isoc transfers here. The
906911 * individual frame_desc status are used instead.
@@ -1005,11 +1010,11 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, · 98 unmodified lines
10051010 return;
10061011 idx = dwc2_desclist_idx_inc(idx, qh->host_interval,
10071012 chan->speed);
1008− if (!rc)
1013+ if (rc == 0)
10091014 continue;
10101015
1011− if (rc == DWC2_CMPL_DONE)
1012− break;
1016+ if (rc == DWC2_CMPL_DONE || rc == DWC2_CMPL_STOP)
1017+ goto stop_scan;
10131018
10141019 /* rc == DWC2_CMPL_STOP */
10151020
drivers/usb/dwc2/hw.h+1−1
@@ -698,7 +698,7 @@ · 697 unmodified lines
698698 #define TXSTS_QTOP_TOKEN_MASK (0x3 << 25)
699699 #define TXSTS_QTOP_TOKEN_SHIFT 25
700700 #define TXSTS_QTOP_TERMINATE BIT(24)
701−#define TXSTS_QSPCAVAIL_MASK (0xff << 16)
701+#define TXSTS_QSPCAVAIL_MASK (0x7f << 16)
702702 #define TXSTS_QSPCAVAIL_SHIFT 16
703703 #define TXSTS_FSPCAVAIL_MASK (0xffff << 0)
704704 #define TXSTS_FSPCAVAIL_SHIFT 0
drivers/usb/dwc2/platform.c+1−1
@@ -331,7 +331,7 @@ static void dwc2_driver_remove(struct platform_device *dev) · 330 unmodified lines
331331
332332 /* Exit clock gating when driver is removed. */
333333 if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_NONE &&
334− hsotg->bus_suspended) {
334+ hsotg->bus_suspended && !hsotg->params.no_clock_gating) {
335335 if (dwc2_is_device_mode(hsotg))
336336 dwc2_gadget_exit_clock_gating(hsotg, 0);
337337 else
drivers/usb/dwc3/core.c+2−0
@@ -1519,6 +1519,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) · 1518 unmodified lines
15191519 else
15201520 dwc->sysdev = dwc->dev;
15211521
1522+ dwc->sys_wakeup = device_may_wakeup(dwc->sysdev);
1523+
15221524 ret = device_property_read_string(dev, "usb-psy-name", &usb_psy_name);
15231525 if (ret >= 0) {
15241526 dwc->usb_psy = power_supply_get_by_name(usb_psy_name);
drivers/usb/dwc3/core.h+2−0
@@ -1133,6 +1133,7 @@ struct dwc3_scratchpad_array { · 1132 unmodified lines
11331133 * 3 - Reserved
11341134 * @dis_metastability_quirk: set to disable metastability quirk.
11351135 * @dis_split_quirk: set to disable split boundary.
1136+ * @sys_wakeup: set if the device may do system wakeup.
11361137 * @wakeup_configured: set if the device is configured for remote wakeup.
11371138 * @suspended: set to track suspend event due to U3/L2.
11381139 * @imod_interval: set the interrupt moderation interval in 250ns
@@ -1357,6 +1358,7 @@ struct dwc3 { · 218 unmodified lines
13571358
13581359 unsigned dis_split_quirk:1;
13591360 unsigned async_callbacks:1;
1361+ unsigned sys_wakeup:1;
13601362 unsigned wakeup_configured:1;
13611363 unsigned suspended:1;
13621364
drivers/usb/dwc3/dwc3-pci.c+0−2
@@ -51,7 +51,6 @@ · 50 unmodified lines
5151 #define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1
5252 #define PCI_DEVICE_ID_INTEL_MTLS 0x7f6f
5353 #define PCI_DEVICE_ID_INTEL_MTL 0x7e7e
54−#define PCI_DEVICE_ID_INTEL_ARLH 0x7ec1
5554 #define PCI_DEVICE_ID_INTEL_ARLH_PCH 0x777e
5655 #define PCI_DEVICE_ID_INTEL_TGL 0x9a15
5756 #define PCI_DEVICE_ID_AMD_MR 0x163a
@@ -423,7 +422,6 @@ static const struct pci_device_id dwc3_pci_id_table[] = { · 365 unmodified lines
423422 { PCI_DEVICE_DATA(INTEL, MTLP, &dwc3_pci_intel_swnode) },
424423 { PCI_DEVICE_DATA(INTEL, MTL, &dwc3_pci_intel_swnode) },
425424 { PCI_DEVICE_DATA(INTEL, MTLS, &dwc3_pci_intel_swnode) },
426− { PCI_DEVICE_DATA(INTEL, ARLH, &dwc3_pci_intel_swnode) },
427425 { PCI_DEVICE_DATA(INTEL, ARLH_PCH, &dwc3_pci_intel_swnode) },
428426 { PCI_DEVICE_DATA(INTEL, TGL, &dwc3_pci_intel_swnode) },
429427
drivers/usb/dwc3/gadget.c+10−0
@@ -2955,6 +2955,9 @@ static int dwc3_gadget_start(struct usb_gadget *g, · 2954 unmodified lines
29552955 dwc->gadget_driver = driver;
29562956 spin_unlock_irqrestore(&dwc->lock, flags);
29572957
2958+ if (dwc->sys_wakeup)
2959+ device_wakeup_enable(dwc->sysdev);
2960+
29582961 return 0;
29592962 }
29602963
@@ -2970,6 +2973,9 @@ static int dwc3_gadget_stop(struct usb_gadget *g) · 9 unmodified lines
29702973 struct dwc3 *dwc = gadget_to_dwc(g);
29712974 unsigned long flags;
29722975
2976+ if (dwc->sys_wakeup)
2977+ device_wakeup_disable(dwc->sysdev);
2978+
29732979 spin_lock_irqsave(&dwc->lock, flags);
29742980 dwc->gadget_driver = NULL;
29752981 dwc->max_cfg_eps = 0;
@@ -4651,6 +4657,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) · 1675 unmodified lines
46514657 else
46524658 dwc3_gadget_set_speed(dwc->gadget, dwc->maximum_speed);
46534659
4660+ /* No system wakeup if no gadget driver bound */
4661+ if (dwc->sys_wakeup)
4662+ device_wakeup_disable(dwc->sysdev);
4663+
46544664 return 0;
46554665
46564666 err5:
drivers/usb/dwc3/host.c+11−0
@@ -173,6 +173,14 @@ int dwc3_host_init(struct dwc3 *dwc) · 172 unmodified lines
173173 goto err;
174174 }
175175
176+ if (dwc->sys_wakeup) {
177+ /* Restore wakeup setting if switched from device */
178+ device_wakeup_enable(dwc->sysdev);
179+
180+ /* Pass on wakeup setting to the new xhci platform device */
181+ device_init_wakeup(&xhci->dev, true);
182+ }
183+
176184 return 0;
177185 err:
178186 platform_device_put(xhci);
@@ -181,6 +189,9 @@ err: · 2 unmodified lines
181189
182190 void dwc3_host_exit(struct dwc3 *dwc)
183191 {
192+ if (dwc->sys_wakeup)
193+ device_init_wakeup(&dwc->xhci->dev, false);
194+
184195 platform_device_unregister(dwc->xhci);
185196 dwc->xhci = NULL;
186197 }
drivers/usb/gadget/udc/core.c+3−1
@@ -292,7 +292,9 @@ int usb_ep_queue(struct usb_ep *ep, · 291 unmodified lines
292292 {
293293 int ret = 0;
294294
295− if (WARN_ON_ONCE(!ep->enabled && ep->address)) {
295+ if (!ep->enabled && ep->address) {
296+ pr_debug("USB gadget: queue request to disabled ep 0x%x (%s)\n",
297+ ep->address, ep->name);
296298 ret = -ESHUTDOWN;
297299 goto out;
298300 }
drivers/usb/misc/usb-ljca.c+9−13
@@ -518,8 +518,10 @@ static int ljca_new_client_device(struct ljca_adapter *adap, u8 type, u8 id, · 517 unmodified lines
518518 int ret;
519519
520520 client = kzalloc(sizeof *client, GFP_KERNEL);
521− if (!client)
521+ if (!client) {
522+ kfree(data);
522523 return -ENOMEM;
524+ }
523525
524526 client->type = type;
525527 client->id = id;
@@ -535,8 +537,10 @@ static int ljca_new_client_device(struct ljca_adapter *adap, u8 type, u8 id, · 9 unmodified lines
535537 auxdev->dev.release = ljca_auxdev_release;
536538
537539 ret = auxiliary_device_init(auxdev);
538− if (ret)
540+ if (ret) {
541+ kfree(data);
539542 goto err_free;
543+ }
540544
541545 ljca_auxdev_acpi_bind(adap, auxdev, adr, id);
542546
@@ -590,12 +594,8 @@ static int ljca_enumerate_gpio(struct ljca_adapter *adap) · 47 unmodified lines
590594 valid_pin[i] = get_unaligned_le32(&desc->bank_desc[i].valid_pins);
591595 bitmap_from_arr32(gpio_info->valid_pin_map, valid_pin, gpio_num);
592596
593− ret = ljca_new_client_device(adap, LJCA_CLIENT_GPIO, 0, "ljca-gpio",
597+ return ljca_new_client_device(adap, LJCA_CLIENT_GPIO, 0, "ljca-gpio",
594598 gpio_info, LJCA_GPIO_ACPI_ADR);
595− if (ret)
596− kfree(gpio_info);
597−
598− return ret;
599599 }
600600
601601 static int ljca_enumerate_i2c(struct ljca_adapter *adap)
@@ -629,10 +629,8 @@ static int ljca_enumerate_i2c(struct ljca_adapter *adap) · 27 unmodified lines
629629 ret = ljca_new_client_device(adap, LJCA_CLIENT_I2C, i,
630630 "ljca-i2c", i2c_info,
631631 LJCA_I2C1_ACPI_ADR + i);
632− if (ret) {
633− kfree(i2c_info);
632+ if (ret)
634633 return ret;
635− }
636634 }
637635
638636 return 0;
@@ -669,10 +667,8 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap) · 30 unmodified lines
669667 ret = ljca_new_client_device(adap, LJCA_CLIENT_SPI, i,
670668 "ljca-spi", spi_info,
671669 LJCA_SPI1_ACPI_ADR + i);
672− if (ret) {
673− kfree(spi_info);
670+ if (ret)
674671 return ret;
675− }
676672 }
677673
678674 return 0;
drivers/usb/phy/phy-generic.c+0−7
@@ -262,13 +262,6 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop) · 261 unmodified lines
262262 return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
263263 "could not get vbus regulator\n");
264264
265− nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
266− if (PTR_ERR(nop->vbus_draw) == -ENODEV)
267− nop->vbus_draw = NULL;
268− if (IS_ERR(nop->vbus_draw))
269− return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
270− "could not get vbus regulator\n");
271−
272265 nop->dev = dev;
273266 nop->phy.dev = nop->dev;
274267 nop->phy.label = "nop-xceiv";
drivers/usb/storage/uas.c+13−15
@@ -533,7 +533,7 @@ static struct urb *uas_alloc_cmd_urb(struct uas_dev_info *devinfo, gfp_t gfp, · 532 unmodified lines
533533 * daft to me.
534534 */
535535
536−static struct urb *uas_submit_sense_urb(struct scsi_cmnd *cmnd, gfp_t gfp)
536+static int uas_submit_sense_urb(struct scsi_cmnd *cmnd, gfp_t gfp)
537537 {
538538 struct uas_dev_info *devinfo = cmnd->device->hostdata;
539539 struct urb *urb;
@@ -541,30 +541,28 @@ static struct urb *uas_submit_sense_urb(struct scsi_cmnd *cmnd, gfp_t gfp) · 1 unmodified line
541541
542542 urb = uas_alloc_sense_urb(devinfo, gfp, cmnd);
543543 if (!urb)
544− return NULL;
544+ return -ENOMEM;
545545 usb_anchor_urb(urb, &devinfo->sense_urbs);
546546 err = usb_submit_urb(urb, gfp);
547547 if (err) {
548548 usb_unanchor_urb(urb);
549549 uas_log_cmd_state(cmnd, "sense submit err", err);
550550 usb_free_urb(urb);
551− return NULL;
552551 }
553− return urb;
552+ return err;
554553 }
555554
556555 static int uas_submit_urbs(struct scsi_cmnd *cmnd,
557556 struct uas_dev_info *devinfo)
558557 {
559558 struct uas_cmd_info *cmdinfo = scsi_cmd_priv(cmnd);
560− struct urb *urb;
561559 int err;
562560
563561 lockdep_assert_held(&devinfo->lock);
564562 if (cmdinfo->state & SUBMIT_STATUS_URB) {
565− urb = uas_submit_sense_urb(cmnd, GFP_ATOMIC);
566− if (!urb)
567− return SCSI_MLQUEUE_DEVICE_BUSY;
563+ err = uas_submit_sense_urb(cmnd, GFP_ATOMIC);
564+ if (err)
565+ return err;
568566 cmdinfo->state &= ~SUBMIT_STATUS_URB;
569567 }
570568
@@ -572,7 +570,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 1 unmodified line
572570 cmdinfo->data_in_urb = uas_alloc_data_urb(devinfo, GFP_ATOMIC,
573571 cmnd, DMA_FROM_DEVICE);
574572 if (!cmdinfo->data_in_urb)
575− return SCSI_MLQUEUE_DEVICE_BUSY;
573+ return -ENOMEM;
576574 cmdinfo->state &= ~ALLOC_DATA_IN_URB;
577575 }
578576
@@ -582,7 +580,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 3 unmodified lines
582580 if (err) {
583581 usb_unanchor_urb(cmdinfo->data_in_urb);
584582 uas_log_cmd_state(cmnd, "data in submit err", err);
585− return SCSI_MLQUEUE_DEVICE_BUSY;
583+ return err;
586584 }
587585 cmdinfo->state &= ~SUBMIT_DATA_IN_URB;
588586 cmdinfo->state |= DATA_IN_URB_INFLIGHT;
@@ -592,7 +590,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 3 unmodified lines
592590 cmdinfo->data_out_urb = uas_alloc_data_urb(devinfo, GFP_ATOMIC,
593591 cmnd, DMA_TO_DEVICE);
594592 if (!cmdinfo->data_out_urb)
595− return SCSI_MLQUEUE_DEVICE_BUSY;
593+ return -ENOMEM;
596594 cmdinfo->state &= ~ALLOC_DATA_OUT_URB;
597595 }
598596
@@ -602,7 +600,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 3 unmodified lines
602600 if (err) {
603601 usb_unanchor_urb(cmdinfo->data_out_urb);
604602 uas_log_cmd_state(cmnd, "data out submit err", err);
605− return SCSI_MLQUEUE_DEVICE_BUSY;
603+ return err;
606604 }
607605 cmdinfo->state &= ~SUBMIT_DATA_OUT_URB;
608606 cmdinfo->state |= DATA_OUT_URB_INFLIGHT;
@@ -611,7 +609,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 2 unmodified lines
611609 if (cmdinfo->state & ALLOC_CMD_URB) {
612610 cmdinfo->cmd_urb = uas_alloc_cmd_urb(devinfo, GFP_ATOMIC, cmnd);
613611 if (!cmdinfo->cmd_urb)
614− return SCSI_MLQUEUE_DEVICE_BUSY;
612+ return -ENOMEM;
615613 cmdinfo->state &= ~ALLOC_CMD_URB;
616614 }
617615
@@ -621,7 +619,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, · 3 unmodified lines
621619 if (err) {
622620 usb_unanchor_urb(cmdinfo->cmd_urb);
623621 uas_log_cmd_state(cmnd, "cmd submit err", err);
624− return SCSI_MLQUEUE_DEVICE_BUSY;
622+ return err;
625623 }
626624 cmdinfo->cmd_urb = NULL;
627625 cmdinfo->state &= ~SUBMIT_CMD_URB;
@@ -698,7 +696,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd) · 70 unmodified lines
698696 * of queueing, no matter how fatal the error
699697 */
700698 if (err == -ENODEV) {
701− set_host_byte(cmnd, DID_ERROR);
699+ set_host_byte(cmnd, DID_NO_CONNECT);
702700 scsi_done(cmnd);
703701 goto zombie;
704702 }
drivers/usb/typec/class.c+6−1
@@ -1310,6 +1310,7 @@ static ssize_t select_usb_power_delivery_store(struct device *dev, · 1309 unmodified lines
13101310 {
13111311 struct typec_port *port = to_typec_port(dev);
13121312 struct usb_power_delivery *pd;
1313+ int ret;
13131314
13141315 if (!port->ops || !port->ops->pd_set)
13151316 return -EOPNOTSUPP;
@@ -1318,7 +1319,11 @@ static ssize_t select_usb_power_delivery_store(struct device *dev, · 2 unmodified lines
13181319 if (!pd)
13191320 return -EINVAL;
13201321
1321− return port->ops->pd_set(port, pd);
1322+ ret = port->ops->pd_set(port, pd);
1323+ if (ret)
1324+ return ret;
1325+
1326+ return size;
13221327 }
13231328
13241329 static ssize_t select_usb_power_delivery_show(struct device *dev,
drivers/usb/typec/tcpm/tcpm.c+3−3
@@ -6861,7 +6861,7 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd) · 6860 unmodified lines
68616861
68626862 if (data->source_desc.pdo[0]) {
68636863 for (i = 0; i < PDO_MAX_OBJECTS && data->source_desc.pdo[i]; i++)
6864− port->snk_pdo[i] = data->source_desc.pdo[i];
6864+ port->src_pdo[i] = data->source_desc.pdo[i];
68656865 port->nr_src_pdo = i + 1;
68666866 }
68676867
@@ -6910,7 +6910,9 @@ static int tcpm_pd_set(struct typec_port *p, struct usb_power_delivery *pd) · 42 unmodified lines
69106910
69116911 port->port_source_caps = data->source_cap;
69126912 port->port_sink_caps = data->sink_cap;
6913+ typec_port_set_usb_power_delivery(p, NULL);
69136914 port->selected_pd = pd;
6915+ typec_port_set_usb_power_delivery(p, port->selected_pd);
69146916 unlock:
69156917 mutex_unlock(&port->lock);
69166918 return ret;
@@ -6943,9 +6945,7 @@ static void tcpm_port_unregister_pd(struct tcpm_port *port) · 26 unmodified lines
69436945 port->port_source_caps = NULL;
69446946 for (i = 0; i < port->pd_count; i++) {
69456947 usb_power_delivery_unregister_capabilities(port->pd_list[i]->sink_cap);
6946− kfree(port->pd_list[i]->sink_cap);
69476948 usb_power_delivery_unregister_capabilities(port->pd_list[i]->source_cap);
6948− kfree(port->pd_list[i]->source_cap);
69496949 devm_kfree(port->dev, port->pd_list[i]);
69506950 port->pd_list[i] = NULL;
69516951 usb_power_delivery_unregister(port->pds[i]);
drivers/usb/typec/ucsi/ucsi.c+72−18
@@ -151,8 +151,12 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd) · 150 unmodified lines
151151 if (!(cci & UCSI_CCI_COMMAND_COMPLETE))
152152 return -EIO;
153153
154− if (cci & UCSI_CCI_NOT_SUPPORTED)
154+ if (cci & UCSI_CCI_NOT_SUPPORTED) {
155+ if (ucsi_acknowledge_command(ucsi) < 0)
156+ dev_err(ucsi->dev,
157+ "ACK of unsupported command failed\n");
155158 return -EOPNOTSUPP;
159+ }
156160
157161 if (cci & UCSI_CCI_ERROR) {
158162 if (cmd == UCSI_GET_ERROR_STATUS)
@@ -1133,17 +1137,21 @@ static int ucsi_check_cable(struct ucsi_connector *con) · 974 unmodified lines
11331137 if (ret < 0)
11341138 return ret;
11351139
1136− ret = ucsi_get_cable_identity(con);
1137− if (ret < 0)
1138− return ret;
1140+ if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE) {
1141+ ret = ucsi_get_cable_identity(con);
1142+ if (ret < 0)
1143+ return ret;
1144+ }
11391145
1140− ret = ucsi_register_plug(con);
1141− if (ret < 0)
1142− return ret;
1146+ if (con->ucsi->cap.features & UCSI_CAP_ALT_MODE_DETAILS) {
1147+ ret = ucsi_register_plug(con);
1148+ if (ret < 0)
1149+ return ret;
11431150
1144− ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_SOP_P);
1145− if (ret < 0)
1146− return ret;
1151+ ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_SOP_P);
1152+ if (ret < 0)
1153+ return ret;
1154+ }
11471155
11481156 return 0;
11491157 }
@@ -1189,8 +1197,10 @@ static void ucsi_handle_connector_change(struct work_struct *work) · 39 unmodified lines
11891197 ucsi_register_partner(con);
11901198 ucsi_partner_task(con, ucsi_check_connection, 1, HZ);
11911199 ucsi_partner_task(con, ucsi_check_connector_capability, 1, HZ);
1192− ucsi_partner_task(con, ucsi_get_partner_identity, 1, HZ);
1193− ucsi_partner_task(con, ucsi_check_cable, 1, HZ);
1200+ if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
1201+ ucsi_partner_task(con, ucsi_get_partner_identity, 1, HZ);
1202+ if (con->ucsi->cap.features & UCSI_CAP_CABLE_DETAILS)
1203+ ucsi_partner_task(con, ucsi_check_cable, 1, HZ);
11941204
11951205 if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) ==
11961206 UCSI_CONSTAT_PWR_OPMODE_PD)
@@ -1215,11 +1225,11 @@ static void ucsi_handle_connector_change(struct work_struct *work) · 18 unmodified lines
12151225 if (con->status.change & UCSI_CONSTAT_CAM_CHANGE)
12161226 ucsi_partner_task(con, ucsi_check_altmodes, 1, 0);
12171227
1218− clear_bit(EVENT_PENDING, &con->ucsi->flags);
1219−
12201228 mutex_lock(&ucsi->ppm_lock);
1229+ clear_bit(EVENT_PENDING, &con->ucsi->flags);
12211230 ret = ucsi_acknowledge_connector_change(ucsi);
12221231 mutex_unlock(&ucsi->ppm_lock);
1232+
12231233 if (ret)
12241234 dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);
12251235
@@ -1237,7 +1247,7 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num) · 11 unmodified lines
12371247 struct ucsi_connector *con = &ucsi->connector[num - 1];
12381248
12391249 if (!(ucsi->ntfy & UCSI_ENABLE_NTFY_CONNECTOR_CHANGE)) {
1240− dev_dbg(ucsi->dev, "Bogus connector change event\n");
1250+ dev_dbg(ucsi->dev, "Early connector change event\n");
12411251 return;
12421252 }
12431253
@@ -1260,13 +1270,47 @@ static int ucsi_reset_connector(struct ucsi_connector *con, bool hard) · 16 unmodified lines
12601270
12611271 static int ucsi_reset_ppm(struct ucsi *ucsi)
12621272 {
1263− u64 command = UCSI_PPM_RESET;
1273+ u64 command;
12641274 unsigned long tmo;
12651275 u32 cci;
12661276 int ret;
12671277
12681278 mutex_lock(&ucsi->ppm_lock);
12691279
1280+ ret = ucsi->ops->read(ucsi, UCSI_CCI, &cci, sizeof(cci));
1281+ if (ret < 0)
1282+ goto out;
1283+
1284+ /*
1285+ * If UCSI_CCI_RESET_COMPLETE is already set we must clear
1286+ * the flag before we start another reset. Send a
1287+ * UCSI_SET_NOTIFICATION_ENABLE command to achieve this.
1288+ * Ignore a timeout and try the reset anyway if this fails.
1289+ */
1290+ if (cci & UCSI_CCI_RESET_COMPLETE) {
1291+ command = UCSI_SET_NOTIFICATION_ENABLE;
1292+ ret = ucsi->ops->async_write(ucsi, UCSI_CONTROL, &command,
1293+ sizeof(command));
1294+ if (ret < 0)
1295+ goto out;
1296+
1297+ tmo = jiffies + msecs_to_jiffies(UCSI_TIMEOUT_MS);
1298+ do {
1299+ ret = ucsi->ops->read(ucsi, UCSI_CCI,
1300+ &cci, sizeof(cci));
1301+ if (ret < 0)
1302+ goto out;
1303+ if (cci & UCSI_CCI_COMMAND_COMPLETE)
1304+ break;
1305+ if (time_is_before_jiffies(tmo))
1306+ break;
1307+ msleep(20);
1308+ } while (1);
1309+
1310+ WARN_ON(cci & UCSI_CCI_RESET_COMPLETE);
1311+ }
1312+
1313+ command = UCSI_PPM_RESET;
12701314 ret = ucsi->ops->async_write(ucsi, UCSI_CONTROL, &command,
12711315 sizeof(command));
12721316 if (ret < 0)
@@ -1589,8 +1633,10 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con) · 316 unmodified lines
15891633 ucsi_register_partner(con);
15901634 ucsi_pwr_opmode_change(con);
15911635 ucsi_port_psy_changed(con);
1592− ucsi_get_partner_identity(con);
1593− ucsi_check_cable(con);
1636+ if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
1637+ ucsi_get_partner_identity(con);
1638+ if (con->ucsi->cap.features & UCSI_CAP_CABLE_DETAILS)
1639+ ucsi_check_cable(con);
15941640 }
15951641
15961642 /* Only notify USB controller if partner supports USB data */
@@ -1636,6 +1682,7 @@ static int ucsi_init(struct ucsi *ucsi) · 39 unmodified lines
16361682 {
16371683 struct ucsi_connector *con, *connector;
16381684 u64 command, ntfy;
1685+ u32 cci;
16391686 int ret;
16401687 int i;
16411688
@@ -1688,6 +1735,13 @@ static int ucsi_init(struct ucsi *ucsi) · 46 unmodified lines
16881735
16891736 ucsi->connector = connector;
16901737 ucsi->ntfy = ntfy;
1738+
1739+ ret = ucsi->ops->read(ucsi, UCSI_CCI, &cci, sizeof(cci));
1740+ if (ret)
1741+ return ret;
1742+ if (UCSI_CCI_CONNECTOR(READ_ONCE(cci)))
1743+ ucsi_connector_change(ucsi, cci);
1744+
16911745 return 0;
16921746
16931747 err_unregister:
drivers/usb/typec/ucsi/ucsi.h+3−2
@@ -206,7 +206,7 @@ struct ucsi_capability { · 205 unmodified lines
206206 #define UCSI_CAP_ATTR_POWER_OTHER BIT(10)
207207 #define UCSI_CAP_ATTR_POWER_VBUS BIT(14)
208208 u8 num_connectors;
209− u8 features;
209+ u16 features;
210210 #define UCSI_CAP_SET_UOM BIT(0)
211211 #define UCSI_CAP_SET_PDM BIT(1)
212212 #define UCSI_CAP_ALT_MODE_DETAILS BIT(2)
@@ -215,7 +215,8 @@ struct ucsi_capability { · 2 unmodified lines
215215 #define UCSI_CAP_CABLE_DETAILS BIT(5)
216216 #define UCSI_CAP_EXT_SUPPLY_NOTIFICATIONS BIT(6)
217217 #define UCSI_CAP_PD_RESET BIT(7)
218− u16 reserved_1;
218+#define UCSI_CAP_GET_PD_MESSAGE BIT(8)
219+ u8 reserved_1;
219220 u8 num_alt_modes;
220221 u8 reserved_2;
221222 u16 bc_version;
drivers/usb/typec/ucsi/ucsi_acpi.c+33−42
@@ -23,10 +23,11 @@ struct ucsi_acpi { · 22 unmodified lines
2323 void *base;
2424 struct completion complete;
2525 unsigned long flags;
26+#define UCSI_ACPI_SUPPRESS_EVENT 0
27+#define UCSI_ACPI_COMMAND_PENDING 1
28+#define UCSI_ACPI_ACK_PENDING 2
2629 guid_t guid;
2730 u64 cmd;
28− bool dell_quirk_probed;
29− bool dell_quirk_active;
3031 };
3132
3233 static int ucsi_acpi_dsm(struct ucsi_acpi *ua, int func)
@@ -79,9 +80,9 @@ static int ucsi_acpi_sync_write(struct ucsi *ucsi, unsigned int offset, · 46 unmodified lines
7980 int ret;
8081
8182 if (ack)
82− set_bit(ACK_PENDING, &ua->flags);
83+ set_bit(UCSI_ACPI_ACK_PENDING, &ua->flags);
8384 else
84− set_bit(COMMAND_PENDING, &ua->flags);
85+ set_bit(UCSI_ACPI_COMMAND_PENDING, &ua->flags);
8586
8687 ret = ucsi_acpi_async_write(ucsi, offset, val, val_len);
8788 if (ret)
@@ -92,9 +93,9 @@ static int ucsi_acpi_sync_write(struct ucsi *ucsi, unsigned int offset, · 4 unmodified lines
9293
9394 out_clear_bit:
9495 if (ack)
95− clear_bit(ACK_PENDING, &ua->flags);
96+ clear_bit(UCSI_ACPI_ACK_PENDING, &ua->flags);
9697 else
97− clear_bit(COMMAND_PENDING, &ua->flags);
98+ clear_bit(UCSI_ACPI_COMMAND_PENDING, &ua->flags);
9899
99100 return ret;
100101 }
@@ -129,51 +130,40 @@ static const struct ucsi_operations ucsi_zenbook_ops = { · 28 unmodified lines
129130 };
130131
131132 /*
132− * Some Dell laptops expect that an ACK command with the
133− * UCSI_ACK_CONNECTOR_CHANGE bit set is followed by a (separate)
134− * ACK command that only has the UCSI_ACK_COMMAND_COMPLETE bit set.
135− * If this is not done events are not delivered to OSPM and
136− * subsequent commands will timeout.
133+ * Some Dell laptops don't like ACK commands with the
134+ * UCSI_ACK_CONNECTOR_CHANGE but not the UCSI_ACK_COMMAND_COMPLETE
135+ * bit set. To work around this send a dummy command and bundle the
136+ * UCSI_ACK_CONNECTOR_CHANGE with the UCSI_ACK_COMMAND_COMPLETE
137+ * for the dummy command.
137138 */
138139 static int
139140 ucsi_dell_sync_write(struct ucsi *ucsi, unsigned int offset,
140141 const void *val, size_t val_len)
141142 {
142143 struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
143− u64 cmd = *(u64 *)val, ack = 0;
144+ u64 cmd = *(u64 *)val;
145+ u64 dummycmd = UCSI_GET_CAPABILITY;
144146 int ret;
145147
146− if (UCSI_COMMAND(cmd) == UCSI_ACK_CC_CI &&
147− cmd & UCSI_ACK_CONNECTOR_CHANGE)
148− ack = UCSI_ACK_CC_CI | UCSI_ACK_COMMAND_COMPLETE;
149−
150− ret = ucsi_acpi_sync_write(ucsi, offset, val, val_len);
151− if (ret != 0)
152− return ret;
153− if (ack == 0)
154− return ret;
155−
156− if (!ua->dell_quirk_probed) {
157− ua->dell_quirk_probed = true;
158−
159− cmd = UCSI_GET_CAPABILITY;
160− ret = ucsi_acpi_sync_write(ucsi, UCSI_CONTROL, &cmd,
161− sizeof(cmd));
162− if (ret == 0)
163− return ucsi_acpi_sync_write(ucsi, UCSI_CONTROL,
164− &ack, sizeof(ack));
165− if (ret != -ETIMEDOUT)
148+ if (cmd == (UCSI_ACK_CC_CI | UCSI_ACK_CONNECTOR_CHANGE)) {
149+ cmd |= UCSI_ACK_COMMAND_COMPLETE;
150+
151+ /*
152+ * The UCSI core thinks it is sending a connector change ack
153+ * and will accept new connector change events. We don't want
154+ * this to happen for the dummy command as its response will
155+ * still report the very event that the core is trying to clear.
156+ */
157+ set_bit(UCSI_ACPI_SUPPRESS_EVENT, &ua->flags);
158+ ret = ucsi_acpi_sync_write(ucsi, UCSI_CONTROL, &dummycmd,
159+ sizeof(dummycmd));
160+ clear_bit(UCSI_ACPI_SUPPRESS_EVENT, &ua->flags);
161+
162+ if (ret < 0)
166163 return ret;
167−
168− ua->dell_quirk_active = true;
169− dev_err(ua->dev, "Firmware bug: Additional ACK required after ACKing a connector change.\n");
170− dev_err(ua->dev, "Firmware bug: Enabling workaround\n");
171164 }
172165
173− if (!ua->dell_quirk_active)
174− return ret;
175−
176− return ucsi_acpi_sync_write(ucsi, UCSI_CONTROL, &ack, sizeof(ack));
166+ return ucsi_acpi_sync_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd));
177167 }
178168
179169 static const struct ucsi_operations ucsi_dell_ops = {
@@ -209,13 +199,14 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data) · 29 unmodified lines
209199 if (ret)
210200 return;
211201
212− if (UCSI_CCI_CONNECTOR(cci))
202+ if (UCSI_CCI_CONNECTOR(cci) &&
203+ !test_bit(UCSI_ACPI_SUPPRESS_EVENT, &ua->flags))
213204 ucsi_connector_change(ua->ucsi, UCSI_CCI_CONNECTOR(cci));
214205
215206 if (cci & UCSI_CCI_ACK_COMPLETE && test_bit(ACK_PENDING, &ua->flags))
216207 complete(&ua->complete);
217208 if (cci & UCSI_CCI_COMMAND_COMPLETE &&
218− test_bit(COMMAND_PENDING, &ua->flags))
209+ test_bit(UCSI_ACPI_COMMAND_PENDING, &ua->flags))
219210 complete(&ua->complete);
220211 }
221212
drivers/usb/typec/ucsi/ucsi_glink.c+14−0
@@ -255,6 +255,20 @@ static void pmic_glink_ucsi_notify(struct work_struct *work) · 254 unmodified lines
255255 static void pmic_glink_ucsi_register(struct work_struct *work)
256256 {
257257 struct pmic_glink_ucsi *ucsi = container_of(work, struct pmic_glink_ucsi, register_work);
258+ int orientation;
259+ int i;
260+
261+ for (i = 0; i < PMIC_GLINK_MAX_PORTS; i++) {
262+ if (!ucsi->port_orientation[i])
263+ continue;
264+ orientation = gpiod_get_value(ucsi->port_orientation[i]);
265+
266+ if (orientation >= 0) {
267+ typec_switch_set(ucsi->port_switch[i],
268+ orientation ? TYPEC_ORIENTATION_REVERSE
269+ : TYPEC_ORIENTATION_NORMAL);
270+ }
271+ }
258272
259273 ucsi_register(ucsi->ucsi);
260274 }
drivers/video/fbdev/Kconfig+3−0
@@ -494,6 +494,7 @@ config FB_SBUS_HELPERS · 493 unmodified lines
494494 select FB_CFB_COPYAREA
495495 select FB_CFB_FILLRECT
496496 select FB_CFB_IMAGEBLIT
497+ select FB_IOMEM_FOPS
497498
498499 config FB_BW2
499500 bool "BWtwo support"
@@ -514,6 +515,7 @@ config FB_CG6 · 14 unmodified lines
514515 depends on (FB = y) && (SPARC && FB_SBUS)
515516 select FB_CFB_COPYAREA
516517 select FB_CFB_IMAGEBLIT
518+ select FB_IOMEM_FOPS
517519 help
518520 This is the frame buffer device driver for the CGsix (GX, TurboGX)
519521 frame buffer.
@@ -523,6 +525,7 @@ config FB_FFB · 3 unmodified lines
523525 depends on FB_SBUS && SPARC64
524526 select FB_CFB_COPYAREA
525527 select FB_CFB_IMAGEBLIT
528+ select FB_IOMEM_FOPS
526529 help
527530 This is the frame buffer device driver for the Creator, Creator3D,
528531 and Elite3D graphics boards.
fs/9p/vfs_inode.c+10−6
@@ -344,17 +344,21 @@ void v9fs_evict_inode(struct inode *inode) · 343 unmodified lines
344344 struct v9fs_inode __maybe_unused *v9inode = V9FS_I(inode);
345345 __le32 __maybe_unused version;
346346
347− truncate_inode_pages_final(&inode->i_data);
347+ if (!is_bad_inode(inode)) {
348+ truncate_inode_pages_final(&inode->i_data);
348349
349− version = cpu_to_le32(v9inode->qid.version);
350− netfs_clear_inode_writeback(inode, &version);
350+ version = cpu_to_le32(v9inode->qid.version);
351+ netfs_clear_inode_writeback(inode, &version);
351352
352− clear_inode(inode);
353− filemap_fdatawrite(&inode->i_data);
353+ clear_inode(inode);
354+ filemap_fdatawrite(&inode->i_data);
354355
355356 #ifdef CONFIG_9P_FSCACHE
356− fscache_relinquish_cookie(v9fs_inode_cookie(v9inode), false);
357+ if (v9fs_inode_cookie(v9inode))
358+ fscache_relinquish_cookie(v9fs_inode_cookie(v9inode), false);
357359 #endif
360+ } else
361+ clear_inode(inode);
358362 }
359363
360364 struct inode *v9fs_fid_iget(struct super_block *sb, struct p9_fid *fid)
fs/9p/vfs_inode_dotl.c+1−5
@@ -78,11 +78,11 @@ struct inode *v9fs_fid_iget_dotl(struct super_block *sb, struct p9_fid *fid) · 77 unmodified lines
7878
7979 retval = v9fs_init_inode(v9ses, inode, &fid->qid,
8080 st->st_mode, new_decode_dev(st->st_rdev));
81+ v9fs_stat2inode_dotl(st, inode, 0);
8182 kfree(st);
8283 if (retval)
8384 goto error;
8485
85− v9fs_stat2inode_dotl(st, inode, 0);
8686 v9fs_set_netfs_context(inode);
8787 v9fs_cache_inode_get_cookie(inode);
8888 retval = v9fs_get_acl(inode, fid);
@@ -297,7 +297,6 @@ static int v9fs_vfs_mkdir_dotl(struct mnt_idmap *idmap, · 208 unmodified lines
297297 umode_t omode)
298298 {
299299 int err;
300− struct v9fs_session_info *v9ses;
301300 struct p9_fid *fid = NULL, *dfid = NULL;
302301 kgid_t gid;
303302 const unsigned char *name;
@@ -307,7 +306,6 @@ static int v9fs_vfs_mkdir_dotl(struct mnt_idmap *idmap, · 3 unmodified lines
307306 struct posix_acl *dacl = NULL, *pacl = NULL;
308307
309308 p9_debug(P9_DEBUG_VFS, "name %pd\n", dentry);
310− v9ses = v9fs_inode2v9ses(dir);
311309
312310 omode |= S_IFDIR;
313311 if (dir->i_mode & S_ISGID)
@@ -739,7 +737,6 @@ v9fs_vfs_mknod_dotl(struct mnt_idmap *idmap, struct inode *dir, · 425 unmodified lines
739737 kgid_t gid;
740738 const unsigned char *name;
741739 umode_t mode;
742− struct v9fs_session_info *v9ses;
743740 struct p9_fid *fid = NULL, *dfid = NULL;
744741 struct inode *inode;
745742 struct p9_qid qid;
@@ -749,7 +746,6 @@ v9fs_vfs_mknod_dotl(struct mnt_idmap *idmap, struct inode *dir, · 3 unmodified lines
749746 dir->i_ino, dentry, omode,
750747 MAJOR(rdev), MINOR(rdev));
751748
752− v9ses = v9fs_inode2v9ses(dir);
753749 dfid = v9fs_parent_fid(dentry);
754750 if (IS_ERR(dfid)) {
755751 err = PTR_ERR(dfid);
fs/binfmt_elf_fdpic.c+1−1
@@ -1359,7 +1359,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, · 1358 unmodified lines
13591359 SET_UID(psinfo->pr_uid, from_kuid_munged(cred->user_ns, cred->uid));
13601360 SET_GID(psinfo->pr_gid, from_kgid_munged(cred->user_ns, cred->gid));
13611361 rcu_read_unlock();
1362− strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname));
1362+ get_task_comm(psinfo->pr_fname, p);
13631363
13641364 return 0;
13651365 }
fs/btrfs/block-group.c+2−1
@@ -1559,7 +1559,8 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) · 1558 unmodified lines
15591559 * needing to allocate extents from the block group.
15601560 */
15611561 used = btrfs_space_info_used(space_info, true);
1562− if (space_info->total_bytes - block_group->length < used) {
1562+ if (space_info->total_bytes - block_group->length < used &&
1563+ block_group->zone_unusable < block_group->length) {
15631564 /*
15641565 * Add a reference for the list, compensate for the ref
15651566 * drop under the "next" label for the
fs/btrfs/extent_io.c+13−0
@@ -4333,6 +4333,19 @@ int read_extent_buffer_pages(struct extent_buffer *eb, int wait, int mirror_num, · 4332 unmodified lines
43334333 if (test_and_set_bit(EXTENT_BUFFER_READING, &eb->bflags))
43344334 goto done;
43354335
4336+ /*
4337+ * Between the initial test_bit(EXTENT_BUFFER_UPTODATE) and the above
4338+ * test_and_set_bit(EXTENT_BUFFER_READING), someone else could have
4339+ * started and finished reading the same eb. In this case, UPTODATE
4340+ * will now be set, and we shouldn't read it in again.
4341+ */
4342+ if (unlikely(test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))) {
4343+ clear_bit(EXTENT_BUFFER_READING, &eb->bflags);
4344+ smp_mb__after_atomic();
4345+ wake_up_bit(&eb->bflags, EXTENT_BUFFER_READING);
4346+ return 0;
4347+ }
4348+
43364349 clear_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags);
43374350 eb->read_mirror = 0;
43384351 check_buffer_tree_ref(eb);
fs/btrfs/extent_map.c+8−8
@@ -309,7 +309,7 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen) · 308 unmodified lines
309309 btrfs_warn(fs_info,
310310 "no extent map found for inode %llu (root %lld) when unpinning extent range [%llu, %llu), generation %llu",
311311 btrfs_ino(inode), btrfs_root_id(inode->root),
312− start, len, gen);
312+ start, start + len, gen);
313313 ret = -ENOENT;
314314 goto out;
315315 }
@@ -318,7 +318,7 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen) · 2 unmodified lines
318318 btrfs_warn(fs_info,
319319 "found extent map for inode %llu (root %lld) with unexpected start offset %llu when unpinning extent range [%llu, %llu), generation %llu",
320320 btrfs_ino(inode), btrfs_root_id(inode->root),
321− em->start, start, len, gen);
321+ em->start, start, start + len, gen);
322322 ret = -EUCLEAN;
323323 goto out;
324324 }
@@ -340,9 +340,9 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen) · 15 unmodified lines
340340 em->mod_len = em->len;
341341 }
342342
343− free_extent_map(em);
344343 out:
345344 write_unlock(&tree->lock);
345+ free_extent_map(em);
346346 return ret;
347347
348348 }
@@ -629,13 +629,13 @@ int btrfs_add_extent_mapping(struct btrfs_fs_info *fs_info, · 280 unmodified lines
629629 */
630630 ret = merge_extent_mapping(em_tree, existing,
631631 em, start);
632− if (ret) {
632+ if (WARN_ON(ret)) {
633633 free_extent_map(em);
634634 *em_in = NULL;
635− WARN_ONCE(ret,
636−"extent map merge error existing [%llu, %llu) with em [%llu, %llu) start %llu\n",
637− existing->start, existing->len,
638− orig_start, orig_len, start);
635+ btrfs_warn(fs_info,
636+"extent map merge error existing [%llu, %llu) with em [%llu, %llu) start %llu",
637+ existing->start, extent_map_end(existing),
638+ orig_start, orig_start + orig_len, start);
639639 }
640640 free_extent_map(existing);
641641 }
fs/btrfs/scrub.c+11−1
@@ -2812,7 +2812,17 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx, · 2811 unmodified lines
28122812 gen = btrfs_get_last_trans_committed(fs_info);
28132813
28142814 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
2815− bytenr = btrfs_sb_offset(i);
2815+ ret = btrfs_sb_log_location(scrub_dev, i, 0, &bytenr);
2816+ if (ret == -ENOENT)
2817+ break;
2818+
2819+ if (ret) {
2820+ spin_lock(&sctx->stat_lock);
2821+ sctx->stat.super_errors++;
2822+ spin_unlock(&sctx->stat_lock);
2823+ continue;
2824+ }
2825+
28162826 if (bytenr + BTRFS_SUPER_INFO_SIZE >
28172827 scrub_dev->commit_total_bytes)
28182828 break;
fs/btrfs/volumes.c+22−5
@@ -692,6 +692,16 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices, · 691 unmodified lines
692692 device->bdev = file_bdev(bdev_file);
693693 clear_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state);
694694
695+ if (device->devt != device->bdev->bd_dev) {
696+ btrfs_warn(NULL,
697+ "device %s maj:min changed from %d:%d to %d:%d",
698+ device->name->str, MAJOR(device->devt),
699+ MINOR(device->devt), MAJOR(device->bdev->bd_dev),
700+ MINOR(device->bdev->bd_dev));
701+
702+ device->devt = device->bdev->bd_dev;
703+ }
704+
695705 fs_devices->open_devices++;
696706 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) &&
697707 device->devid != BTRFS_DEV_REPLACE_DEVID) {
@@ -1174,23 +1184,30 @@ static int open_fs_devices(struct btrfs_fs_devices *fs_devices, · 476 unmodified lines
11741184 struct btrfs_device *device;
11751185 struct btrfs_device *latest_dev = NULL;
11761186 struct btrfs_device *tmp_device;
1187+ int ret = 0;
11771188
11781189 list_for_each_entry_safe(device, tmp_device, &fs_devices->devices,
11791190 dev_list) {
1180− int ret;
1191+ int ret2;
11811192
1182− ret = btrfs_open_one_device(fs_devices, device, flags, holder);
1183− if (ret == 0 &&
1193+ ret2 = btrfs_open_one_device(fs_devices, device, flags, holder);
1194+ if (ret2 == 0 &&
11841195 (!latest_dev || device->generation > latest_dev->generation)) {
11851196 latest_dev = device;
1186− } else if (ret == -ENODATA) {
1197+ } else if (ret2 == -ENODATA) {
11871198 fs_devices->num_devices--;
11881199 list_del(&device->dev_list);
11891200 btrfs_free_device(device);
11901201 }
1202+ if (ret == 0 && ret2 != 0)
1203+ ret = ret2;
11911204 }
1192− if (fs_devices->open_devices == 0)
1205+
1206+ if (fs_devices->open_devices == 0) {
1207+ if (ret)
1208+ return ret;
11931209 return -EINVAL;
1210+ }
11941211
11951212 fs_devices->opened = 1;
11961213 fs_devices->latest_dev = latest_dev;
fs/btrfs/zoned.c+7−7
@@ -1574,11 +1574,7 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new) · 1573 unmodified lines
15741574 if (!map)
15751575 return -EINVAL;
15761576
1577− cache->physical_map = btrfs_clone_chunk_map(map, GFP_NOFS);
1578− if (!cache->physical_map) {
1579− ret = -ENOMEM;
1580− goto out;
1581− }
1577+ cache->physical_map = map;
15821578
15831579 zone_info = kcalloc(map->num_stripes, sizeof(*zone_info), GFP_NOFS);
15841580 if (!zone_info) {
@@ -1690,7 +1686,6 @@ out: · 105 unmodified lines
16901686 }
16911687 bitmap_free(active);
16921688 kfree(zone_info);
1693− btrfs_free_chunk_map(map);
16941689
16951690 return ret;
16961691 }
@@ -2175,6 +2170,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ · 478 unmodified lines
21752170 struct btrfs_chunk_map *map;
21762171 const bool is_metadata = (block_group->flags &
21772172 (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_SYSTEM));
2173+ struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace;
21782174 int ret = 0;
21792175 int i;
21802176
@@ -2250,6 +2246,7 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ · 69 unmodified lines
22502246 btrfs_clear_data_reloc_bg(block_group);
22512247 spin_unlock(&block_group->lock);
22522248
2249+ down_read(&dev_replace->rwsem);
22532250 map = block_group->physical_map;
22542251 for (i = 0; i < map->num_stripes; i++) {
22552252 struct btrfs_device *device = map->stripes[i].dev;
@@ -2266,13 +2263,16 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ · 10 unmodified lines
22662263 zinfo->zone_size >> SECTOR_SHIFT);
22672264 memalloc_nofs_restore(nofs_flags);
22682265
2269− if (ret)
2266+ if (ret) {
2267+ up_read(&dev_replace->rwsem);
22702268 return ret;
2269+ }
22712270
22722271 if (!(block_group->flags & BTRFS_BLOCK_GROUP_DATA))
22732272 zinfo->reserved_active_zones++;
22742273 btrfs_dev_clear_active_zone(device, physical);
22752274 }
2275+ up_read(&dev_replace->rwsem);
22762276
22772277 if (!fully_written)
22782278 btrfs_dec_block_group_ro(block_group);
fs/erofs/super.c+0−1
@@ -430,7 +430,6 @@ static bool erofs_fc_set_dax_mode(struct fs_context *fc, unsigned int mode) · 429 unmodified lines
430430
431431 switch (mode) {
432432 case EROFS_MOUNT_DAX_ALWAYS:
433− warnfc(fc, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
434433 set_opt(&ctx->opt, DAX_ALWAYS);
435434 clear_opt(&ctx->opt, DAX_NEVER);
436435 return true;
fs/exec.c+1−0
@@ -895,6 +895,7 @@ int transfer_args_to_stack(struct linux_binprm *bprm, · 894 unmodified lines
895895 goto out;
896896 }
897897
898+ bprm->exec += *sp_location - MAX_ARG_PAGES * PAGE_SIZE;
898899 *sp_location = sp;
899900
900901 out:
fs/gfs2/bmap.c+3−2
@@ -1718,7 +1718,8 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length) · 1717 unmodified lines
17181718 struct buffer_head *dibh, *bh;
17191719 struct gfs2_holder rd_gh;
17201720 unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift;
1721− u64 lblock = (offset + (1 << bsize_shift) - 1) >> bsize_shift;
1721+ unsigned int bsize = 1 << bsize_shift;
1722+ u64 lblock = (offset + bsize - 1) >> bsize_shift;
17221723 __u16 start_list[GFS2_MAX_META_HEIGHT];
17231724 __u16 __end_list[GFS2_MAX_META_HEIGHT], *end_list = NULL;
17241725 unsigned int start_aligned, end_aligned;
@@ -1729,7 +1730,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length) · 4 unmodified lines
17291730 u64 prev_bnr = 0;
17301731 __be64 *start, *end;
17311732
1732− if (offset >= maxsize) {
1733+ if (offset + bsize - 1 >= maxsize) {
17331734 /*
17341735 * The starting point lies beyond the allocated metadata;
17351736 * there are no blocks to deallocate.
fs/nfsd/nfs4state.c+25−11
@@ -3831,15 +3831,20 @@ nfsd4_create_session(struct svc_rqst *rqstp, · 3830 unmodified lines
38313831 else
38323832 cs_slot = &unconf->cl_cs_slot;
38333833 status = check_slot_seqid(cr_ses->seqid, cs_slot->sl_seqid, 0);
3834− if (status) {
3835− if (status == nfserr_replay_cache) {
3836− status = nfsd4_replay_create_session(cr_ses, cs_slot);
3837− goto out_free_conn;
3838− }
3834+ switch (status) {
3835+ case nfs_ok:
3836+ cs_slot->sl_seqid++;
3837+ cr_ses->seqid = cs_slot->sl_seqid;
3838+ break;
3839+ case nfserr_replay_cache:
3840+ status = nfsd4_replay_create_session(cr_ses, cs_slot);
3841+ fallthrough;
3842+ case nfserr_jukebox:
3843+ /* The server MUST NOT cache NFS4ERR_DELAY */
3844+ goto out_free_conn;
3845+ default:
38393846 goto out_cache_error;
38403847 }
3841− cs_slot->sl_seqid++;
3842− cr_ses->seqid = cs_slot->sl_seqid;
38433848
38443849 /* RFC 8881 Section 18.36.4 Phase 3: Client ID confirmation. */
38453850 if (conf) {
@@ -3859,10 +3864,8 @@ nfsd4_create_session(struct svc_rqst *rqstp, · 13 unmodified lines
38593864 old = find_confirmed_client_by_name(&unconf->cl_name, nn);
38603865 if (old) {
38613866 status = mark_client_expired_locked(old);
3862− if (status) {
3863− old = NULL;
3864− goto out_cache_error;
3865− }
3867+ if (status)
3868+ goto out_expired_error;
38663869 trace_nfsd_clid_replaced(&old->cl_clientid);
38673870 }
38683871 move_to_confirmed(unconf);
@@ -3894,6 +3897,17 @@ nfsd4_create_session(struct svc_rqst *rqstp, · 25 unmodified lines
38943897 expire_client(old);
38953898 return status;
38963899
3900+out_expired_error:
3901+ old = NULL;
3902+ /*
3903+ * Revert the slot seq_nr change so the server will process
3904+ * the client's resend instead of returning a cached response.
3905+ */
3906+ if (status == nfserr_jukebox) {
3907+ cs_slot->sl_seqid--;
3908+ cr_ses->seqid = cs_slot->sl_seqid;
3909+ goto out_free_conn;
3910+ }
38973911 out_cache_error:
38983912 nfsd4_cache_create_session(cr_ses, cs_slot, status);
38993913 out_free_conn:
fs/nfsd/vfs.c+2−1
@@ -1852,7 +1852,7 @@ retry: · 1851 unmodified lines
18521852 trap = lock_rename(tdentry, fdentry);
18531853 if (IS_ERR(trap)) {
18541854 err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
1855− goto out;
1855+ goto out_want_write;
18561856 }
18571857 err = fh_fill_pre_attrs(ffhp);
18581858 if (err != nfs_ok)
@@ -1922,6 +1922,7 @@ retry: · 63 unmodified lines
19221922 }
19231923 out_unlock:
19241924 unlock_rename(tdentry, fdentry);
1925+out_want_write:
19251926 fh_drop_write(ffhp);
19261927
19271928 /*
fs/proc/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 obj-y += proc.o
77
8−CFLAGS_task_mmu.o += $(call cc-option,-Wno-override-init,)
8+CFLAGS_task_mmu.o += -Wno-override-init
99 proc-y := nommu.o task_nommu.o
1010 proc-$(CONFIG_MMU) := task_mmu.o
1111
fs/smb/client/dir.c+7−0
@@ -612,11 +612,18 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode, · 611 unmodified lines
612612 goto mknod_out;
613613 }
614614
615+ trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, full_path);
616+
615617 rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon,
616618 full_path, mode,
617619 device_number);
618620
619621 mknod_out:
622+ if (rc)
623+ trace_smb3_mknod_err(xid, tcon->ses->Suid, tcon->tid, rc);
624+ else
625+ trace_smb3_mknod_done(xid, tcon->ses->Suid, tcon->tid);
626+
620627 free_dentry_path(page);
621628 free_xid(xid);
622629 cifs_put_tlink(tlink);
fs/smb/client/fscache.c+15−1
@@ -12,6 +12,16 @@ · 11 unmodified lines
1212 #include "cifs_fs_sb.h"
1313 #include "cifsproto.h"
1414
15+/*
16+ * Key for fscache inode. [!] Contents must match comparisons in cifs_find_inode().
17+ */
18+struct cifs_fscache_inode_key {
19+
20+ __le64 uniqueid; /* server inode number */
21+ __le64 createtime; /* creation time on server */
22+ u8 type; /* S_IFMT file type */
23+} __packed;
24+
1525 static void cifs_fscache_fill_volume_coherency(
1626 struct cifs_tcon *tcon,
1727 struct cifs_fscache_volume_coherency_data *cd)
@@ -97,15 +107,19 @@ void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) · 79 unmodified lines
97107 void cifs_fscache_get_inode_cookie(struct inode *inode)
98108 {
99109 struct cifs_fscache_inode_coherency_data cd;
110+ struct cifs_fscache_inode_key key;
100111 struct cifsInodeInfo *cifsi = CIFS_I(inode);
101112 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
102113 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
103114
115+ key.uniqueid = cpu_to_le64(cifsi->uniqueid);
116+ key.createtime = cpu_to_le64(cifsi->createtime);
117+ key.type = (inode->i_mode & S_IFMT) >> 12;
104118 cifs_fscache_fill_coherency(&cifsi->netfs.inode, &cd);
105119
106120 cifsi->netfs.cache =
107121 fscache_acquire_cookie(tcon->fscache, 0,
108− &cifsi->uniqueid, sizeof(cifsi->uniqueid),
122+ &key, sizeof(key),
109123 &cd, sizeof(cd),
110124 i_size_read(&cifsi->netfs.inode));
111125 if (cifsi->netfs.cache)
fs/smb/client/inode.c+2−0
@@ -1351,6 +1351,8 @@ cifs_find_inode(struct inode *inode, void *opaque) · 1350 unmodified lines
13511351 {
13521352 struct cifs_fattr *fattr = opaque;
13531353
1354+ /* [!] The compared values must be the same in struct cifs_fscache_inode_key. */
1355+
13541356 /* don't match inode with different uniqueid */
13551357 if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
13561358 return 0;
fs/smb/client/trace.h+3−1
@@ -375,6 +375,7 @@ DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(get_reparse_compound_enter); · 374 unmodified lines
375375 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(delete_enter);
376376 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mkdir_enter);
377377 DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(tdis_enter);
378+DEFINE_SMB3_INF_COMPOUND_ENTER_EVENT(mknod_enter);
378379
379380 DECLARE_EVENT_CLASS(smb3_inf_compound_done_class,
380381 TP_PROTO(unsigned int xid,
@@ -415,7 +416,7 @@ DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(query_wsl_ea_compound_done); · 34 unmodified lines
415416 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(delete_done);
416417 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mkdir_done);
417418 DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(tdis_done);
418−
419+DEFINE_SMB3_INF_COMPOUND_DONE_EVENT(mknod_done);
419420
420421 DECLARE_EVENT_CLASS(smb3_inf_compound_err_class,
421422 TP_PROTO(unsigned int xid,
@@ -461,6 +462,7 @@ DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(query_wsl_ea_compound_err); · 39 unmodified lines
461462 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mkdir_err);
462463 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(delete_err);
463464 DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(tdis_err);
465+DEFINE_SMB3_INF_COMPOUND_ERR_EVENT(mknod_err);
464466
465467 /*
466468 * For logging SMB3 Status code and Command for responses which return errors
fs/xfs/libxfs/xfs_sb.c+31−9
@@ -530,7 +530,8 @@ xfs_validate_sb_common( · 529 unmodified lines
530530 }
531531
532532 if (!xfs_validate_stripe_geometry(mp, XFS_FSB_TO_B(mp, sbp->sb_unit),
533− XFS_FSB_TO_B(mp, sbp->sb_width), 0, false))
533+ XFS_FSB_TO_B(mp, sbp->sb_width), 0,
534+ xfs_buf_daddr(bp) == XFS_SB_DADDR, false))
534535 return -EFSCORRUPTED;
535536
536537 /*
@@ -1323,8 +1324,10 @@ xfs_sb_get_secondary( · 786 unmodified lines
13231324 }
13241325
13251326 /*
1326− * sunit, swidth, sectorsize(optional with 0) should be all in bytes,
1327− * so users won't be confused by values in error messages.
1327+ * sunit, swidth, sectorsize(optional with 0) should be all in bytes, so users
1328+ * won't be confused by values in error messages. This function returns false
1329+ * if the stripe geometry is invalid and the caller is unable to repair the
1330+ * stripe configuration later in the mount process.
13281331 */
13291332 bool
13301333 xfs_validate_stripe_geometry(
@@ -1332,20 +1335,21 @@ xfs_validate_stripe_geometry( · 1 unmodified line
13321335 __s64 sunit,
13331336 __s64 swidth,
13341337 int sectorsize,
1338+ bool may_repair,
13351339 bool silent)
13361340 {
13371341 if (swidth > INT_MAX) {
13381342 if (!silent)
13391343 xfs_notice(mp,
13401344 "stripe width (%lld) is too large", swidth);
1341− return false;
1345+ goto check_override;
13421346 }
13431347
13441348 if (sunit > swidth) {
13451349 if (!silent)
13461350 xfs_notice(mp,
13471351 "stripe unit (%lld) is larger than the stripe width (%lld)", sunit, swidth);
1348− return false;
1352+ goto check_override;
13491353 }
13501354
13511355 if (sectorsize && (int)sunit % sectorsize) {
@@ -1353,21 +1357,21 @@ xfs_validate_stripe_geometry( · 1 unmodified line
13531357 xfs_notice(mp,
13541358 "stripe unit (%lld) must be a multiple of the sector size (%d)",
13551359 sunit, sectorsize);
1356− return false;
1360+ goto check_override;
13571361 }
13581362
13591363 if (sunit && !swidth) {
13601364 if (!silent)
13611365 xfs_notice(mp,
13621366 "invalid stripe unit (%lld) and stripe width of 0", sunit);
1363− return false;
1367+ goto check_override;
13641368 }
13651369
13661370 if (!sunit && swidth) {
13671371 if (!silent)
13681372 xfs_notice(mp,
13691373 "invalid stripe width (%lld) and stripe unit of 0", swidth);
1370− return false;
1374+ goto check_override;
13711375 }
13721376
13731377 if (sunit && (int)swidth % (int)sunit) {
@@ -1375,9 +1379,27 @@ xfs_validate_stripe_geometry( · 1 unmodified line
13751379 xfs_notice(mp,
13761380 "stripe width (%lld) must be a multiple of the stripe unit (%lld)",
13771381 swidth, sunit);
1378− return false;
1382+ goto check_override;
13791383 }
13801384 return true;
1385+
1386+check_override:
1387+ if (!may_repair)
1388+ return false;
1389+ /*
1390+ * During mount, mp->m_dalign will not be set unless the sunit mount
1391+ * option was set. If it was set, ignore the bad stripe alignment values
1392+ * and allow the validation and overwrite later in the mount process to
1393+ * attempt to overwrite the bad stripe alignment values with the values
1394+ * supplied by mount options.
1395+ */
1396+ if (!mp->m_dalign)
1397+ return false;
1398+ if (!silent)
1399+ xfs_notice(mp,
1400+"Will try to correct with specified mount options sunit (%d) and swidth (%d)",
1401+ BBTOB(mp->m_dalign), BBTOB(mp->m_swidth));
1402+ return true;
13811403 }
13821404
13831405 /*
fs/xfs/libxfs/xfs_sb.h+3−2
@@ -35,8 +35,9 @@ extern int xfs_sb_get_secondary(struct xfs_mount *mp, · 34 unmodified lines
3535 struct xfs_trans *tp, xfs_agnumber_t agno,
3636 struct xfs_buf **bpp);
3737
38−extern bool xfs_validate_stripe_geometry(struct xfs_mount *mp,
39− __s64 sunit, __s64 swidth, int sectorsize, bool silent);
38+bool xfs_validate_stripe_geometry(struct xfs_mount *mp,
39+ __s64 sunit, __s64 swidth, int sectorsize, bool may_repair,
40+ bool silent);
4041
4142 uint8_t xfs_compute_rextslog(xfs_rtbxlen_t rtextents);
4243
fs/xfs/scrub/common.c+1−3
@@ -1044,9 +1044,7 @@ xchk_irele( · 1043 unmodified lines
10441044 struct xfs_scrub *sc,
10451045 struct xfs_inode *ip)
10461046 {
1047− if (current->journal_info != NULL) {
1048− ASSERT(current->journal_info == sc->tp);
1049−
1047+ if (sc->tp) {
10501048 /*
10511049 * If we are in a transaction, we /cannot/ drop the inode
10521050 * ourselves, because the VFS will trigger writeback, which
fs/xfs/xfs_aops.c+0−7
@@ -503,13 +503,6 @@ xfs_vm_writepages( · 502 unmodified lines
503503 {
504504 struct xfs_writepage_ctx wpc = { };
505505
506− /*
507− * Writing back data in a transaction context can result in recursive
508− * transactions. This is bad, so issue a warning and get out of here.
509− */
510− if (WARN_ON_ONCE(current->journal_info))
511− return 0;
512−
513506 xfs_iflags_clear(XFS_I(mapping->host), XFS_ITRUNCATED);
514507 return iomap_writepages(mapping, wbc, &wpc.ctx, &xfs_writeback_ops);
515508 }
fs/xfs/xfs_icache.c+5−3
@@ -2039,8 +2039,10 @@ xfs_inodegc_want_queue_work( · 2038 unmodified lines
20392039 * - Memory shrinkers queued the inactivation worker and it hasn't finished.
20402040 * - The queue depth exceeds the maximum allowable percpu backlog.
20412041 *
2042− * Note: If the current thread is running a transaction, we don't ever want to
2043− * wait for other transactions because that could introduce a deadlock.
2042+ * Note: If we are in a NOFS context here (e.g. current thread is running a
2043+ * transaction) the we don't want to block here as inodegc progress may require
2044+ * filesystem resources we hold to make progress and that could result in a
2045+ * deadlock. Hence we skip out of here if we are in a scoped NOFS context.
20442046 */
20452047 static inline bool
20462048 xfs_inodegc_want_flush_work(
@@ -2048,7 +2050,7 @@ xfs_inodegc_want_flush_work( · 1 unmodified line
20482050 unsigned int items,
20492051 unsigned int shrinker_hits)
20502052 {
2051− if (current->journal_info)
2053+ if (current->flags & PF_MEMALLOC_NOFS)
20522054 return false;
20532055
20542056 if (shrinker_hits > 0)
fs/xfs/xfs_trans.h+1−8
@@ -268,19 +268,14 @@ static inline void · 267 unmodified lines
268268 xfs_trans_set_context(
269269 struct xfs_trans *tp)
270270 {
271− ASSERT(current->journal_info == NULL);
272271 tp->t_pflags = memalloc_nofs_save();
273− current->journal_info = tp;
274272 }
275273
276274 static inline void
277275 xfs_trans_clear_context(
278276 struct xfs_trans *tp)
279277 {
280− if (current->journal_info == tp) {
281− memalloc_nofs_restore(tp->t_pflags);
282− current->journal_info = NULL;
283− }
278+ memalloc_nofs_restore(tp->t_pflags);
284279 }
285280
286281 static inline void
@@ -288,10 +283,8 @@ xfs_trans_switch_context( · 1 unmodified line
288283 struct xfs_trans *old_tp,
289284 struct xfs_trans *new_tp)
290285 {
291− ASSERT(current->journal_info == old_tp);
292286 new_tp->t_pflags = old_tp->t_pflags;
293287 old_tp->t_pflags = 0;
294− current->journal_info = new_tp;
295288 }
296289
297290 #endif /* __XFS_TRANS_H__ */
include/asm-generic/export.h+0−11
@@ -1,11 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−#ifndef __ASM_GENERIC_EXPORT_H
3−#define __ASM_GENERIC_EXPORT_H
4−
5−/*
6− * <asm/export.h> and <asm-generic/export.h> are deprecated.
7− * Please include <linux/export.h> directly.
8− */
9−#include <linux/export.h>
10−
11−#endif
include/linux/framer/framer.h+2−2
@@ -181,12 +181,12 @@ static inline int framer_notifier_unregister(struct framer *framer, · 180 unmodified lines
181181 return -ENOSYS;
182182 }
183183
184−struct framer *framer_get(struct device *dev, const char *con_id)
184+static inline struct framer *framer_get(struct device *dev, const char *con_id)
185185 {
186186 return ERR_PTR(-ENOSYS);
187187 }
188188
189−void framer_put(struct device *dev, struct framer *framer)
189+static inline void framer_put(struct device *dev, struct framer *framer)
190190 {
191191 }
192192
include/linux/gpio/driver.h+15−2
@@ -646,8 +646,6 @@ int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, · 645 unmodified lines
646646 struct gpio_device *gpio_device_find(const void *data,
647647 int (*match)(struct gpio_chip *gc,
648648 const void *data));
649−struct gpio_device *gpio_device_find_by_label(const char *label);
650−struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode);
651649
652650 struct gpio_device *gpio_device_get(struct gpio_device *gdev);
653651 void gpio_device_put(struct gpio_device *gdev);
@@ -814,6 +812,9 @@ struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc); · 160 unmodified lines
814812 int gpio_device_get_base(struct gpio_device *gdev);
815813 const char *gpio_device_get_label(struct gpio_device *gdev);
816814
815+struct gpio_device *gpio_device_find_by_label(const char *label);
816+struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode);
817+
817818 #else /* CONFIG_GPIOLIB */
818819
819820 #include <asm/bug.h>
@@ -843,6 +844,18 @@ static inline const char *gpio_device_get_label(struct gpio_device *gdev) · 23 unmodified lines
843844 return NULL;
844845 }
845846
847+static inline struct gpio_device *gpio_device_find_by_label(const char *label)
848+{
849+ WARN_ON(1);
850+ return NULL;
851+}
852+
853+static inline struct gpio_device *gpio_device_find_by_fwnode(const struct fwnode_handle *fwnode)
854+{
855+ WARN_ON(1);
856+ return NULL;
857+}
858+
846859 static inline int gpiochip_lock_as_irq(struct gpio_chip *gc,
847860 unsigned int offset)
848861 {
include/linux/interrupt.h+3−0
@@ -67,6 +67,8 @@ · 66 unmodified lines
6767 * later.
6868 * IRQF_NO_DEBUG - Exclude from runnaway detection for IPI and similar handlers,
6969 * depends on IRQF_PERCPU.
70+ * IRQF_COND_ONESHOT - Agree to do IRQF_ONESHOT if already set for a shared
71+ * interrupt.
7072 */
7173 #define IRQF_SHARED 0x00000080
7274 #define IRQF_PROBE_SHARED 0x00000100
@@ -82,6 +84,7 @@ · 9 unmodified lines
8284 #define IRQF_COND_SUSPEND 0x00040000
8385 #define IRQF_NO_AUTOEN 0x00080000
8486 #define IRQF_NO_DEBUG 0x00100000
87+#define IRQF_COND_ONESHOT 0x00200000
8588
8689 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
8790
include/linux/libata.h+1−0
@@ -107,6 +107,7 @@ enum { · 106 unmodified lines
107107
108108 ATA_DFLAG_NCQ_PRIO_ENABLED = (1 << 20), /* Priority cmds sent to dev */
109109 ATA_DFLAG_CDL_ENABLED = (1 << 21), /* cmd duration limits is enabled */
110+ ATA_DFLAG_RESUMING = (1 << 22), /* Device is resuming */
110111 ATA_DFLAG_DETACH = (1 << 24),
111112 ATA_DFLAG_DETACHED = (1 << 25),
112113 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
include/linux/mman.h+8−0
@@ -162,6 +162,14 @@ calc_vm_flag_bits(unsigned long flags) · 161 unmodified lines
162162
163163 unsigned long vm_commit_limit(void);
164164
165+#ifndef arch_memory_deny_write_exec_supported
166+static inline bool arch_memory_deny_write_exec_supported(void)
167+{
168+ return true;
169+}
170+#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
171+#endif
172+
165173 /*
166174 * Denies creating a writable executable mapping or gaining executable permissions.
167175 *
include/linux/oid_registry.h+4−0
@@ -17,10 +17,12 @@ · 16 unmodified lines
1717 * build_OID_registry.pl to generate the data for look_up_OID().
1818 */
1919 enum OID {
20+ OID_id_dsa_with_sha1, /* 1.2.840.10030.4.3 */
2021 OID_id_dsa, /* 1.2.840.10040.4.1 */
2122 OID_id_ecPublicKey, /* 1.2.840.10045.2.1 */
2223 OID_id_prime192v1, /* 1.2.840.10045.3.1.1 */
2324 OID_id_prime256v1, /* 1.2.840.10045.3.1.7 */
25+ OID_id_ecdsa_with_sha1, /* 1.2.840.10045.4.1 */
2426 OID_id_ecdsa_with_sha224, /* 1.2.840.10045.4.3.1 */
2527 OID_id_ecdsa_with_sha256, /* 1.2.840.10045.4.3.2 */
2628 OID_id_ecdsa_with_sha384, /* 1.2.840.10045.4.3.3 */
@@ -28,6 +30,7 @@ enum OID { · 1 unmodified line
2830
2931 /* PKCS#1 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)} */
3032 OID_rsaEncryption, /* 1.2.840.113549.1.1.1 */
33+ OID_sha1WithRSAEncryption, /* 1.2.840.113549.1.1.5 */
3134 OID_sha256WithRSAEncryption, /* 1.2.840.113549.1.1.11 */
3235 OID_sha384WithRSAEncryption, /* 1.2.840.113549.1.1.12 */
3336 OID_sha512WithRSAEncryption, /* 1.2.840.113549.1.1.13 */
@@ -64,6 +67,7 @@ enum OID { · 30 unmodified lines
6467 OID_PKU2U, /* 1.3.5.1.5.2.7 */
6568 OID_Scram, /* 1.3.6.1.5.5.14 */
6669 OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */
70+ OID_sha1, /* 1.3.14.3.2.26 */
6771 OID_id_ansip384r1, /* 1.3.132.0.34 */
6872 OID_sha256, /* 2.16.840.1.101.3.4.2.1 */
6973 OID_sha384, /* 2.16.840.1.101.3.4.2.2 */
include/linux/pagevec.h+2−2
@@ -11,8 +11,8 @@ · 10 unmodified lines
1111
1212 #include <linux/types.h>
1313
14−/* 15 pointers + header align the folio_batch structure to a power of two */
15−#define PAGEVEC_SIZE 15
14+/* 31 pointers + header align the folio_batch structure to a power of two */
15+#define PAGEVEC_SIZE 31
1616
1717 struct folio;
1818
include/linux/skbuff.h+1−6
@@ -753,8 +753,6 @@ typedef unsigned char *sk_buff_data_t; · 752 unmodified lines
753753 * @list: queue head
754754 * @ll_node: anchor in an llist (eg socket defer_list)
755755 * @sk: Socket we are owned by
756− * @ip_defrag_offset: (aka @sk) alternate use of @sk, used in
757− * fragmentation management
758756 * @dev: Device we arrived on/are leaving by
759757 * @dev_scratch: (aka @dev) alternate use of @dev when @dev would be %NULL
760758 * @cb: Control buffer. Free for use by every layer. Put private vars here
@@ -875,10 +873,7 @@ struct sk_buff { · 114 unmodified lines
875873 struct llist_node ll_node;
876874 };
877875
878− union {
879− struct sock *sk;
880− int ip_defrag_offset;
881− };
876+ struct sock *sk;
882877
883878 union {
884879 ktime_t tstamp;
include/net/cfg80211.h+2−0
@@ -4991,6 +4991,7 @@ struct cfg80211_ops { · 4990 unmodified lines
49914991 * set this flag to update channels on beacon hints.
49924992 * @WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY: support connection to non-primary link
49934993 * of an NSTR mobile AP MLD.
4994+ * @WIPHY_FLAG_DISABLE_WEXT: disable wireless extensions for this device
49944995 */
49954996 enum wiphy_flags {
49964997 WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0),
@@ -5002,6 +5003,7 @@ enum wiphy_flags { · 5 unmodified lines
50025003 WIPHY_FLAG_4ADDR_STATION = BIT(6),
50035004 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
50045005 WIPHY_FLAG_IBSS_RSN = BIT(8),
5006+ WIPHY_FLAG_DISABLE_WEXT = BIT(9),
50055007 WIPHY_FLAG_MESH_AUTH = BIT(10),
50065008 WIPHY_FLAG_SUPPORTS_EXT_KCK_32 = BIT(11),
50075009 WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY = BIT(12),
include/net/inet_connection_sock.h+1−0
@@ -175,6 +175,7 @@ void inet_csk_init_xmit_timers(struct sock *sk, · 174 unmodified lines
175175 void (*delack_handler)(struct timer_list *),
176176 void (*keepalive_handler)(struct timer_list *));
177177 void inet_csk_clear_xmit_timers(struct sock *sk);
178+void inet_csk_clear_xmit_timers_sync(struct sock *sk);
178179
179180 static inline void inet_csk_schedule_ack(struct sock *sk)
180181 {
include/net/sock.h+7−0
@@ -1759,6 +1759,13 @@ static inline void sock_owned_by_me(const struct sock *sk) · 1758 unmodified lines
17591759 #endif
17601760 }
17611761
1762+static inline void sock_not_owned_by_me(const struct sock *sk)
1763+{
1764+#ifdef CONFIG_LOCKDEP
1765+ WARN_ON_ONCE(lockdep_sock_is_held(sk) && debug_locks);
1766+#endif
1767+}
1768+
17621769 static inline bool sock_owned_by_user(const struct sock *sk)
17631770 {
17641771 sock_owned_by_me(sk);
include/net/xdp_sock.h+2−0
@@ -188,6 +188,8 @@ static inline void xsk_tx_metadata_complete(struct xsk_tx_metadata_compl *compl, · 187 unmodified lines
188188 {
189189 if (!compl)
190190 return;
191+ if (!compl->tx_timestamp)
192+ return;
191193
192194 *compl->tx_timestamp = ops->tmo_fill_timestamp(priv);
193195 }
include/scsi/scsi_driver.h+1−0
@@ -12,6 +12,7 @@ struct request; · 11 unmodified lines
1212 struct scsi_driver {
1313 struct device_driver gendrv;
1414
15+ int (*resume)(struct device *);
1516 void (*rescan)(struct device *);
1617 blk_status_t (*init_command)(struct scsi_cmnd *);
1718 void (*uninit_command)(struct scsi_cmnd *);
include/scsi/scsi_host.h+1−0
@@ -767,6 +767,7 @@ scsi_template_proc_dir(const struct scsi_host_template *sht); · 766 unmodified lines
767767 #define scsi_template_proc_dir(sht) NULL
768768 #endif
769769 extern void scsi_scan_host(struct Scsi_Host *);
770+extern int scsi_resume_device(struct scsi_device *sdev);
770771 extern int scsi_rescan_device(struct scsi_device *sdev);
771772 extern void scsi_remove_host(struct Scsi_Host *);
772773 extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
include/sound/intel-nhlt.h+10−0
@@ -143,6 +143,9 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, · 142 unmodified lines
143143 u32 bus_id, u8 link_type, u8 vbps, u8 bps,
144144 u8 num_ch, u32 rate, u8 dir, u8 dev_type);
145145
146+int intel_nhlt_ssp_device_type(struct device *dev, struct nhlt_acpi_table *nhlt,
147+ u8 virtual_bus_id);
148+
146149 #else
147150
148151 static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
@@ -184,6 +187,13 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, · 35 unmodified lines
184187 return NULL;
185188 }
186189
190+static inline int intel_nhlt_ssp_device_type(struct device *dev,
191+ struct nhlt_acpi_table *nhlt,
192+ u8 virtual_bus_id)
193+{
194+ return -EINVAL;
195+}
196+
187197 #endif
188198
189199 #endif
include/uapi/linux/kfd_ioctl.h+14−3
@@ -913,14 +913,25 @@ enum kfd_dbg_trap_exception_code { · 912 unmodified lines
913913 KFD_EC_MASK(EC_DEVICE_NEW))
914914 #define KFD_EC_MASK_PROCESS (KFD_EC_MASK(EC_PROCESS_RUNTIME) | \
915915 KFD_EC_MASK(EC_PROCESS_DEVICE_REMOVE))
916+#define KFD_EC_MASK_PACKET (KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_DIM_INVALID) | \
917+ KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID) | \
918+ KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_CODE_INVALID) | \
919+ KFD_EC_MASK(EC_QUEUE_PACKET_RESERVED) | \
920+ KFD_EC_MASK(EC_QUEUE_PACKET_UNSUPPORTED) | \
921+ KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID) | \
922+ KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID) | \
923+ KFD_EC_MASK(EC_QUEUE_PACKET_VENDOR_UNSUPPORTED))
916924
917925 /* Checks for exception code types for KFD search */
926+#define KFD_DBG_EC_IS_VALID(ecode) (ecode > EC_NONE && ecode < EC_MAX)
918927 #define KFD_DBG_EC_TYPE_IS_QUEUE(ecode) \
919− (!!(KFD_EC_MASK(ecode) & KFD_EC_MASK_QUEUE))
928+ (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_QUEUE))
920929 #define KFD_DBG_EC_TYPE_IS_DEVICE(ecode) \
921− (!!(KFD_EC_MASK(ecode) & KFD_EC_MASK_DEVICE))
930+ (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_DEVICE))
922931 #define KFD_DBG_EC_TYPE_IS_PROCESS(ecode) \
923− (!!(KFD_EC_MASK(ecode) & KFD_EC_MASK_PROCESS))
932+ (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_PROCESS))
933+#define KFD_DBG_EC_TYPE_IS_PACKET(ecode) \
934+ (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_PACKET))
924935
925936
926937 /* Runtime enable states */
include/uapi/scsi/scsi_bsg_mpi3mr.h+1−1
@@ -382,7 +382,7 @@ struct mpi3mr_bsg_in_reply_buf { · 381 unmodified lines
382382 __u8 mpi_reply_type;
383383 __u8 rsvd1;
384384 __u16 rsvd2;
385− __u8 reply_buf[1];
385+ __u8 reply_buf[];
386386 };
387387
388388 /**
include/ufs/ufshcd.h+1−0
@@ -328,6 +328,7 @@ struct ufs_pwr_mode_info { · 327 unmodified lines
328328 * @op_runtime_config: called to config Operation and runtime regs Pointers
329329 * @get_outstanding_cqs: called to get outstanding completion queues
330330 * @config_esi: called to config Event Specific Interrupt
331+ * @config_scsi_dev: called to configure SCSI device parameters
331332 */
332333 struct ufs_hba_variant_ops {
333334 const char *name;
init/initramfs.c+1−1
@@ -682,7 +682,7 @@ static void __init populate_initrd_image(char *err) · 681 unmodified lines
682682
683683 printk(KERN_INFO "rootfs image is not initramfs (%s); looks like an initrd\n",
684684 err);
685− file = filp_open("/initrd.image", O_WRONLY | O_CREAT, 0700);
685+ file = filp_open("/initrd.image", O_WRONLY|O_CREAT|O_LARGEFILE, 0700);
686686 if (IS_ERR(file))
687687 return;
688688
kernel/bpf/Makefile+1−1
@@ -4,7 +4,7 @@ ifneq ($(CONFIG_BPF_JIT_ALWAYS_ON),y) · 3 unmodified lines
44 # ___bpf_prog_run() needs GCSE disabled on x86; see 3193c0836f203 for details
55 cflags-nogcse-$(CONFIG_X86)$(CONFIG_CC_IS_GCC) := -fno-gcse
66 endif
7−CFLAGS_core.o += $(call cc-disable-warning, override-init) $(cflags-nogcse-yy)
7+CFLAGS_core.o += -Wno-override-init $(cflags-nogcse-yy)
88
99 obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o log.o token.o
1010 obj-$(CONFIG_BPF_SYSCALL) += bpf_iter.o map_iter.o task_iter.o prog_iter.o link_iter.o
kernel/bpf/arena.c+18−7
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838
3939 /* number of bytes addressable by LDX/STX insn with 16-bit 'off' field */
4040 #define GUARD_SZ (1ull << sizeof(((struct bpf_insn *)0)->off) * 8)
41−#define KERN_VM_SZ ((1ull << 32) + GUARD_SZ)
41+#define KERN_VM_SZ (SZ_4G + GUARD_SZ)
4242
4343 struct bpf_arena {
4444 struct bpf_map map;
@@ -110,7 +110,7 @@ static struct bpf_map *arena_map_alloc(union bpf_attr *attr) · 65 unmodified lines
110110 return ERR_PTR(-EINVAL);
111111
112112 vm_range = (u64)attr->max_entries * PAGE_SIZE;
113− if (vm_range > (1ull << 32))
113+ if (vm_range > SZ_4G)
114114 return ERR_PTR(-E2BIG);
115115
116116 if ((attr->map_extra >> 32) != ((attr->map_extra + vm_range - 1) >> 32))
@@ -301,7 +301,7 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad · 184 unmodified lines
301301
302302 if (pgoff)
303303 return -EINVAL;
304− if (len > (1ull << 32))
304+ if (len > SZ_4G)
305305 return -E2BIG;
306306
307307 /* if user_vm_start was specified at arena creation time */
@@ -322,7 +322,7 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad · 14 unmodified lines
322322 if (WARN_ON_ONCE(arena->user_vm_start))
323323 /* checks at map creation time should prevent this */
324324 return -EFAULT;
325− return round_up(ret, 1ull << 32);
325+ return round_up(ret, SZ_4G);
326326 }
327327
328328 static int arena_map_mmap(struct bpf_map *map, struct vm_area_struct *vma)
@@ -346,7 +346,7 @@ static int arena_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) · 17 unmodified lines
346346 return -EBUSY;
347347
348348 /* Earlier checks should prevent this */
349− if (WARN_ON_ONCE(vma->vm_end - vma->vm_start > (1ull << 32) || vma->vm_pgoff))
349+ if (WARN_ON_ONCE(vma->vm_end - vma->vm_start > SZ_4G || vma->vm_pgoff))
350350 return -EFAULT;
351351
352352 if (remember_vma(arena, vma))
@@ -420,7 +420,7 @@ static long arena_alloc_pages(struct bpf_arena *arena, long uaddr, long page_cnt · 67 unmodified lines
420420 if (uaddr & ~PAGE_MASK)
421421 return 0;
422422 pgoff = compute_pgoff(arena, uaddr);
423− if (pgoff + page_cnt > page_cnt_max)
423+ if (pgoff > page_cnt_max - page_cnt)
424424 /* requested address will be outside of user VMA */
425425 return 0;
426426 }
@@ -447,7 +447,13 @@ static long arena_alloc_pages(struct bpf_arena *arena, long uaddr, long page_cnt · 20 unmodified lines
447447 goto out;
448448
449449 uaddr32 = (u32)(arena->user_vm_start + pgoff * PAGE_SIZE);
450− /* Earlier checks make sure that uaddr32 + page_cnt * PAGE_SIZE will not overflow 32-bit */
450+ /* Earlier checks made sure that uaddr32 + page_cnt * PAGE_SIZE - 1
451+ * will not overflow 32-bit. Lower 32-bit need to represent
452+ * contiguous user address range.
453+ * Map these pages at kern_vm_start base.
454+ * kern_vm_start + uaddr32 + page_cnt * PAGE_SIZE - 1 can overflow
455+ * lower 32-bit and it's ok.
456+ */
451457 ret = vm_area_map_pages(arena->kern_vm, kern_vm_start + uaddr32,
452458 kern_vm_start + uaddr32 + page_cnt * PAGE_SIZE, pages);
453459 if (ret) {
@@ -510,6 +516,11 @@ static void arena_free_pages(struct bpf_arena *arena, long uaddr, long page_cnt) · 56 unmodified lines
510516 if (!page)
511517 continue;
512518 if (page_cnt == 1 && page_mapped(page)) /* mapped by some user process */
519+ /* Optimization for the common case of page_cnt==1:
520+ * If page wasn't mapped into some user vma there
521+ * is no need to call zap_pages which is slow. When
522+ * page_cnt is big it's faster to do the batched zap.
523+ */
513524 zap_pages(arena, full_uaddr, 1);
514525 vm_area_unmap_pages(arena->kern_vm, kaddr, kaddr + PAGE_SIZE);
515526 __free_page(page);
kernel/bpf/bloom_filter.c+13−0
@@ -80,6 +80,18 @@ static int bloom_map_get_next_key(struct bpf_map *map, void *key, void *next_key · 79 unmodified lines
8080 return -EOPNOTSUPP;
8181 }
8282
83+/* Called from syscall */
84+static int bloom_map_alloc_check(union bpf_attr *attr)
85+{
86+ if (attr->value_size > KMALLOC_MAX_SIZE)
87+ /* if value_size is bigger, the user space won't be able to
88+ * access the elements.
89+ */
90+ return -E2BIG;
91+
92+ return 0;
93+}
94+
8395 static struct bpf_map *bloom_map_alloc(union bpf_attr *attr)
8496 {
8597 u32 bitset_bytes, bitset_mask, nr_hash_funcs, nr_bits;
@@ -191,6 +203,7 @@ static u64 bloom_map_mem_usage(const struct bpf_map *map) · 105 unmodified lines
191203 BTF_ID_LIST_SINGLE(bpf_bloom_map_btf_ids, struct, bpf_bloom_filter)
192204 const struct bpf_map_ops bloom_filter_map_ops = {
193205 .map_meta_equal = bpf_map_meta_equal,
206+ .map_alloc_check = bloom_map_alloc_check,
194207 .map_alloc = bloom_map_alloc,
195208 .map_free = bloom_map_free,
196209 .map_get_next_key = bloom_map_get_next_key,
kernel/bpf/helpers.c+1−1
@@ -2548,7 +2548,7 @@ __bpf_kfunc void bpf_throw(u64 cookie) · 2547 unmodified lines
25482548 __bpf_kfunc_end_defs();
25492549
25502550 BTF_KFUNCS_START(generic_btf_ids)
2551−#ifdef CONFIG_KEXEC_CORE
2551+#ifdef CONFIG_CRASH_DUMP
25522552 BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE)
25532553 #endif
25542554 BTF_ID_FLAGS(func, bpf_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)
kernel/bpf/verifier.c+24−3
@@ -5682,6 +5682,13 @@ static bool is_flow_key_reg(struct bpf_verifier_env *env, int regno) · 5681 unmodified lines
56825682 return reg->type == PTR_TO_FLOW_KEYS;
56835683 }
56845684
5685+static bool is_arena_reg(struct bpf_verifier_env *env, int regno)
5686+{
5687+ const struct bpf_reg_state *reg = reg_state(env, regno);
5688+
5689+ return reg->type == PTR_TO_ARENA;
5690+}
5691+
56855692 static u32 *reg2btf_ids[__BPF_REG_TYPE_MAX] = {
56865693 #ifdef CONFIG_NET
56875694 [PTR_TO_SOCKET] = &btf_sock_ids[BTF_SOCK_TYPE_SOCK],
@@ -6694,6 +6701,11 @@ static int check_stack_access_within_bounds( · 1006 unmodified lines
66946701 err = check_stack_slot_within_bounds(env, min_off, state, type);
66956702 if (!err && max_off > 0)
66966703 err = -EINVAL; /* out of stack access into non-negative offsets */
6704+ if (!err && access_size < 0)
6705+ /* access_size should not be negative (or overflow an int); others checks
6706+ * along the way should have prevented such an access.
6707+ */
6708+ err = -EFAULT; /* invalid negative access size; integer overflow? */
66976709
66986710 if (err) {
66996711 if (tnum_is_const(reg->var_off)) {
@@ -7019,7 +7031,8 @@ static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_i · 319 unmodified lines
70197031 if (is_ctx_reg(env, insn->dst_reg) ||
70207032 is_pkt_reg(env, insn->dst_reg) ||
70217033 is_flow_key_reg(env, insn->dst_reg) ||
7022− is_sk_reg(env, insn->dst_reg)) {
7034+ is_sk_reg(env, insn->dst_reg) ||
7035+ is_arena_reg(env, insn->dst_reg)) {
70237036 verbose(env, "BPF_ATOMIC stores into R%d %s is not allowed\n",
70247037 insn->dst_reg,
70257038 reg_type_str(env, reg_state(env, insn->dst_reg)->type));
@@ -14014,6 +14027,10 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) · 6988 unmodified lines
1401414027 verbose(env, "addr_space_cast insn can only convert between address space 1 and 0\n");
1401514028 return -EINVAL;
1401614029 }
14030+ if (!env->prog->aux->arena) {
14031+ verbose(env, "addr_space_cast insn can only be used in a program that has an associated arena\n");
14032+ return -EINVAL;
14033+ }
1401714034 } else {
1401814035 if ((insn->off != 0 && insn->off != 8 && insn->off != 16 &&
1401914036 insn->off != 32) || insn->imm) {
@@ -14046,8 +14063,11 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) · 26 unmodified lines
1404614063 if (insn->imm) {
1404714064 /* off == BPF_ADDR_SPACE_CAST */
1404814065 mark_reg_unknown(env, regs, insn->dst_reg);
14049− if (insn->imm == 1) /* cast from as(1) to as(0) */
14066+ if (insn->imm == 1) { /* cast from as(1) to as(0) */
1405014067 dst_reg->type = PTR_TO_ARENA;
14068+ /* PTR_TO_ARENA is 32-bit */
14069+ dst_reg->subreg_def = env->insn_idx + 1;
14070+ }
1405114071 } else if (insn->off == 0) {
1405214072 /* case: R1 = R2
1405314073 * copy register state to dest reg
@@ -19601,8 +19621,9 @@ static int do_misc_fixups(struct bpf_verifier_env *env) · 5547 unmodified lines
1960119621 (((struct bpf_map *)env->prog->aux->arena)->map_flags & BPF_F_NO_USER_CONV)) {
1960219622 /* convert to 32-bit mov that clears upper 32-bit */
1960319623 insn->code = BPF_ALU | BPF_MOV | BPF_X;
19604− /* clear off, so it's a normal 'wX = wY' from JIT pov */
19624+ /* clear off and imm, so it's a normal 'wX = wY' from JIT pov */
1960519625 insn->off = 0;
19626+ insn->imm = 0;
1960619627 } /* cast from as(0) to as(1) should be handled by JIT */
1960719628 goto next_insn;
1960819629 }
kernel/crash_reserve.c+7−0
@@ -366,7 +366,9 @@ static int __init reserve_crashkernel_low(unsigned long long low_size) · 365 unmodified lines
366366
367367 crashk_low_res.start = low_base;
368368 crashk_low_res.end = low_base + low_size - 1;
369+#ifdef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY
369370 insert_resource(&iomem_resource, &crashk_low_res);
371+#endif
370372 #endif
371373 return 0;
372374 }
@@ -448,8 +450,12 @@ retry: · 75 unmodified lines
448450
449451 crashk_res.start = crash_base;
450452 crashk_res.end = crash_base + crash_size - 1;
453+#ifdef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY
454+ insert_resource(&iomem_resource, &crashk_res);
455+#endif
451456 }
452457
458+#ifndef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY
453459 static __init int insert_crashkernel_resources(void)
454460 {
455461 if (crashk_res.start < crashk_res.end)
@@ -462,3 +468,4 @@ static __init int insert_crashkernel_resources(void) · 6 unmodified lines
462468 }
463469 early_initcall(insert_crashkernel_resources);
464470 #endif
471+#endif
kernel/irq/manage.c+7−2
@@ -1643,8 +1643,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 1642 unmodified lines
16431643 }
16441644
16451645 if (!((old->flags & new->flags) & IRQF_SHARED) ||
1646− (oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
1647− ((old->flags ^ new->flags) & IRQF_ONESHOT))
1646+ (oldtype != (new->flags & IRQF_TRIGGER_MASK)))
1647+ goto mismatch;
1648+
1649+ if ((old->flags & IRQF_ONESHOT) &&
1650+ (new->flags & IRQF_COND_ONESHOT))
1651+ new->flags |= IRQF_ONESHOT;
1652+ else if ((old->flags ^ new->flags) & IRQF_ONESHOT)
16481653 goto mismatch;
16491654
16501655 /* All handlers must agree on per-cpuness */
kernel/module/Kconfig+5−0
@@ -236,6 +236,10 @@ choice · 235 unmodified lines
236236 possible to load a signed module containing the algorithm to check
237237 the signature on that module.
238238
239+config MODULE_SIG_SHA1
240+ bool "Sign modules with SHA-1"
241+ select CRYPTO_SHA1
242+
239243 config MODULE_SIG_SHA256
240244 bool "Sign modules with SHA-256"
241245 select CRYPTO_SHA256
@@ -265,6 +269,7 @@ endchoice · 23 unmodified lines
265269 config MODULE_SIG_HASH
266270 string
267271 depends on MODULE_SIG || IMA_APPRAISE_MODSIG
272+ default "sha1" if MODULE_SIG_SHA1
268273 default "sha256" if MODULE_SIG_SHA256
269274 default "sha384" if MODULE_SIG_SHA384
270275 default "sha512" if MODULE_SIG_SHA512
kernel/printk/printk.c+6−0
@@ -2009,6 +2009,12 @@ static int console_trylock_spinning(void) · 2008 unmodified lines
20092009 */
20102010 mutex_acquire(&console_lock_dep_map, 0, 1, _THIS_IP_);
20112011
2012+ /*
2013+ * Update @console_may_schedule for trylock because the previous
2014+ * owner may have been schedulable.
2015+ */
2016+ console_may_schedule = 0;
2017+
20122018 return 1;
20132019 }
20142020
kernel/sys.c+5−2
@@ -2408,8 +2408,11 @@ static inline int prctl_set_mdwe(unsigned long bits, unsigned long arg3, · 2407 unmodified lines
24082408 if (bits & PR_MDWE_NO_INHERIT && !(bits & PR_MDWE_REFUSE_EXEC_GAIN))
24092409 return -EINVAL;
24102410
2411− /* PARISC cannot allow mdwe as it needs writable stacks */
2412− if (IS_ENABLED(CONFIG_PARISC))
2411+ /*
2412+ * EOPNOTSUPP might be more appropriate here in principle, but
2413+ * existing userspace depends on EINVAL specifically.
2414+ */
2415+ if (!arch_memory_deny_write_exec_supported())
24132416 return -EINVAL;
24142417
24152418 current_bits = get_current_mdwe();
kernel/time/posix-clock.c+9−7
@@ -129,15 +129,17 @@ static int posix_clock_open(struct inode *inode, struct file *fp) · 128 unmodified lines
129129 goto out;
130130 }
131131 pccontext->clk = clk;
132− fp->private_data = pccontext;
133− if (clk->ops.open)
132+ if (clk->ops.open) {
134133 err = clk->ops.open(pccontext, fp->f_mode);
135− else
136− err = 0;
137−
138− if (!err) {
139− get_device(clk->dev);
134+ if (err) {
135+ kfree(pccontext);
136+ goto out;
137+ }
140138 }
139+
140+ fp->private_data = pccontext;
141+ get_device(clk->dev);
142+ err = 0;
141143 out:
142144 up_read(&clk->rwsem);
143145 return err;
kernel/trace/trace_probe.c+1−1
@@ -839,7 +839,7 @@ out: · 838 unmodified lines
839839 void store_trace_entry_data(void *edata, struct trace_probe *tp, struct pt_regs *regs)
840840 {
841841 struct probe_entry_arg *earg = tp->entry_arg;
842− unsigned long val;
842+ unsigned long val = 0;
843843 int i;
844844
845845 if (!earg)
mm/Makefile+1−2
@@ -29,8 +29,7 @@ KCOV_INSTRUMENT_mmzone.o := n · 28 unmodified lines
2929 KCOV_INSTRUMENT_vmstat.o := n
3030 KCOV_INSTRUMENT_failslab.o := n
3131
32−CFLAGS_init-mm.o += $(call cc-disable-warning, override-init)
33−CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides)
32+CFLAGS_init-mm.o += -Wno-override-init
3433
3534 mmu-y := nommu.o
3635 mmu-$(CONFIG_MMU) := highmem.o memory.o mincore.o \
mm/filemap.c+16−0
@@ -4197,7 +4197,23 @@ static void filemap_cachestat(struct address_space *mapping, · 4196 unmodified lines
41974197 /* shmem file - in swap cache */
41984198 swp_entry_t swp = radix_to_swp_entry(folio);
41994199
4200+ /* swapin error results in poisoned entry */
4201+ if (non_swap_entry(swp))
4202+ goto resched;
4203+
4204+ /*
4205+ * Getting a swap entry from the shmem
4206+ * inode means we beat
4207+ * shmem_unuse(). rcu_read_lock()
4208+ * ensures swapoff waits for us before
4209+ * freeing the swapper space. However,
4210+ * we can race with swapping and
4211+ * invalidation, so there might not be
4212+ * a shadow in the swapcache (yet).
4213+ */
42004214 shadow = get_shadow_from_swap_cache(swp);
4215+ if (!shadow)
4216+ goto resched;
42014217 }
42024218 #endif
42034219 if (workingset_test_recent(shadow, true, &workingset))
mm/gup.c+8−6
@@ -1653,20 +1653,22 @@ long populate_vma_page_range(struct vm_area_struct *vma, · 1652 unmodified lines
16531653 if (vma->vm_flags & VM_LOCKONFAULT)
16541654 return nr_pages;
16551655
1656+ /* ... similarly, we've never faulted in PROT_NONE pages */
1657+ if (!vma_is_accessible(vma))
1658+ return -EFAULT;
1659+
16561660 gup_flags = FOLL_TOUCH;
16571661 /*
16581662 * We want to touch writable mappings with a write fault in order
16591663 * to break COW, except for shared mappings because these don't COW
16601664 * and we would not want to dirty them for nothing.
1665+ *
1666+ * Otherwise, do a read fault, and use FOLL_FORCE in case it's not
1667+ * readable (ie write-only or executable).
16611668 */
16621669 if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE)
16631670 gup_flags |= FOLL_WRITE;
1664−
1665− /*
1666− * We want mlock to succeed for regions that have any permissions
1667− * other than PROT_NONE.
1668− */
1669− if (vma_is_accessible(vma))
1671+ else
16701672 gup_flags |= FOLL_FORCE;
16711673
16721674 if (locked)
mm/memory.c+3−1
@@ -1536,7 +1536,9 @@ static inline int zap_present_ptes(struct mmu_gather *tlb, · 1535 unmodified lines
15361536 ptep_get_and_clear_full(mm, addr, pte, tlb->fullmm);
15371537 arch_check_zapped_pte(vma, ptent);
15381538 tlb_remove_tlb_entry(tlb, pte, addr);
1539− VM_WARN_ON_ONCE(userfaultfd_wp(vma));
1539+ if (userfaultfd_pte_wp(vma, ptent))
1540+ zap_install_uffd_wp_if_needed(vma, addr, pte, 1,
1541+ details, ptent);
15401542 ksm_might_unmap_zero_page(mm, ptent);
15411543 return 1;
15421544 }
mm/page_owner.c+23−10
@@ -54,6 +54,22 @@ static depot_stack_handle_t early_handle; · 53 unmodified lines
5454
5555 static void init_early_allocated_pages(void);
5656
57+static inline void set_current_in_page_owner(void)
58+{
59+ /*
60+ * Avoid recursion.
61+ *
62+ * We might need to allocate more memory from page_owner code, so make
63+ * sure to signal it in order to avoid recursion.
64+ */
65+ current->in_page_owner = 1;
66+}
67+
68+static inline void unset_current_in_page_owner(void)
69+{
70+ current->in_page_owner = 0;
71+}
72+
5773 static int __init early_page_owner_param(char *buf)
5874 {
5975 int ret = kstrtobool(buf, &page_owner_enabled);
@@ -133,23 +149,16 @@ static noinline depot_stack_handle_t save_stack(gfp_t flags) · 73 unmodified lines
133149 depot_stack_handle_t handle;
134150 unsigned int nr_entries;
135151
136− /*
137− * Avoid recursion.
138− *
139− * Sometimes page metadata allocation tracking requires more
140− * memory to be allocated:
141− * - when new stack trace is saved to stack depot
142− */
143152 if (current->in_page_owner)
144153 return dummy_handle;
145− current->in_page_owner = 1;
146154
155+ set_current_in_page_owner();
147156 nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 2);
148157 handle = stack_depot_save(entries, nr_entries, flags);
149158 if (!handle)
150159 handle = failure_handle;
160+ unset_current_in_page_owner();
151161
152− current->in_page_owner = 0;
153162 return handle;
154163 }
155164
@@ -164,9 +173,13 @@ static void add_stack_record_to_list(struct stack_record *stack_record, · 8 unmodified lines
164173 gfp_mask &= (GFP_ATOMIC | GFP_KERNEL);
165174 gfp_mask |= __GFP_NOWARN;
166175
176+ set_current_in_page_owner();
167177 stack = kmalloc(sizeof(*stack), gfp_mask);
168− if (!stack)
178+ if (!stack) {
179+ unset_current_in_page_owner();
169180 return;
181+ }
182+ unset_current_in_page_owner();
170183
171184 stack->stack_record = stack_record;
172185 stack->next = NULL;
mm/shmem_quota.c+7−3
@@ -116,7 +116,7 @@ static int shmem_free_file_info(struct super_block *sb, int type) · 115 unmodified lines
116116 static int shmem_get_next_id(struct super_block *sb, struct kqid *qid)
117117 {
118118 struct mem_dqinfo *info = sb_dqinfo(sb, qid->type);
119− struct rb_node *node = ((struct rb_root *)info->dqi_priv)->rb_node;
119+ struct rb_node *node;
120120 qid_t id = from_kqid(&init_user_ns, *qid);
121121 struct quota_info *dqopt = sb_dqopt(sb);
122122 struct quota_id *entry = NULL;
@@ -126,6 +126,7 @@ static int shmem_get_next_id(struct super_block *sb, struct kqid *qid) · 3 unmodified lines
126126 return -ESRCH;
127127
128128 down_read(&dqopt->dqio_sem);
129+ node = ((struct rb_root *)info->dqi_priv)->rb_node;
129130 while (node) {
130131 entry = rb_entry(node, struct quota_id, node);
131132
@@ -165,7 +166,7 @@ out_unlock: · 33 unmodified lines
165166 static int shmem_acquire_dquot(struct dquot *dquot)
166167 {
167168 struct mem_dqinfo *info = sb_dqinfo(dquot->dq_sb, dquot->dq_id.type);
168− struct rb_node **n = &((struct rb_root *)info->dqi_priv)->rb_node;
169+ struct rb_node **n;
169170 struct shmem_sb_info *sbinfo = dquot->dq_sb->s_fs_info;
170171 struct rb_node *parent = NULL, *new_node = NULL;
171172 struct quota_id *new_entry, *entry;
@@ -176,6 +177,8 @@ static int shmem_acquire_dquot(struct dquot *dquot) · 4 unmodified lines
176177 mutex_lock(&dquot->dq_lock);
177178
178179 down_write(&dqopt->dqio_sem);
180+ n = &((struct rb_root *)info->dqi_priv)->rb_node;
181+
179182 while (*n) {
180183 parent = *n;
181184 entry = rb_entry(parent, struct quota_id, node);
@@ -264,7 +267,7 @@ static bool shmem_is_empty_dquot(struct dquot *dquot) · 82 unmodified lines
264267 static int shmem_release_dquot(struct dquot *dquot)
265268 {
266269 struct mem_dqinfo *info = sb_dqinfo(dquot->dq_sb, dquot->dq_id.type);
267− struct rb_node *node = ((struct rb_root *)info->dqi_priv)->rb_node;
270+ struct rb_node *node;
268271 qid_t id = from_kqid(&init_user_ns, dquot->dq_id);
269272 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
270273 struct quota_id *entry = NULL;
@@ -275,6 +278,7 @@ static int shmem_release_dquot(struct dquot *dquot) · 4 unmodified lines
275278 goto out_dqlock;
276279
277280 down_write(&dqopt->dqio_sem);
281+ node = ((struct rb_root *)info->dqi_priv)->rb_node;
278282 while (node) {
279283 entry = rb_entry(node, struct quota_id, node);
280284
mm/userfaultfd.c+2−1
@@ -1444,7 +1444,8 @@ static int uffd_move_lock(struct mm_struct *mm, · 1443 unmodified lines
14441444 */
14451445 down_read(&(*dst_vmap)->vm_lock->lock);
14461446 if (*dst_vmap != *src_vmap)
1447− down_read(&(*src_vmap)->vm_lock->lock);
1447+ down_read_nested(&(*src_vmap)->vm_lock->lock,
1448+ SINGLE_DEPTH_NESTING);
14481449 }
14491450 mmap_read_unlock(mm);
14501451 return err;
mm/zswap.c+39−6
@@ -1080,7 +1080,17 @@ static void zswap_decompress(struct zswap_entry *entry, struct page *page) · 1079 unmodified lines
10801080 mutex_lock(&acomp_ctx->mutex);
10811081
10821082 src = zpool_map_handle(zpool, entry->handle, ZPOOL_MM_RO);
1083− if (acomp_ctx->is_sleepable && !zpool_can_sleep_mapped(zpool)) {
1083+ /*
1084+ * If zpool_map_handle is atomic, we cannot reliably utilize its mapped buffer
1085+ * to do crypto_acomp_decompress() which might sleep. In such cases, we must
1086+ * resort to copying the buffer to a temporary one.
1087+ * Meanwhile, zpool_map_handle() might return a non-linearly mapped buffer,
1088+ * such as a kmap address of high memory or even ever a vmap address.
1089+ * However, sg_init_one is only equipped to handle linearly mapped low memory.
1090+ * In such cases, we also must copy the buffer to a temporary and lowmem one.
1091+ */
1092+ if ((acomp_ctx->is_sleepable && !zpool_can_sleep_mapped(zpool)) ||
1093+ !virt_addr_valid(src)) {
10841094 memcpy(acomp_ctx->buffer, src, entry->length);
10851095 src = acomp_ctx->buffer;
10861096 zpool_unmap_handle(zpool, entry->handle);
@@ -1094,7 +1104,7 @@ static void zswap_decompress(struct zswap_entry *entry, struct page *page) · 7 unmodified lines
10941104 BUG_ON(acomp_ctx->req->dlen != PAGE_SIZE);
10951105 mutex_unlock(&acomp_ctx->mutex);
10961106
1097− if (!acomp_ctx->is_sleepable || zpool_can_sleep_mapped(zpool))
1107+ if (src != acomp_ctx->buffer)
10981108 zpool_unmap_handle(zpool, entry->handle);
10991109 }
11001110
@@ -1313,6 +1323,14 @@ static unsigned long zswap_shrinker_count(struct shrinker *shrinker, · 212 unmodified lines
13131323 if (!zswap_shrinker_enabled || !mem_cgroup_zswap_writeback_enabled(memcg))
13141324 return 0;
13151325
1326+ /*
1327+ * The shrinker resumes swap writeback, which will enter block
1328+ * and may enter fs. XXX: Harmonize with vmscan.c __GFP_FS
1329+ * rules (may_enter_fs()), which apply on a per-folio basis.
1330+ */
1331+ if (!gfp_has_io_fs(sc->gfp_mask))
1332+ return 0;
1333+
13161334 #ifdef CONFIG_MEMCG_KMEM
13171335 mem_cgroup_flush_stats(memcg);
13181336 nr_backing = memcg_page_state(memcg, MEMCG_ZSWAP_B) >> PAGE_SHIFT;
@@ -1618,6 +1636,7 @@ bool zswap_load(struct folio *folio) · 299 unmodified lines
16181636 swp_entry_t swp = folio->swap;
16191637 pgoff_t offset = swp_offset(swp);
16201638 struct page *page = &folio->page;
1639+ bool swapcache = folio_test_swapcache(folio);
16211640 struct zswap_tree *tree = swap_zswap_tree(swp);
16221641 struct zswap_entry *entry;
16231642 u8 *dst;
@@ -1630,7 +1649,20 @@ bool zswap_load(struct folio *folio) · 6 unmodified lines
16301649 spin_unlock(&tree->lock);
16311650 return false;
16321651 }
1633− zswap_rb_erase(&tree->rbroot, entry);
1652+ /*
1653+ * When reading into the swapcache, invalidate our entry. The
1654+ * swapcache can be the authoritative owner of the page and
1655+ * its mappings, and the pressure that results from having two
1656+ * in-memory copies outweighs any benefits of caching the
1657+ * compression work.
1658+ *
1659+ * (Most swapins go through the swapcache. The notable
1660+ * exception is the singleton fault on SWP_SYNCHRONOUS_IO
1661+ * files, which reads into a private page and may free it if
1662+ * the fault fails. We remain the primary owner of the entry.)
1663+ */
1664+ if (swapcache)
1665+ zswap_rb_erase(&tree->rbroot, entry);
16341666 spin_unlock(&tree->lock);
16351667
16361668 if (entry->length)
@@ -1645,9 +1677,10 @@ bool zswap_load(struct folio *folio) · 8 unmodified lines
16451677 if (entry->objcg)
16461678 count_objcg_event(entry->objcg, ZSWPIN);
16471679
1648− zswap_entry_free(entry);
1649−
1650− folio_mark_dirty(folio);
1680+ if (swapcache) {
1681+ zswap_entry_free(entry);
1682+ folio_mark_dirty(folio);
1683+ }
16511684
16521685 return true;
16531686 }
net/core/sock.c+2−2
@@ -482,7 +482,7 @@ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) · 481 unmodified lines
482482 unsigned long flags;
483483 struct sk_buff_head *list = &sk->sk_receive_queue;
484484
485− if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) {
485+ if (atomic_read(&sk->sk_rmem_alloc) >= READ_ONCE(sk->sk_rcvbuf)) {
486486 atomic_inc(&sk->sk_drops);
487487 trace_sock_rcvqueue_full(sk, skb);
488488 return -ENOMEM;
@@ -552,7 +552,7 @@ int __sk_receive_skb(struct sock *sk, struct sk_buff *skb, · 63 unmodified lines
552552
553553 skb->dev = NULL;
554554
555− if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
555+ if (sk_rcvqueues_full(sk, READ_ONCE(sk->sk_rcvbuf))) {
556556 atomic_inc(&sk->sk_drops);
557557 goto discard_and_relse;
558558 }
net/hsr/hsr_slave.c+2−1
@@ -220,7 +220,8 @@ void hsr_del_port(struct hsr_port *port) · 219 unmodified lines
220220 netdev_update_features(master->dev);
221221 dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
222222 netdev_rx_handler_unregister(port->dev);
223− dev_set_promiscuity(port->dev, -1);
223+ if (!port->hsr->fwd_offloaded)
224+ dev_set_promiscuity(port->dev, -1);
224225 netdev_upper_dev_unlink(port->dev, master->dev);
225226 }
226227
net/ipv4/inet_connection_sock.c+14−0
@@ -771,6 +771,20 @@ void inet_csk_clear_xmit_timers(struct sock *sk) · 770 unmodified lines
771771 }
772772 EXPORT_SYMBOL(inet_csk_clear_xmit_timers);
773773
774+void inet_csk_clear_xmit_timers_sync(struct sock *sk)
775+{
776+ struct inet_connection_sock *icsk = inet_csk(sk);
777+
778+ /* ongoing timer handlers need to acquire socket lock. */
779+ sock_not_owned_by_me(sk);
780+
781+ icsk->icsk_pending = icsk->icsk_ack.pending = 0;
782+
783+ sk_stop_timer_sync(sk, &icsk->icsk_retransmit_timer);
784+ sk_stop_timer_sync(sk, &icsk->icsk_delack_timer);
785+ sk_stop_timer_sync(sk, &sk->sk_timer);
786+}
787+
774788 void inet_csk_delete_keepalive_timer(struct sock *sk)
775789 {
776790 sk_stop_timer(sk, &sk->sk_timer);
net/ipv4/inet_fragment.c+57−13
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424 #include <net/ip.h>
2525 #include <net/ipv6.h>
2626
27+#include "../core/sock_destructor.h"
28+
2729 /* Use skb->cb to track consecutive/adjacent fragments coming at
2830 * the end of the queue. Nodes in the rb-tree queue will
2931 * contain "runs" of one or more adjacent fragments.
@@ -39,6 +41,7 @@ struct ipfrag_skb_cb { · 9 unmodified lines
3941 };
4042 struct sk_buff *next_frag;
4143 int frag_run_len;
44+ int ip_defrag_offset;
4245 };
4346
4447 #define FRAG_CB(skb) ((struct ipfrag_skb_cb *)((skb)->cb))
@@ -396,12 +399,12 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb, · 351 unmodified lines
396399 */
397400 if (!last)
398401 fragrun_create(q, skb); /* First fragment. */
399− else if (last->ip_defrag_offset + last->len < end) {
402+ else if (FRAG_CB(last)->ip_defrag_offset + last->len < end) {
400403 /* This is the common case: skb goes to the end. */
401404 /* Detect and discard overlaps. */
402− if (offset < last->ip_defrag_offset + last->len)
405+ if (offset < FRAG_CB(last)->ip_defrag_offset + last->len)
403406 return IPFRAG_OVERLAP;
404− if (offset == last->ip_defrag_offset + last->len)
407+ if (offset == FRAG_CB(last)->ip_defrag_offset + last->len)
405408 fragrun_append_to_last(q, skb);
406409 else
407410 fragrun_create(q, skb);
@@ -418,13 +421,13 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb, · 10 unmodified lines
418421
419422 parent = *rbn;
420423 curr = rb_to_skb(parent);
421− curr_run_end = curr->ip_defrag_offset +
424+ curr_run_end = FRAG_CB(curr)->ip_defrag_offset +
422425 FRAG_CB(curr)->frag_run_len;
423− if (end <= curr->ip_defrag_offset)
426+ if (end <= FRAG_CB(curr)->ip_defrag_offset)
424427 rbn = &parent->rb_left;
425428 else if (offset >= curr_run_end)
426429 rbn = &parent->rb_right;
427− else if (offset >= curr->ip_defrag_offset &&
430+ else if (offset >= FRAG_CB(curr)->ip_defrag_offset &&
428431 end <= curr_run_end)
429432 return IPFRAG_DUP;
430433 else
@@ -438,7 +441,7 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb, · 7 unmodified lines
438441 rb_insert_color(&skb->rbnode, &q->rb_fragments);
439442 }
440443
441− skb->ip_defrag_offset = offset;
444+ FRAG_CB(skb)->ip_defrag_offset = offset;
442445
443446 return IPFRAG_OK;
444447 }
@@ -448,13 +451,28 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb, · 3 unmodified lines
448451 struct sk_buff *parent)
449452 {
450453 struct sk_buff *fp, *head = skb_rb_first(&q->rb_fragments);
451− struct sk_buff **nextp;
454+ void (*destructor)(struct sk_buff *);
455+ unsigned int orig_truesize = 0;
456+ struct sk_buff **nextp = NULL;
457+ struct sock *sk = skb->sk;
452458 int delta;
453459
460+ if (sk && is_skb_wmem(skb)) {
461+ /* TX: skb->sk might have been passed as argument to
462+ * dst->output and must remain valid until tx completes.
463+ *
464+ * Move sk to reassembled skb and fix up wmem accounting.
465+ */
466+ orig_truesize = skb->truesize;
467+ destructor = skb->destructor;
468+ }
469+
454470 if (head != skb) {
455471 fp = skb_clone(skb, GFP_ATOMIC);
456− if (!fp)
457− return NULL;
472+ if (!fp) {
473+ head = skb;
474+ goto out_restore_sk;
475+ }
458476 FRAG_CB(fp)->next_frag = FRAG_CB(skb)->next_frag;
459477 if (RB_EMPTY_NODE(&skb->rbnode))
460478 FRAG_CB(parent)->next_frag = fp;
@@ -463,6 +481,12 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb, · 2 unmodified lines
463481 &q->rb_fragments);
464482 if (q->fragments_tail == skb)
465483 q->fragments_tail = fp;
484+
485+ if (orig_truesize) {
486+ /* prevent skb_morph from releasing sk */
487+ skb->sk = NULL;
488+ skb->destructor = NULL;
489+ }
466490 skb_morph(skb, head);
467491 FRAG_CB(skb)->next_frag = FRAG_CB(head)->next_frag;
468492 rb_replace_node(&head->rbnode, &skb->rbnode,
@@ -470,13 +494,13 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb, · 1 unmodified line
470494 consume_skb(head);
471495 head = skb;
472496 }
473− WARN_ON(head->ip_defrag_offset != 0);
497+ WARN_ON(FRAG_CB(head)->ip_defrag_offset != 0);
474498
475499 delta = -head->truesize;
476500
477501 /* Head of list must not be cloned. */
478502 if (skb_unclone(head, GFP_ATOMIC))
479− return NULL;
503+ goto out_restore_sk;
480504
481505 delta += head->truesize;
482506 if (delta)
@@ -492,7 +516,7 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb, · 9 unmodified lines
492516
493517 clone = alloc_skb(0, GFP_ATOMIC);
494518 if (!clone)
495− return NULL;
519+ goto out_restore_sk;
496520 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
497521 skb_frag_list_init(head);
498522 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
@@ -509,6 +533,21 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb, · 10 unmodified lines
509533 nextp = &skb_shinfo(head)->frag_list;
510534 }
511535
536+out_restore_sk:
537+ if (orig_truesize) {
538+ int ts_delta = head->truesize - orig_truesize;
539+
540+ /* if this reassembled skb is fragmented later,
541+ * fraglist skbs will get skb->sk assigned from head->sk,
542+ * and each frag skb will be released via sock_wfree.
543+ *
544+ * Update sk_wmem_alloc.
545+ */
546+ head->sk = sk;
547+ head->destructor = destructor;
548+ refcount_add(ts_delta, &sk->sk_wmem_alloc);
549+ }
550+
512551 return nextp;
513552 }
514553 EXPORT_SYMBOL(inet_frag_reasm_prepare);
@@ -516,6 +555,8 @@ EXPORT_SYMBOL(inet_frag_reasm_prepare); · 1 unmodified line
516555 void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head,
517556 void *reasm_data, bool try_coalesce)
518557 {
558+ struct sock *sk = is_skb_wmem(head) ? head->sk : NULL;
559+ const unsigned int head_truesize = head->truesize;
519560 struct sk_buff **nextp = reasm_data;
520561 struct rb_node *rbn;
521562 struct sk_buff *fp;
@@ -579,6 +620,9 @@ void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head, · 57 unmodified lines
579620 head->prev = NULL;
580621 head->tstamp = q->stamp;
581622 head->mono_delivery_time = q->mono_delivery_time;
623+
624+ if (sk)
625+ refcount_add(sum_truesize - head_truesize, &sk->sk_wmem_alloc);
582626 }
583627 EXPORT_SYMBOL(inet_frag_reasm_finish);
584628
net/ipv4/ip_fragment.c+1−1
@@ -384,6 +384,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) · 383 unmodified lines
384384 }
385385
386386 skb_dst_drop(skb);
387+ skb_orphan(skb);
387388 return -EINPROGRESS;
388389
389390 insert_error:
@@ -487,7 +488,6 @@ int ip_defrag(struct net *net, struct sk_buff *skb, u32 user) · 97 unmodified lines
487488 struct ipq *qp;
488489
489490 __IP_INC_STATS(net, IPSTATS_MIB_REASMREQDS);
490− skb_orphan(skb);
491491
492492 /* Lookup (or create) queue header */
493493 qp = ip_find(net, ip_hdr(skb), user, vif);
net/ipv4/netfilter/Kconfig+1−0
@@ -329,6 +329,7 @@ config NFT_COMPAT_ARP · 328 unmodified lines
329329 config IP_NF_ARPFILTER
330330 tristate "arptables-legacy packet filtering support"
331331 select IP_NF_ARPTABLES
332+ select NETFILTER_FAMILY_ARP
332333 depends on NETFILTER_XTABLES
333334 help
334335 ARP packet filtering defines a table `filter', which has a series of
net/ipv4/nexthop.c+3−1
@@ -768,8 +768,10 @@ static int nh_grp_hw_stats_update(struct nexthop *nh, bool *hw_stats_used) · 767 unmodified lines
768768 struct net *net = nh->net;
769769 int err;
770770
771− if (nexthop_notifiers_is_empty(net))
771+ if (nexthop_notifiers_is_empty(net)) {
772+ *hw_stats_used = false;
772773 return 0;
774+ }
773775
774776 err = nh_notifier_grp_hw_stats_init(&info, nh);
775777 if (err)
net/ipv4/tcp.c+2−0
@@ -2931,6 +2931,8 @@ void tcp_close(struct sock *sk, long timeout) · 2930 unmodified lines
29312931 lock_sock(sk);
29322932 __tcp_close(sk, timeout);
29332933 release_sock(sk);
2934+ if (!sk->sk_net_refcnt)
2935+ inet_csk_clear_xmit_timers_sync(sk);
29342936 sock_put(sk);
29352937 }
29362938 EXPORT_SYMBOL(tcp_close);
net/ipv6/addrconf.c+3−2
@@ -5416,10 +5416,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, · 5415 unmodified lines
54165416
54175417 err = 0;
54185418 if (fillargs.ifindex) {
5419− err = -ENODEV;
54205419 dev = dev_get_by_index_rcu(tgt_net, fillargs.ifindex);
5421− if (!dev)
5420+ if (!dev) {
5421+ err = -ENODEV;
54225422 goto done;
5423+ }
54235424 idev = __in6_dev_get(dev);
54245425 if (idev)
54255426 err = in6_dump_addrs(idev, skb, cb,
net/ipv6/netfilter/nf_conntrack_reasm.c+1−1
@@ -294,6 +294,7 @@ static int nf_ct_frag6_queue(struct frag_queue *fq, struct sk_buff *skb, · 293 unmodified lines
294294 }
295295
296296 skb_dst_drop(skb);
297+ skb_orphan(skb);
297298 return -EINPROGRESS;
298299
299300 insert_error:
@@ -469,7 +470,6 @@ int nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user) · 169 unmodified lines
469470 hdr = ipv6_hdr(skb);
470471 fhdr = (struct frag_hdr *)skb_transport_header(skb);
471472
472− skb_orphan(skb);
473473 fq = fq_find(net, fhdr->identification, user, hdr,
474474 skb->dev ? skb->dev->ifindex : 0);
475475 if (fq == NULL) {
net/mac80211/cfg.c+2−3
@@ -2199,15 +2199,14 @@ static int ieee80211_change_station(struct wiphy *wiphy, · 2198 unmodified lines
21992199 }
22002200
22012201 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
2202− sta->sdata->u.vlan.sta) {
2203− ieee80211_clear_fast_rx(sta);
2202+ sta->sdata->u.vlan.sta)
22042203 RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL);
2205− }
22062204
22072205 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
22082206 ieee80211_vif_dec_num_mcast(sta->sdata);
22092207
22102208 sta->sdata = vlansdata;
2209+ ieee80211_check_fast_rx(sta);
22112210 ieee80211_check_fast_xmit(sta);
22122211
22132212 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
net/mac80211/debug.h+1−1
@@ -158,7 +158,7 @@ do { \ · 157 unmodified lines
158158 _sdata_dbg(print, sdata, "[link %d] " fmt, \
159159 link_id, ##__VA_ARGS__); \
160160 else \
161− _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__); \
161+ _sdata_dbg(print, sdata, fmt, ##__VA_ARGS__); \
162162 } while (0)
163163 #define link_dbg(link, fmt, ...) \
164164 _link_id_dbg(1, (link)->sdata, (link)->link_id, \
net/mac80211/ieee80211_i.h+2−2
@@ -131,7 +131,7 @@ struct ieee80211_bss { · 130 unmodified lines
131131 };
132132
133133 /**
134− * enum ieee80211_corrupt_data_flags - BSS data corruption flags
134+ * enum ieee80211_bss_corrupt_data_flags - BSS data corruption flags
135135 * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
136136 * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
137137 *
@@ -144,7 +144,7 @@ enum ieee80211_bss_corrupt_data_flags { · 6 unmodified lines
144144 };
145145
146146 /**
147− * enum ieee80211_valid_data_flags - BSS valid data flags
147+ * enum ieee80211_bss_valid_data_flags - BSS valid data flags
148148 * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
149149 * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
150150 * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
net/mac80211/mlme.c+12−3
@@ -5874,6 +5874,15 @@ static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, · 5873 unmodified lines
58745874 }
58755875
58765876 if (sdata->vif.active_links != active_links) {
5877+ /* usable links are affected when active_links are changed,
5878+ * so notify the driver about the status change
5879+ */
5880+ changed |= BSS_CHANGED_MLD_VALID_LINKS;
5881+ active_links &= sdata->vif.active_links;
5882+ if (!active_links)
5883+ active_links =
5884+ BIT(__ffs(sdata->vif.valid_links &
5885+ ~dormant_links));
58775886 ret = ieee80211_set_active_links(&sdata->vif, active_links);
58785887 if (ret) {
58795888 sdata_info(sdata, "Failed to set TTLM active links\n");
@@ -5888,7 +5897,6 @@ static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, · 8 unmodified lines
58885897 goto out;
58895898 }
58905899
5891− changed |= BSS_CHANGED_MLD_VALID_LINKS;
58925900 sdata->vif.suspended_links = suspended_links;
58935901 if (sdata->vif.suspended_links)
58945902 changed |= BSS_CHANGED_MLD_TTLM;
@@ -7652,7 +7660,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, · 1757 unmodified lines
76527660 sdata_info(sdata,
76537661 "failed to insert STA entry for the AP (error %d)\n",
76547662 err);
7655− goto out_err;
7663+ goto out_release_chan;
76567664 }
76577665 } else
76587666 WARN_ON_ONCE(!ether_addr_equal(link->u.mgd.bssid, cbss->bssid));
@@ -7663,8 +7671,9 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, · 4 unmodified lines
76637671
76647672 return 0;
76657673
7674+out_release_chan:
7675+ ieee80211_link_release_channel(link);
76667676 out_err:
7667− ieee80211_link_release_channel(&sdata->deflink);
76687677 ieee80211_vif_set_links(sdata, 0, 0);
76697678 return err;
76707679 }
net/netfilter/nf_tables_api.c+42−8
@@ -1200,6 +1200,25 @@ static void nf_tables_table_disable(struct net *net, struct nft_table *table) · 1199 unmodified lines
12001200 __NFT_TABLE_F_WAS_AWAKEN | \
12011201 __NFT_TABLE_F_WAS_ORPHAN)
12021202
1203+static bool nft_table_pending_update(const struct nft_ctx *ctx)
1204+{
1205+ struct nftables_pernet *nft_net = nft_pernet(ctx->net);
1206+ struct nft_trans *trans;
1207+
1208+ if (ctx->table->flags & __NFT_TABLE_F_UPDATE)
1209+ return true;
1210+
1211+ list_for_each_entry(trans, &nft_net->commit_list, list) {
1212+ if ((trans->msg_type == NFT_MSG_NEWCHAIN ||
1213+ trans->msg_type == NFT_MSG_DELCHAIN) &&
1214+ trans->ctx.table == ctx->table &&
1215+ nft_trans_chain_update(trans))
1216+ return true;
1217+ }
1218+
1219+ return false;
1220+}
1221+
12031222 static int nf_tables_updtable(struct nft_ctx *ctx)
12041223 {
12051224 struct nft_trans *trans;
@@ -1226,7 +1245,7 @@ static int nf_tables_updtable(struct nft_ctx *ctx) · 20 unmodified lines
12261245 return -EOPNOTSUPP;
12271246
12281247 /* No dormant off/on/off/on games in single transaction */
1229− if (ctx->table->flags & __NFT_TABLE_F_UPDATE)
1248+ if (nft_table_pending_update(ctx))
12301249 return -EINVAL;
12311250
12321251 trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
@@ -2631,6 +2650,13 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy, · 1398 unmodified lines
26312650 }
26322651 }
26332652
2653+ if (table->flags & __NFT_TABLE_F_UPDATE &&
2654+ !list_empty(&hook.list)) {
2655+ NL_SET_BAD_ATTR(extack, attr);
2656+ err = -EOPNOTSUPP;
2657+ goto err_hooks;
2658+ }
2659+
26342660 if (!(table->flags & NFT_TABLE_F_DORMANT) &&
26352661 nft_is_base_chain(chain) &&
26362662 !list_empty(&hook.list)) {
@@ -2860,6 +2886,9 @@ static int nft_delchain_hook(struct nft_ctx *ctx, · 223 unmodified lines
28602886 struct nft_trans *trans;
28612887 int err;
28622888
2889+ if (ctx->table->flags & __NFT_TABLE_F_UPDATE)
2890+ return -EOPNOTSUPP;
2891+
28632892 err = nft_chain_parse_hook(ctx->net, basechain, nla, &chain_hook,
28642893 ctx->family, chain->flags, extack);
28652894 if (err < 0)
@@ -2944,7 +2973,8 @@ static int nf_tables_delchain(struct sk_buff *skb, const struct nfnl_info *info, · 78 unmodified lines
29442973 nft_ctx_init(&ctx, net, skb, info->nlh, family, table, chain, nla);
29452974
29462975 if (nla[NFTA_CHAIN_HOOK]) {
2947− if (chain->flags & NFT_CHAIN_HW_OFFLOAD)
2976+ if (NFNL_MSG_TYPE(info->nlh->nlmsg_type) == NFT_MSG_DESTROYCHAIN ||
2977+ chain->flags & NFT_CHAIN_HW_OFFLOAD)
29482978 return -EOPNOTSUPP;
29492979
29502980 if (nft_is_base_chain(chain)) {
@@ -10182,9 +10212,11 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 7231 unmodified lines
1018210212 if (nft_trans_chain_update(trans)) {
1018310213 nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN,
1018410214 &nft_trans_chain_hooks(trans));
10185− nft_netdev_unregister_hooks(net,
10186− &nft_trans_chain_hooks(trans),
10187− true);
10215+ if (!(trans->ctx.table->flags & NFT_TABLE_F_DORMANT)) {
10216+ nft_netdev_unregister_hooks(net,
10217+ &nft_trans_chain_hooks(trans),
10218+ true);
10219+ }
1018810220 } else {
1018910221 nft_chain_del(trans->ctx.chain);
1019010222 nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN,
@@ -10460,9 +10492,11 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) · 269 unmodified lines
1046010492 break;
1046110493 case NFT_MSG_NEWCHAIN:
1046210494 if (nft_trans_chain_update(trans)) {
10463− nft_netdev_unregister_hooks(net,
10464− &nft_trans_chain_hooks(trans),
10465− true);
10495+ if (!(trans->ctx.table->flags & NFT_TABLE_F_DORMANT)) {
10496+ nft_netdev_unregister_hooks(net,
10497+ &nft_trans_chain_hooks(trans),
10498+ true);
10499+ }
1046610500 free_percpu(nft_trans_chain_stats(trans));
1046710501 kfree(nft_trans_chain_name(trans));
1046810502 nft_trans_destroy(trans);
net/nfc/nci/core.c+5−0
@@ -1516,6 +1516,11 @@ static void nci_rx_work(struct work_struct *work) · 1515 unmodified lines
15161516 nfc_send_to_raw_sock(ndev->nfc_dev, skb,
15171517 RAW_PAYLOAD_NCI, NFC_DIRECTION_RX);
15181518
1519+ if (!nci_plen(skb->data)) {
1520+ kfree_skb(skb);
1521+ break;
1522+ }
1523+
15191524 /* Process frame */
15201525 switch (nci_mt(skb->data)) {
15211526 case NCI_MT_RSP_PKT:
net/sunrpc/auth_gss/gss_krb5_crypto.c+8−6
@@ -921,8 +921,6 @@ out_err: · 920 unmodified lines
921921 * Caller provides the truncation length of the output token (h) in
922922 * cksumout.len.
923923 *
924− * Note that for RPCSEC, the "initial cipher state" is always all zeroes.
925− *
926924 * Return values:
927925 * %GSS_S_COMPLETE: Digest computed, @cksumout filled in
928926 * %GSS_S_FAILURE: Call failed
@@ -933,19 +931,22 @@ u32 krb5_etm_checksum(struct crypto_sync_skcipher *cipher, · 4 unmodified lines
933931 int body_offset, struct xdr_netobj *cksumout)
934932 {
935933 unsigned int ivsize = crypto_sync_skcipher_ivsize(cipher);
936− static const u8 iv[GSS_KRB5_MAX_BLOCKSIZE];
937934 struct ahash_request *req;
938935 struct scatterlist sg[1];
936+ u8 *iv, *checksumdata;
939937 int err = -ENOMEM;
940− u8 *checksumdata;
941938
942939 checksumdata = kmalloc(crypto_ahash_digestsize(tfm), GFP_KERNEL);
943940 if (!checksumdata)
944941 return GSS_S_FAILURE;
942+ /* For RPCSEC, the "initial cipher state" is always all zeroes. */
943+ iv = kzalloc(ivsize, GFP_KERNEL);
944+ if (!iv)
945+ goto out_free_mem;
945946
946947 req = ahash_request_alloc(tfm, GFP_KERNEL);
947948 if (!req)
948− goto out_free_cksumdata;
949+ goto out_free_mem;
949950 ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, NULL);
950951 err = crypto_ahash_init(req);
951952 if (err)
@@ -969,7 +970,8 @@ u32 krb5_etm_checksum(struct crypto_sync_skcipher *cipher, · 17 unmodified lines
969970
970971 out_free_ahash:
971972 ahash_request_free(req);
972−out_free_cksumdata:
973+out_free_mem:
974+ kfree(iv);
973975 kfree_sensitive(checksumdata);
974976 return err ? GSS_S_FAILURE : GSS_S_COMPLETE;
975977 }
net/tls/tls_sw.c+5−2
@@ -1976,10 +1976,10 @@ int tls_sw_recvmsg(struct sock *sk, · 1975 unmodified lines
19761976 if (unlikely(flags & MSG_ERRQUEUE))
19771977 return sock_recv_errqueue(sk, msg, len, SOL_IP, IP_RECVERR);
19781978
1979− psock = sk_psock_get(sk);
19801979 err = tls_rx_reader_lock(sk, ctx, flags & MSG_DONTWAIT);
19811980 if (err < 0)
19821981 return err;
1982+ psock = sk_psock_get(sk);
19831983 bpf_strp_enabled = sk_psock_strp_enabled(psock);
19841984
19851985 /* If crypto failed the connection is broken */
@@ -2152,12 +2152,15 @@ recv_end: · 166 unmodified lines
21522152 }
21532153
21542154 /* Drain records from the rx_list & copy if required */
2155− if (is_peek || is_kvec)
2155+ if (is_peek)
21562156 err = process_rx_list(ctx, msg, &control, copied + peeked,
21572157 decrypted - peeked, is_peek, NULL);
21582158 else
21592159 err = process_rx_list(ctx, msg, &control, 0,
21602160 async_copy_bytes, is_peek, NULL);
2161+
2162+ /* we could have copied less than we wanted, and possibly nothing */
2163+ decrypted += max(err, 0) - async_copy_bytes;
21612164 }
21622165
21632166 copied += decrypted;
net/wireless/trace.h+1−1
@@ -1024,7 +1024,7 @@ TRACE_EVENT(rdev_get_mpp, · 1023 unmodified lines
10241024 TRACE_EVENT(rdev_dump_mpp,
10251025 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
10261026 u8 *dst, u8 *mpp),
1027− TP_ARGS(wiphy, netdev, _idx, mpp, dst),
1027+ TP_ARGS(wiphy, netdev, _idx, dst, mpp),
10281028 TP_STRUCT__entry(
10291029 WIPHY_ENTRY
10301030 NETDEV_ENTRY
net/wireless/wext-core.c+5−2
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
55 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
66 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
7+ * Copyright (C) 2024 Intel Corporation
78 *
89 * (As all part of the Linux kernel, this file is GPL)
910 */
@@ -662,7 +663,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) · 652 unmodified lines
662663 dev->ieee80211_ptr->wiphy->wext &&
663664 dev->ieee80211_ptr->wiphy->wext->get_wireless_stats) {
664665 wireless_warn_cfg80211_wext();
665− if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
666+ if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
667+ WIPHY_FLAG_DISABLE_WEXT))
666668 return NULL;
667669 return dev->ieee80211_ptr->wiphy->wext->get_wireless_stats(dev);
668670 }
@@ -704,7 +706,8 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd) · 35 unmodified lines
704706 #ifdef CONFIG_CFG80211_WEXT
705707 if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) {
706708 wireless_warn_cfg80211_wext();
707− if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
709+ if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
710+ WIPHY_FLAG_DISABLE_WEXT))
708711 return NULL;
709712 handlers = dev->ieee80211_ptr->wiphy->wext;
710713 }
scripts/Makefile.extrawarn+3−7
@@ -114,6 +114,8 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) · 113 unmodified lines
114114 KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
115115 KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
116116
117+KBUILD_CFLAGS += -Wno-override-init # alias for -Wno-initializer-overrides in clang
118+
117119 ifdef CONFIG_CC_IS_CLANG
118120 # Clang before clang-16 would warn on default argument promotions.
119121 ifneq ($(call clang-min-version, 160000),y)
@@ -151,10 +153,6 @@ KBUILD_CFLAGS += -Wtype-limits · 31 unmodified lines
151153 KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
152154 KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
153155
154−ifdef CONFIG_CC_IS_CLANG
155−KBUILD_CFLAGS += -Winitializer-overrides
156−endif
157−
158156 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN2
159157
160158 else
@@ -164,9 +162,7 @@ KBUILD_CFLAGS += -Wno-missing-field-initializers · 3 unmodified lines
164162 KBUILD_CFLAGS += -Wno-type-limits
165163 KBUILD_CFLAGS += -Wno-shift-negative-value
166164
167−ifdef CONFIG_CC_IS_CLANG
168−KBUILD_CFLAGS += -Wno-initializer-overrides
169−else
165+ifdef CONFIG_CC_IS_GCC
170166 KBUILD_CFLAGS += -Wno-maybe-uninitialized
171167 endif
172168
scripts/Makefile.modfinal+1−1
@@ -23,7 +23,7 @@ modname = $(notdir $(@:.mod.o=)) · 22 unmodified lines
2323 part-of-module = y
2424
2525 quiet_cmd_cc_o_c = CC [M] $@
26− cmd_cc_o_c = $(CC) $(filter-out $(CC_FLAGS_CFI) $(CFLAGS_GCOV), $(c_flags)) -c -o $@ $<
26+ cmd_cc_o_c = $(CC) $(filter-out $(CC_FLAGS_CFI) $(CFLAGS_GCOV) $(CFLAGS_KCSAN), $(c_flags)) -c -o $@ $<
2727
2828 %.mod.o: %.mod.c FORCE
2929 $(call if_changed_dep,cc_o_c)
scripts/bpf_doc.py+2−2
@@ -414,8 +414,8 @@ class PrinterRST(Printer): · 413 unmodified lines
414414 version = version.stdout.decode().rstrip()
415415 except:
416416 try:
417− version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot,
418− capture_output=True, check=True)
417+ version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
418+ cwd=linuxRoot, capture_output=True, check=True)
419419 version = version.stdout.decode().rstrip()
420420 except:
421421 return 'Linux'
scripts/kconfig/conf.c+0−5
@@ -552,11 +552,6 @@ static int conf_choice(struct menu *menu) · 551 unmodified lines
552552 continue;
553553 }
554554 sym_set_tristate_value(child->sym, yes);
555− for (child = child->list; child; child = child->next) {
556− indent += 2;
557− conf(child);
558− indent -= 2;
559− }
560555 return 1;
561556 }
562557 }
scripts/kconfig/lkc.h+1−1
@@ -89,7 +89,7 @@ void menu_add_visibility(struct expr *dep); · 88 unmodified lines
8989 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
9090 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
9191 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
92−void menu_finalize(struct menu *parent);
92+void menu_finalize(void);
9393 void menu_set_type(int type);
9494
9595 extern struct menu rootmenu;
scripts/kconfig/lxdialog/checklist.c+1−1
@@ -119,7 +119,7 @@ int dialog_checklist(const char *title, const char *prompt, int height, · 118 unmodified lines
119119 }
120120
121121 do_resize:
122− if (getmaxy(stdscr) < (height + CHECKLIST_HEIGTH_MIN))
122+ if (getmaxy(stdscr) < (height + CHECKLIST_HEIGHT_MIN))
123123 return -ERRDISPLAYTOOSMALL;
124124 if (getmaxx(stdscr) < (width + CHECKLIST_WIDTH_MIN))
125125 return -ERRDISPLAYTOOSMALL;
scripts/kconfig/lxdialog/dialog.h+6−6
@@ -162,17 +162,17 @@ int on_key_esc(WINDOW *win); · 161 unmodified lines
162162 int on_key_resize(void);
163163
164164 /* minimum (re)size values */
165−#define CHECKLIST_HEIGTH_MIN 6 /* For dialog_checklist() */
165+#define CHECKLIST_HEIGHT_MIN 6 /* For dialog_checklist() */
166166 #define CHECKLIST_WIDTH_MIN 6
167−#define INPUTBOX_HEIGTH_MIN 2 /* For dialog_inputbox() */
167+#define INPUTBOX_HEIGHT_MIN 2 /* For dialog_inputbox() */
168168 #define INPUTBOX_WIDTH_MIN 2
169−#define MENUBOX_HEIGTH_MIN 15 /* For dialog_menu() */
169+#define MENUBOX_HEIGHT_MIN 15 /* For dialog_menu() */
170170 #define MENUBOX_WIDTH_MIN 65
171−#define TEXTBOX_HEIGTH_MIN 8 /* For dialog_textbox() */
171+#define TEXTBOX_HEIGHT_MIN 8 /* For dialog_textbox() */
172172 #define TEXTBOX_WIDTH_MIN 8
173−#define YESNO_HEIGTH_MIN 4 /* For dialog_yesno() */
173+#define YESNO_HEIGHT_MIN 4 /* For dialog_yesno() */
174174 #define YESNO_WIDTH_MIN 4
175−#define WINDOW_HEIGTH_MIN 19 /* For init_dialog() */
175+#define WINDOW_HEIGHT_MIN 19 /* For init_dialog() */
176176 #define WINDOW_WIDTH_MIN 80
177177
178178 int init_dialog(const char *backtitle);
scripts/kconfig/lxdialog/inputbox.c+1−1
@@ -43,7 +43,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width · 42 unmodified lines
4343 strcpy(instr, init);
4444
4545 do_resize:
46− if (getmaxy(stdscr) <= (height - INPUTBOX_HEIGTH_MIN))
46+ if (getmaxy(stdscr) <= (height - INPUTBOX_HEIGHT_MIN))
4747 return -ERRDISPLAYTOOSMALL;
4848 if (getmaxx(stdscr) <= (width - INPUTBOX_WIDTH_MIN))
4949 return -ERRDISPLAYTOOSMALL;
scripts/kconfig/lxdialog/menubox.c+1−1
@@ -172,7 +172,7 @@ int dialog_menu(const char *title, const char *prompt, · 171 unmodified lines
172172 do_resize:
173173 height = getmaxy(stdscr);
174174 width = getmaxx(stdscr);
175− if (height < MENUBOX_HEIGTH_MIN || width < MENUBOX_WIDTH_MIN)
175+ if (height < MENUBOX_HEIGHT_MIN || width < MENUBOX_WIDTH_MIN)
176176 return -ERRDISPLAYTOOSMALL;
177177
178178 height -= 4;
scripts/kconfig/lxdialog/textbox.c+1−1
@@ -175,7 +175,7 @@ int dialog_textbox(const char *title, const char *tbuf, int initial_height, · 174 unmodified lines
175175
176176 do_resize:
177177 getmaxyx(stdscr, height, width);
178− if (height < TEXTBOX_HEIGTH_MIN || width < TEXTBOX_WIDTH_MIN)
178+ if (height < TEXTBOX_HEIGHT_MIN || width < TEXTBOX_WIDTH_MIN)
179179 return -ERRDISPLAYTOOSMALL;
180180 if (initial_height != 0)
181181 height = initial_height;
scripts/kconfig/lxdialog/util.c+1−1
@@ -291,7 +291,7 @@ int init_dialog(const char *backtitle) · 290 unmodified lines
291291 getyx(stdscr, saved_y, saved_x);
292292
293293 getmaxyx(stdscr, height, width);
294− if (height < WINDOW_HEIGTH_MIN || width < WINDOW_WIDTH_MIN) {
294+ if (height < WINDOW_HEIGHT_MIN || width < WINDOW_WIDTH_MIN) {
295295 endwin();
296296 return -ERRDISPLAYTOOSMALL;
297297 }
scripts/kconfig/lxdialog/yesno.c+1−1
@@ -32,7 +32,7 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width) · 31 unmodified lines
3232 WINDOW *dialog;
3333
3434 do_resize:
35− if (getmaxy(stdscr) < (height + YESNO_HEIGTH_MIN))
35+ if (getmaxy(stdscr) < (height + YESNO_HEIGHT_MIN))
3636 return -ERRDISPLAYTOOSMALL;
3737 if (getmaxx(stdscr) < (width + YESNO_WIDTH_MIN))
3838 return -ERRDISPLAYTOOSMALL;
scripts/kconfig/mconf.c+2−2
@@ -659,9 +659,9 @@ static void conf_choice(struct menu *menu) · 658 unmodified lines
659659 dialog_clear();
660660 res = dialog_checklist(prompt ? prompt : "Main Menu",
661661 radiolist_instructions,
662− MENUBOX_HEIGTH_MIN,
662+ MENUBOX_HEIGHT_MIN,
663663 MENUBOX_WIDTH_MIN,
664− CHECKLIST_HEIGTH_MIN);
664+ CHECKLIST_HEIGHT_MIN);
665665 selected = item_activate_selected();
666666 switch (res) {
667667 case 0:
scripts/kconfig/menu.c+16−6
@@ -282,7 +282,7 @@ static void sym_check_prop(struct symbol *sym) · 281 unmodified lines
282282 }
283283 }
284284
285−void menu_finalize(struct menu *parent)
285+static void _menu_finalize(struct menu *parent, bool inside_choice)
286286 {
287287 struct menu *menu, *last_menu;
288288 struct symbol *sym;
@@ -296,7 +296,12 @@ void menu_finalize(struct menu *parent) · 7 unmodified lines
296296 * and propagate parent dependencies before moving on.
297297 */
298298
299− if (sym && sym_is_choice(sym)) {
299+ bool is_choice = false;
300+
301+ if (sym && sym_is_choice(sym))
302+ is_choice = true;
303+
304+ if (is_choice) {
300305 if (sym->type == S_UNKNOWN) {
301306 /* find the first choice value to find out choice type */
302307 current_entry = parent;
@@ -394,7 +399,7 @@ void menu_finalize(struct menu *parent) · 91 unmodified lines
394399 }
395400 }
396401
397− if (sym && sym_is_choice(sym))
402+ if (is_choice)
398403 expr_free(parentdep);
399404
400405 /*
@@ -402,8 +407,8 @@ void menu_finalize(struct menu *parent) · 1 unmodified line
402407 * moving on
403408 */
404409 for (menu = parent->list; menu; menu = menu->next)
405− menu_finalize(menu);
406− } else if (sym) {
410+ _menu_finalize(menu, is_choice);
411+ } else if (!inside_choice && sym) {
407412 /*
408413 * Automatic submenu creation. If sym is a symbol and A, B, C,
409414 * ... are consecutive items (symbols, menus, ifs, etc.) that
@@ -463,7 +468,7 @@ void menu_finalize(struct menu *parent) · 53 unmodified lines
463468 /* Superset, put in submenu */
464469 expr_free(dep2);
465470 next:
466− menu_finalize(menu);
471+ _menu_finalize(menu, false);
467472 menu->parent = parent;
468473 last_menu = menu;
469474 }
@@ -582,6 +587,11 @@ void menu_finalize(struct menu *parent) · 112 unmodified lines
582587 }
583588 }
584589
590+void menu_finalize(void)
591+{
592+ _menu_finalize(&rootmenu, false);
593+}
594+
585595 bool menu_has_prompt(struct menu *menu)
586596 {
587597 if (!menu->prompt)
scripts/kconfig/parser.y+1−1
@@ -515,7 +515,7 @@ void conf_parse(const char *name) · 514 unmodified lines
515515 menu_add_prompt(P_MENU, "Main menu", NULL);
516516 }
517517
518− menu_finalize(&rootmenu);
518+ menu_finalize();
519519
520520 menu = &rootmenu;
521521 while (menu) {
scripts/mod/modpost.c+5−2
@@ -1007,6 +1007,8 @@ static Elf_Sym *find_fromsym(struct elf_info *elf, Elf_Addr addr, · 1006 unmodified lines
10071007
10081008 static Elf_Sym *find_tosym(struct elf_info *elf, Elf_Addr addr, Elf_Sym *sym)
10091009 {
1010+ Elf_Sym *new_sym;
1011+
10101012 /* If the supplied symbol has a valid name, return it */
10111013 if (is_valid_name(elf, sym))
10121014 return sym;
@@ -1015,8 +1017,9 @@ static Elf_Sym *find_tosym(struct elf_info *elf, Elf_Addr addr, Elf_Sym *sym) · 2 unmodified lines
10151017 * Strive to find a better symbol name, but the resulting name may not
10161018 * match the symbol referenced in the original code.
10171019 */
1018− return symsearch_find_nearest(elf, addr, get_secindex(elf, sym),
1019− true, 20);
1020+ new_sym = symsearch_find_nearest(elf, addr, get_secindex(elf, sym),
1021+ true, 20);
1022+ return new_sym ? new_sym : sym;
10201023 }
10211024
10221025 static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
sound/aoa/soundbus/i2sbus/core.c+1−1
@@ -158,7 +158,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, · 157 unmodified lines
158158 struct device_node *child, *sound = NULL;
159159 struct resource *r;
160160 int i, layout = 0, rlen, ok = force;
161− char node_name[6];
161+ char node_name[8];
162162 static const char *rnames[] = { "i2sbus: %pOFn (control)",
163163 "i2sbus: %pOFn (tx)",
164164 "i2sbus: %pOFn (rx)" };
sound/hda/intel-nhlt.c+26−0
@@ -343,3 +343,29 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt, · 342 unmodified lines
343343 return NULL;
344344 }
345345 EXPORT_SYMBOL(intel_nhlt_get_endpoint_blob);
346+
347+int intel_nhlt_ssp_device_type(struct device *dev, struct nhlt_acpi_table *nhlt,
348+ u8 virtual_bus_id)
349+{
350+ struct nhlt_endpoint *epnt;
351+ int i;
352+
353+ if (!nhlt)
354+ return -EINVAL;
355+
356+ epnt = (struct nhlt_endpoint *)nhlt->desc;
357+ for (i = 0; i < nhlt->endpoint_count; i++) {
358+ /* for SSP link the virtual bus id is the SSP port number */
359+ if (epnt->linktype == NHLT_LINK_SSP &&
360+ epnt->virtual_bus_id == virtual_bus_id) {
361+ dev_dbg(dev, "SSP%d: dev_type=%d\n", virtual_bus_id,
362+ epnt->device_type);
363+ return epnt->device_type;
364+ }
365+
366+ epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length);
367+ }
368+
369+ return -EINVAL;
370+}
371+EXPORT_SYMBOL(intel_nhlt_ssp_device_type);
sound/pci/hda/cs35l56_hda.c+4−4
@@ -1024,8 +1024,8 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id) · 1023 unmodified lines
10241024 goto err;
10251025 }
10261026
1027− dev_dbg(cs35l56->base.dev, "DSP system name: '%s', amp name: '%s'\n",
1028− cs35l56->system_name, cs35l56->amp_name);
1027+ dev_info(cs35l56->base.dev, "DSP system name: '%s', amp name: '%s'\n",
1028+ cs35l56->system_name, cs35l56->amp_name);
10291029
10301030 regmap_multi_reg_write(cs35l56->base.regmap, cs35l56_hda_dai_config,
10311031 ARRAY_SIZE(cs35l56_hda_dai_config));
@@ -1045,14 +1045,14 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id) · 13 unmodified lines
10451045 pm_runtime_mark_last_busy(cs35l56->base.dev);
10461046 pm_runtime_enable(cs35l56->base.dev);
10471047
1048+ cs35l56->base.init_done = true;
1049+
10481050 ret = component_add(cs35l56->base.dev, &cs35l56_hda_comp_ops);
10491051 if (ret) {
10501052 dev_err(cs35l56->base.dev, "Register component failed: %d\n", ret);
10511053 goto pm_err;
10521054 }
10531055
1054− cs35l56->base.init_done = true;
1055−
10561056 return 0;
10571057
10581058 pm_err:
sound/pci/hda/tas2781_hda_i2c.c+77−41
@@ -89,7 +89,7 @@ struct tas2781_hda { · 88 unmodified lines
8989 struct snd_kcontrol *dsp_prog_ctl;
9090 struct snd_kcontrol *dsp_conf_ctl;
9191 struct snd_kcontrol *prof_ctl;
92− struct snd_kcontrol *snd_ctls[3];
92+ struct snd_kcontrol *snd_ctls[2];
9393 };
9494
9595 static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
@@ -161,8 +161,6 @@ static void tas2781_hda_playback_hook(struct device *dev, int action) · 65 unmodified lines
161161 pm_runtime_put_autosuspend(dev);
162162 break;
163163 default:
164− dev_dbg(tas_hda->dev, "Playback action not supported: %d\n",
165− action);
166164 break;
167165 }
168166 }
@@ -185,8 +183,15 @@ static int tasdevice_get_profile_id(struct snd_kcontrol *kcontrol, · 16 unmodified lines
185183 {
186184 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
187185
186+ mutex_lock(&tas_priv->codec_lock);
187+
188188 ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id;
189189
190+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
191+ __func__, kcontrol->id.name, tas_priv->rcabin.profile_cfg_id);
192+
193+ mutex_unlock(&tas_priv->codec_lock);
194+
190195 return 0;
191196 }
192197
@@ -200,11 +205,19 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol, · 7 unmodified lines
200205
201206 val = clamp(nr_profile, 0, max);
202207
208+ mutex_lock(&tas_priv->codec_lock);
209+
210+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
211+ __func__, kcontrol->id.name,
212+ tas_priv->rcabin.profile_cfg_id, val);
213+
203214 if (tas_priv->rcabin.profile_cfg_id != val) {
204215 tas_priv->rcabin.profile_cfg_id = val;
205216 ret = 1;
206217 }
207218
219+ mutex_unlock(&tas_priv->codec_lock);
220+
208221 return ret;
209222 }
210223
@@ -241,8 +254,15 @@ static int tasdevice_program_get(struct snd_kcontrol *kcontrol, · 30 unmodified lines
241254 {
242255 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
243256
257+ mutex_lock(&tas_priv->codec_lock);
258+
244259 ucontrol->value.integer.value[0] = tas_priv->cur_prog;
245260
261+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
262+ __func__, kcontrol->id.name, tas_priv->cur_prog);
263+
264+ mutex_unlock(&tas_priv->codec_lock);
265+
246266 return 0;
247267 }
248268
@@ -257,11 +277,18 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol, · 8 unmodified lines
257277
258278 val = clamp(nr_program, 0, max);
259279
280+ mutex_lock(&tas_priv->codec_lock);
281+
282+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
283+ __func__, kcontrol->id.name, tas_priv->cur_prog, val);
284+
260285 if (tas_priv->cur_prog != val) {
261286 tas_priv->cur_prog = val;
262287 ret = 1;
263288 }
264289
290+ mutex_unlock(&tas_priv->codec_lock);
291+
265292 return ret;
266293 }
267294
@@ -270,8 +297,15 @@ static int tasdevice_config_get(struct snd_kcontrol *kcontrol, · 2 unmodified lines
270297 {
271298 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
272299
300+ mutex_lock(&tas_priv->codec_lock);
301+
273302 ucontrol->value.integer.value[0] = tas_priv->cur_conf;
274303
304+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
305+ __func__, kcontrol->id.name, tas_priv->cur_conf);
306+
307+ mutex_unlock(&tas_priv->codec_lock);
308+
275309 return 0;
276310 }
277311
@@ -286,54 +320,39 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol, · 8 unmodified lines
286320
287321 val = clamp(nr_config, 0, max);
288322
323+ mutex_lock(&tas_priv->codec_lock);
324+
325+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
326+ __func__, kcontrol->id.name, tas_priv->cur_conf, val);
327+
289328 if (tas_priv->cur_conf != val) {
290329 tas_priv->cur_conf = val;
291330 ret = 1;
292331 }
293332
333+ mutex_unlock(&tas_priv->codec_lock);
334+
294335 return ret;
295336 }
296337
297−/*
298− * tas2781_digital_getvol - get the volum control
299− * @kcontrol: control pointer
300− * @ucontrol: User data
301− * Customer Kcontrol for tas2781 is primarily for regmap booking, paging
302− * depends on internal regmap mechanism.
303− * tas2781 contains book and page two-level register map, especially
304− * book switching will set the register BXXP00R7F, after switching to the
305− * correct book, then leverage the mechanism for paging to access the
306− * register.
307− */
308−static int tas2781_digital_getvol(struct snd_kcontrol *kcontrol,
338+static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol,
309339 struct snd_ctl_elem_value *ucontrol)
310340 {
311341 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
312342 struct soc_mixer_control *mc =
313343 (struct soc_mixer_control *)kcontrol->private_value;
344+ int ret;
314345
315− return tasdevice_digital_getvol(tas_priv, ucontrol, mc);
316−}
346+ mutex_lock(&tas_priv->codec_lock);
317347
318−static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol,
319− struct snd_ctl_elem_value *ucontrol)
320−{
321− struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
322− struct soc_mixer_control *mc =
323− (struct soc_mixer_control *)kcontrol->private_value;
348+ ret = tasdevice_amp_getvol(tas_priv, ucontrol, mc);
324349
325− return tasdevice_amp_getvol(tas_priv, ucontrol, mc);
326−}
350+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %ld\n",
351+ __func__, kcontrol->id.name, ucontrol->value.integer.value[0]);
327352
328−static int tas2781_digital_putvol(struct snd_kcontrol *kcontrol,
329− struct snd_ctl_elem_value *ucontrol)
330−{
331− struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
332− struct soc_mixer_control *mc =
333− (struct soc_mixer_control *)kcontrol->private_value;
353+ mutex_unlock(&tas_priv->codec_lock);
334354
335− /* The check of the given value is in tasdevice_digital_putvol. */
336− return tasdevice_digital_putvol(tas_priv, ucontrol, mc);
355+ return ret;
337356 }
338357
339358 static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol,
@@ -342,9 +361,19 @@ static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol, · 2 unmodified lines
342361 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
343362 struct soc_mixer_control *mc =
344363 (struct soc_mixer_control *)kcontrol->private_value;
364+ int ret;
365+
366+ mutex_lock(&tas_priv->codec_lock);
367+
368+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: -> %ld\n",
369+ __func__, kcontrol->id.name, ucontrol->value.integer.value[0]);
345370
346371 /* The check of the given value is in tasdevice_amp_putvol. */
347− return tasdevice_amp_putvol(tas_priv, ucontrol, mc);
372+ ret = tasdevice_amp_putvol(tas_priv, ucontrol, mc);
373+
374+ mutex_unlock(&tas_priv->codec_lock);
375+
376+ return ret;
348377 }
349378
350379 static int tas2781_force_fwload_get(struct snd_kcontrol *kcontrol,
@@ -352,9 +381,13 @@ static int tas2781_force_fwload_get(struct snd_kcontrol *kcontrol, · 1 unmodified line
352381 {
353382 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
354383
384+ mutex_lock(&tas_priv->codec_lock);
385+
355386 ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status;
356− dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__,
357− tas_priv->force_fwload_status ? "ON" : "OFF");
387+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
388+ __func__, kcontrol->id.name, tas_priv->force_fwload_status);
389+
390+ mutex_unlock(&tas_priv->codec_lock);
358391
359392 return 0;
360393 }
@@ -365,14 +398,20 @@ static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol, · 4 unmodified lines
365398 struct tasdevice_priv *tas_priv = snd_kcontrol_chip(kcontrol);
366399 bool change, val = (bool)ucontrol->value.integer.value[0];
367400
401+ mutex_lock(&tas_priv->codec_lock);
402+
403+ dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
404+ __func__, kcontrol->id.name,
405+ tas_priv->force_fwload_status, val);
406+
368407 if (tas_priv->force_fwload_status == val)
369408 change = false;
370409 else {
371410 change = true;
372411 tas_priv->force_fwload_status = val;
373412 }
374− dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__,
375− tas_priv->force_fwload_status ? "ON" : "OFF");
413+
414+ mutex_unlock(&tas_priv->codec_lock);
376415
377416 return change;
378417 }
@@ -381,9 +420,6 @@ static const struct snd_kcontrol_new tas2781_snd_controls[] = { · 2 unmodified lines
381420 ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL,
382421 1, 0, 20, 0, tas2781_amp_getvol,
383422 tas2781_amp_putvol, amp_vol_tlv),
384− ACARD_SINGLE_RANGE_EXT_TLV("Speaker Digital Gain", TAS2781_DVC_LVL,
385− 0, 0, 200, 1, tas2781_digital_getvol,
386− tas2781_digital_putvol, dvc_tlv),
387423 ACARD_SINGLE_BOOL_EXT("Speaker Force Firmware Load", 0,
388424 tas2781_force_fwload_get, tas2781_force_fwload_put),
389425 };
sound/sh/aica.c+14−3
@@ -278,7 +278,8 @@ static void run_spu_dma(struct work_struct *work) · 277 unmodified lines
278278 dreamcastcard->clicks++;
279279 if (unlikely(dreamcastcard->clicks >= AICA_PERIOD_NUMBER))
280280 dreamcastcard->clicks %= AICA_PERIOD_NUMBER;
281− mod_timer(&dreamcastcard->timer, jiffies + 1);
281+ if (snd_pcm_running(dreamcastcard->substream))
282+ mod_timer(&dreamcastcard->timer, jiffies + 1);
282283 }
283284 }
284285
@@ -290,6 +291,8 @@ static void aica_period_elapsed(struct timer_list *t) · 5 unmodified lines
290291 /*timer function - so cannot sleep */
291292 int play_period;
292293 struct snd_pcm_runtime *runtime;
294+ if (!snd_pcm_running(substream))
295+ return;
293296 runtime = substream->runtime;
294297 dreamcastcard = substream->pcm->private_data;
295298 /* Have we played out an additional period? */
@@ -350,12 +353,19 @@ static int snd_aicapcm_pcm_open(struct snd_pcm_substream · 54 unmodified lines
350353 return 0;
351354 }
352355
356+static int snd_aicapcm_pcm_sync_stop(struct snd_pcm_substream *substream)
357+{
358+ struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
359+
360+ del_timer_sync(&dreamcastcard->timer);
361+ cancel_work_sync(&dreamcastcard->spu_dma_work);
362+ return 0;
363+}
364+
353365 static int snd_aicapcm_pcm_close(struct snd_pcm_substream
354366 *substream)
355367 {
356368 struct snd_card_aica *dreamcastcard = substream->pcm->private_data;
357− flush_work(&(dreamcastcard->spu_dma_work));
358− del_timer(&dreamcastcard->timer);
359369 dreamcastcard->substream = NULL;
360370 kfree(dreamcastcard->channel);
361371 spu_disable();
@@ -401,6 +411,7 @@ static const struct snd_pcm_ops snd_aicapcm_playback_ops = { · 39 unmodified lines
401411 .prepare = snd_aicapcm_pcm_prepare,
402412 .trigger = snd_aicapcm_pcm_trigger,
403413 .pointer = snd_aicapcm_pcm_pointer,
414+ .sync_stop = snd_aicapcm_pcm_sync_stop,
404415 };
405416
406417 /* TO DO: set up to handle more than one pcm instance */
sound/soc/intel/avs/avs.h+1−0
@@ -381,6 +381,7 @@ struct avs_apl_log_buffer_layout { · 380 unmodified lines
381381 u32 write_ptr;
382382 u8 buffer[];
383383 } __packed;
384+static_assert(sizeof(struct avs_apl_log_buffer_layout) == 8);
384385
385386 #define avs_apl_log_payload_size(adev) \
386387 (avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
sound/soc/intel/avs/cldma.c+1−1
@@ -35,7 +35,7 @@ struct hda_cldma { · 34 unmodified lines
3535
3636 unsigned int buffer_size;
3737 unsigned int num_periods;
38− unsigned int stream_tag;
38+ unsigned char stream_tag;
3939 void __iomem *sd_addr;
4040
4141 struct snd_dma_buffer dmab_data;
sound/soc/intel/avs/core.c+2−2
@@ -209,6 +209,7 @@ static void avs_hda_probe_work(struct work_struct *work) · 208 unmodified lines
209209
210210 snd_hdac_ext_bus_ppcap_enable(bus, true);
211211 snd_hdac_ext_bus_ppcap_int_enable(bus, true);
212+ avs_debugfs_init(adev);
212213
213214 ret = avs_dsp_first_boot_firmware(adev);
214215 if (ret < 0)
@@ -217,7 +218,6 @@ static void avs_hda_probe_work(struct work_struct *work) · 2 unmodified lines
217218 adev->nhlt = intel_nhlt_init(adev->dev);
218219 if (!adev->nhlt)
219220 dev_info(bus->dev, "platform has no NHLT\n");
220− avs_debugfs_init(adev);
221221
222222 avs_register_all_boards(adev);
223223
@@ -548,9 +548,9 @@ static void avs_pci_remove(struct pci_dev *pci) · 324 unmodified lines
548548
549549 avs_unregister_all_boards(adev);
550550
551− avs_debugfs_exit(adev);
552551 if (adev->nhlt)
553552 intel_nhlt_free(adev->nhlt);
553+ avs_debugfs_exit(adev);
554554
555555 if (avs_platattr_test(adev, CLDMA))
556556 hda_cldma_free(&code_loader);
sound/soc/intel/avs/icl.c+9−3
@@ -52,12 +52,14 @@ union avs_icl_memwnd2_slot_type { · 51 unmodified lines
5252 u32 type:24;
5353 };
5454 } __packed;
55+static_assert(sizeof(union avs_icl_memwnd2_slot_type) == 4);
5556
5657 struct avs_icl_memwnd2_desc {
5758 u32 resource_id;
5859 union avs_icl_memwnd2_slot_type slot_id;
5960 u32 vma;
6061 } __packed;
62+static_assert(sizeof(struct avs_icl_memwnd2_desc) == 12);
6163
6264 #define AVS_ICL_MEMWND2_SLOTS_COUNT 15
6365
@@ -66,8 +68,9 @@ struct avs_icl_memwnd2 { · 2 unmodified lines
6668 struct avs_icl_memwnd2_desc slot_desc[AVS_ICL_MEMWND2_SLOTS_COUNT];
6769 u8 rsvd[PAGE_SIZE];
6870 };
69− u8 slot_array[AVS_ICL_MEMWND2_SLOTS_COUNT][PAGE_SIZE];
71+ u8 slot_array[AVS_ICL_MEMWND2_SLOTS_COUNT][SZ_4K];
7072 } __packed;
73+static_assert(sizeof(struct avs_icl_memwnd2) == 65536);
7174
7275 #define AVS_ICL_SLOT_UNUSED \
7376 ((union avs_icl_memwnd2_slot_type) { 0x00000000U })
@@ -89,8 +92,7 @@ static int avs_icl_slot_offset(struct avs_dev *adev, union avs_icl_memwnd2_slot_ · 15 unmodified lines
8992
9093 for (i = 0; i < AVS_ICL_MEMWND2_SLOTS_COUNT; i++)
9194 if (desc[i].slot_id.val == slot_type.val)
92− return offsetof(struct avs_icl_memwnd2, slot_array) +
93− avs_skl_log_buffer_offset(adev, i);
95+ return offsetof(struct avs_icl_memwnd2, slot_array) + i * SZ_4K;
9496 return -ENXIO;
9597 }
9698
@@ -110,6 +112,10 @@ int avs_icl_log_buffer_offset(struct avs_dev *adev, u32 core) · 13 unmodified lines
110112
111113 bool avs_icl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
112114 {
115+ /* Full-power when starting DMA engines. */
116+ if (tx->glb.set_ppl_state.state == AVS_PPL_STATE_RUNNING)
117+ return true;
118+
113119 /* Payload-less IPCs do not take part in d0ix toggling. */
114120 return tx->size;
115121 }
sound/soc/intel/avs/loader.c+4−2
@@ -56,6 +56,7 @@ struct avs_fw_manifest { · 55 unmodified lines
5656 u32 feature_mask;
5757 struct avs_fw_version version;
5858 } __packed;
59+static_assert(sizeof(struct avs_fw_manifest) == 36);
5960
6061 struct avs_fw_ext_manifest {
6162 u32 id;
@@ -64,6 +65,7 @@ struct avs_fw_ext_manifest { · 2 unmodified lines
6465 u16 version_minor;
6566 u32 entries;
6667 } __packed;
68+static_assert(sizeof(struct avs_fw_ext_manifest) == 16);
6769
6870 static int avs_fw_ext_manifest_strip(struct firmware *fw)
6971 {
@@ -535,7 +537,7 @@ int avs_dsp_load_libraries(struct avs_dev *adev, struct avs_tplg_library *libs, · 465 unmodified lines
535537 if (ret)
536538 return ret;
537539
538− strncpy(adev->lib_names[id], man->name, AVS_LIB_NAME_SIZE);
540+ strscpy(adev->lib_names[id], man->name, AVS_LIB_NAME_SIZE);
539541 id++;
540542 next_lib:
541543 i++;
@@ -698,7 +700,7 @@ int avs_dsp_first_boot_firmware(struct avs_dev *adev) · 156 unmodified lines
698700 }
699701
700702 /* basefw always occupies slot 0 */
701− strcpy(&adev->lib_names[0][0], "BASEFW");
703+ strscpy(adev->lib_names[0], "BASEFW", AVS_LIB_NAME_SIZE);
702704
703705 ida_init(&adev->ppl_ida);
704706
sound/soc/intel/avs/messages.h+45−2
@@ -93,12 +93,14 @@ union avs_global_msg { · 92 unmodified lines
9393 } ext;
9494 };
9595 } __packed;
96+static_assert(sizeof(union avs_global_msg) == 8);
9697
9798 struct avs_tlv {
9899 u32 type;
99100 u32 length;
100101 u32 value[];
101102 } __packed;
103+static_assert(sizeof(struct avs_tlv) == 8);
102104
103105 enum avs_module_msg_type {
104106 AVS_MOD_INIT_INSTANCE = 0,
@@ -155,6 +157,7 @@ union avs_module_msg { · 50 unmodified lines
155157 } ext;
156158 };
157159 } __packed;
160+static_assert(sizeof(union avs_module_msg) == 8);
158161
159162 #define AVS_IPC_NOT_SUPPORTED 15
160163
@@ -190,6 +193,7 @@ union avs_reply_msg { · 29 unmodified lines
190193 } ext;
191194 };
192195 } __packed;
196+static_assert(sizeof(union avs_reply_msg) == 8);
193197
194198 enum avs_notify_msg_type {
195199 AVS_NOTIFY_PHRASE_DETECTED = 4,
@@ -226,6 +230,7 @@ union avs_notify_msg { · 30 unmodified lines
226230 } ext;
227231 };
228232 } __packed;
233+static_assert(sizeof(union avs_notify_msg) == 8);
229234
230235 #define AVS_MSG(hdr) { .val = hdr }
231236
@@ -264,6 +269,7 @@ struct avs_notify_voice_data { · 32 unmodified lines
264269 u16 kpd_score;
265270 u16 reserved;
266271 } __packed;
272+static_assert(sizeof(struct avs_notify_voice_data) == 4);
267273
268274 struct avs_notify_res_data {
269275 u32 resource_type;
@@ -272,6 +278,7 @@ struct avs_notify_res_data { · 2 unmodified lines
272278 u32 reserved;
273279 u32 data[6];
274280 } __packed;
281+static_assert(sizeof(struct avs_notify_res_data) == 40);
275282
276283 struct avs_notify_mod_data {
277284 u32 module_instance_id;
@@ -279,6 +286,7 @@ struct avs_notify_mod_data { · 1 unmodified line
279286 u32 data_size;
280287 u32 data[];
281288 } __packed;
289+static_assert(sizeof(struct avs_notify_mod_data) == 12);
282290
283291 /* ROM messages */
284292 enum avs_rom_control_msg_type {
@@ -332,6 +340,7 @@ struct avs_dxstate_info { · 47 unmodified lines
332340 u32 core_mask; /* which cores are subject for power transition */
333341 u32 dx_mask; /* bit[n]=1 core n goes to D0, bit[n]=0 it goes to D3 */
334342 } __packed;
343+static_assert(sizeof(struct avs_dxstate_info) == 8);
335344
336345 int avs_ipc_set_dx(struct avs_dev *adev, u32 core_mask, bool powerup);
337346 int avs_ipc_set_d0ix(struct avs_dev *adev, bool enable_pg, bool streaming);
@@ -367,11 +376,13 @@ struct avs_skl_log_state { · 29 unmodified lines
367376 u32 enable;
368377 u32 min_priority;
369378 } __packed;
379+static_assert(sizeof(struct avs_skl_log_state) == 8);
370380
371381 struct avs_skl_log_state_info {
372382 u32 core_mask;
373383 struct avs_skl_log_state logs_core[];
374384 } __packed;
385+static_assert(sizeof(struct avs_skl_log_state_info) == 4);
375386
376387 struct avs_apl_log_state_info {
377388 u32 aging_timer_period;
@@ -379,6 +390,7 @@ struct avs_apl_log_state_info { · 1 unmodified line
379390 u32 core_mask;
380391 struct avs_skl_log_state logs_core[];
381392 } __packed;
393+static_assert(sizeof(struct avs_apl_log_state_info) == 12);
382394
383395 enum avs_icl_log_priority {
384396 AVS_ICL_LOG_CRITICAL = 0,
@@ -403,6 +415,7 @@ struct avs_icl_log_state_info { · 18 unmodified lines
403415 u32 enable;
404416 u32 logs_priorities_mask[];
405417 } __packed;
418+static_assert(sizeof(struct avs_icl_log_state_info) == 12);
406419
407420 int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size);
408421
@@ -521,6 +534,7 @@ struct avs_module_type { · 112 unmodified lines
521534 u32 lib_code:1;
522535 u32 rsvd:24;
523536 } __packed;
537+static_assert(sizeof(struct avs_module_type) == 4);
524538
525539 union avs_segment_flags {
526540 u32 ul;
@@ -537,12 +551,14 @@ union avs_segment_flags { · 10 unmodified lines
537551 u32 length:16;
538552 };
539553 } __packed;
554+static_assert(sizeof(union avs_segment_flags) == 4);
540555
541556 struct avs_segment_desc {
542557 union avs_segment_flags flags;
543558 u32 v_base_addr;
544559 u32 file_offset;
545560 } __packed;
561+static_assert(sizeof(struct avs_segment_desc) == 12);
546562
547563 struct avs_module_entry {
548564 u16 module_id;
@@ -559,11 +575,13 @@ struct avs_module_entry { · 10 unmodified lines
559575 u16 instance_bss_size;
560576 struct avs_segment_desc segments[3];
561577 } __packed;
578+static_assert(sizeof(struct avs_module_entry) == 116);
562579
563580 struct avs_mods_info {
564581 u32 count;
565582 struct avs_module_entry entries[];
566583 } __packed;
584+static_assert(sizeof(struct avs_mods_info) == 4);
567585
568586 static inline bool avs_module_entry_is_loaded(struct avs_module_entry *mentry)
569587 {
@@ -577,6 +595,7 @@ struct avs_sys_time { · 7 unmodified lines
577595 u32 val_l;
578596 u32 val_u;
579597 } __packed;
598+static_assert(sizeof(struct avs_sys_time) == 8);
580599
581600 int avs_ipc_set_system_time(struct avs_dev *adev);
582601
@@ -680,6 +699,7 @@ struct avs_audio_format { · 97 unmodified lines
680699 u32 sample_type:8;
681700 u32 reserved:8;
682701 } __packed;
702+static_assert(sizeof(struct avs_audio_format) == 24);
683703
684704 struct avs_modcfg_base {
685705 u32 cpc;
@@ -688,12 +708,14 @@ struct avs_modcfg_base { · 2 unmodified lines
688708 u32 is_pages;
689709 struct avs_audio_format audio_fmt;
690710 } __packed;
711+static_assert(sizeof(struct avs_modcfg_base) == 40);
691712
692713 struct avs_pin_format {
693714 u32 pin_index;
694715 u32 iobs;
695716 struct avs_audio_format audio_fmt;
696717 } __packed;
718+static_assert(sizeof(struct avs_pin_format) == 32);
697719
698720 struct avs_modcfg_ext {
699721 struct avs_modcfg_base base;
@@ -703,6 +725,7 @@ struct avs_modcfg_ext { · 3 unmodified lines
703725 /* input pin formats followed by output ones */
704726 struct avs_pin_format pin_fmts[];
705727 } __packed;
728+static_assert(sizeof(struct avs_modcfg_ext) == 56);
706729
707730 enum avs_dma_type {
708731 AVS_DMA_HDA_HOST_OUTPUT = 0,
@@ -726,6 +749,7 @@ union avs_virtual_index { · 17 unmodified lines
726749 u8 instance:3;
727750 } dmic;
728751 } __packed;
752+static_assert(sizeof(union avs_virtual_index) == 1);
729753
730754 union avs_connector_node_id {
731755 u32 val;
@@ -735,6 +759,7 @@ union avs_connector_node_id { · 3 unmodified lines
735759 u32 rsvd:19;
736760 };
737761 } __packed;
762+static_assert(sizeof(union avs_connector_node_id) == 4);
738763
739764 #define INVALID_PIPELINE_ID 0xFF
740765 #define INVALID_NODE_ID \
@@ -747,16 +772,18 @@ union avs_gtw_attributes { · 6 unmodified lines
747772 u32 rsvd:31;
748773 };
749774 } __packed;
775+static_assert(sizeof(union avs_gtw_attributes) == 4);
750776
751777 struct avs_copier_gtw_cfg {
752778 union avs_connector_node_id node_id;
753779 u32 dma_buffer_size;
754780 u32 config_length;
755− struct {
781+ union {
756782 union avs_gtw_attributes attrs;
757− u32 blob[];
783+ DECLARE_FLEX_ARRAY(u32, blob);
758784 } config;
759785 } __packed;
786+static_assert(sizeof(struct avs_copier_gtw_cfg) == 16);
760787
761788 struct avs_copier_cfg {
762789 struct avs_modcfg_base base;
@@ -764,6 +791,7 @@ struct avs_copier_cfg { · 1 unmodified line
764791 u32 feature_mask;
765792 struct avs_copier_gtw_cfg gtw_cfg;
766793 } __packed;
794+static_assert(sizeof(struct avs_copier_cfg) == 84);
767795
768796 struct avs_volume_cfg {
769797 u32 channel_id;
@@ -772,22 +800,26 @@ struct avs_volume_cfg { · 2 unmodified lines
772800 u32 reserved; /* alignment */
773801 u64 curve_duration;
774802 } __packed;
803+static_assert(sizeof(struct avs_volume_cfg) == 24);
775804
776805 struct avs_peakvol_cfg {
777806 struct avs_modcfg_base base;
778807 struct avs_volume_cfg vols[];
779808 } __packed;
809+static_assert(sizeof(struct avs_peakvol_cfg) == 40);
780810
781811 struct avs_micsel_cfg {
782812 struct avs_modcfg_base base;
783813 struct avs_audio_format out_fmt;
784814 } __packed;
815+static_assert(sizeof(struct avs_micsel_cfg) == 64);
785816
786817 struct avs_mux_cfg {
787818 struct avs_modcfg_base base;
788819 struct avs_audio_format ref_fmt;
789820 struct avs_audio_format out_fmt;
790821 } __packed;
822+static_assert(sizeof(struct avs_mux_cfg) == 88);
791823
792824 struct avs_updown_mixer_cfg {
793825 struct avs_modcfg_base base;
@@ -796,21 +828,25 @@ struct avs_updown_mixer_cfg { · 2 unmodified lines
796828 s32 coefficients[AVS_CHANNELS_MAX];
797829 u32 channel_map;
798830 } __packed;
831+static_assert(sizeof(struct avs_updown_mixer_cfg) == 84);
799832
800833 struct avs_src_cfg {
801834 struct avs_modcfg_base base;
802835 u32 out_freq;
803836 } __packed;
837+static_assert(sizeof(struct avs_src_cfg) == 44);
804838
805839 struct avs_probe_gtw_cfg {
806840 union avs_connector_node_id node_id;
807841 u32 dma_buffer_size;
808842 } __packed;
843+static_assert(sizeof(struct avs_probe_gtw_cfg) == 8);
809844
810845 struct avs_probe_cfg {
811846 struct avs_modcfg_base base;
812847 struct avs_probe_gtw_cfg gtw_cfg;
813848 } __packed;
849+static_assert(sizeof(struct avs_probe_cfg) == 48);
814850
815851 struct avs_aec_cfg {
816852 struct avs_modcfg_base base;
@@ -818,6 +854,7 @@ struct avs_aec_cfg { · 1 unmodified line
818854 struct avs_audio_format out_fmt;
819855 u32 cpc_lp_mode;
820856 } __packed;
857+static_assert(sizeof(struct avs_aec_cfg) == 92);
821858
822859 struct avs_asrc_cfg {
823860 struct avs_modcfg_base base;
@@ -828,11 +865,13 @@ struct avs_asrc_cfg { · 4 unmodified lines
828865 u32 disable_jitter_buffer:1;
829866 u32 rsvd3:27;
830867 } __packed;
868+static_assert(sizeof(struct avs_asrc_cfg) == 48);
831869
832870 struct avs_wov_cfg {
833871 struct avs_modcfg_base base;
834872 u32 cpc_lp_mode;
835873 } __packed;
874+static_assert(sizeof(struct avs_wov_cfg) == 44);
836875
837876 /* Module runtime parameters */
838877
@@ -845,6 +884,7 @@ struct avs_copier_sink_format { · 6 unmodified lines
845884 struct avs_audio_format src_fmt;
846885 struct avs_audio_format sink_fmt;
847886 } __packed;
887+static_assert(sizeof(struct avs_copier_sink_format) == 52);
848888
849889 int avs_ipc_copier_set_sink_format(struct avs_dev *adev, u16 module_id,
850890 u8 instance_id, u32 sink_id,
@@ -878,6 +918,7 @@ struct avs_probe_dma { · 27 unmodified lines
878918 union avs_connector_node_id node_id;
879919 u32 dma_buffer_size;
880920 } __packed;
921+static_assert(sizeof(struct avs_probe_dma) == 8);
881922
882923 enum avs_probe_type {
883924 AVS_PROBE_TYPE_INPUT = 0,
@@ -894,6 +935,7 @@ union avs_probe_point_id { · 10 unmodified lines
894935 u32 index:6;
895936 } id;
896937 } __packed;
938+static_assert(sizeof(union avs_probe_point_id) == 4);
897939
898940 enum avs_connection_purpose {
899941 AVS_CONNECTION_PURPOSE_EXTRACT = 0,
@@ -906,6 +948,7 @@ struct avs_probe_point_desc { · 6 unmodified lines
906948 u32 purpose;
907949 union avs_connector_node_id node_id;
908950 } __packed;
951+static_assert(sizeof(struct avs_probe_point_desc) == 12);
909952
910953 int avs_ipc_probe_get_dma(struct avs_dev *adev, struct avs_probe_dma **dmas, size_t *num_dmas);
911954 int avs_ipc_probe_attach_dma(struct avs_dev *adev, struct avs_probe_dma *dmas, size_t num_dmas);
sound/soc/intel/avs/path.c+5−8
@@ -148,11 +148,12 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod) · 147 unmodified lines
148148 struct avs_copier_cfg *cfg;
149149 struct nhlt_specific_cfg *ep_blob;
150150 union avs_connector_node_id node_id = {0};
151− size_t cfg_size, data_size = 0;
151+ size_t cfg_size, data_size;
152152 void *data = NULL;
153153 u32 dma_type;
154154 int ret;
155155
156+ data_size = sizeof(cfg->gtw_cfg.config);
156157 dma_type = t->cfg_ext->copier.dma_type;
157158 node_id.dma_type = dma_type;
158159
@@ -233,10 +234,7 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod) · 74 unmodified lines
233234 break;
234235 }
235236
236− cfg_size = sizeof(*cfg) + data_size;
237− /* Every config-BLOB contains gateway attributes. */
238− if (data_size)
239− cfg_size -= sizeof(cfg->gtw_cfg.config.attrs);
237+ cfg_size = offsetof(struct avs_copier_cfg, gtw_cfg.config) + data_size;
240238 if (cfg_size > AVS_MAILBOX_SIZE)
241239 return -EINVAL;
242240
@@ -254,7 +252,7 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod) · 11 unmodified lines
254252 /* config_length in DWORDs */
255253 cfg->gtw_cfg.config_length = DIV_ROUND_UP(data_size, 4);
256254 if (data)
257− memcpy(&cfg->gtw_cfg.config, data, data_size);
255+ memcpy(&cfg->gtw_cfg.config.blob, data, data_size);
258256
259257 mod->gtw_attrs = cfg->gtw_cfg.config.attrs;
260258
@@ -367,6 +365,7 @@ static int avs_asrc_create(struct avs_dev *adev, struct avs_path_module *mod) · 106 unmodified lines
367365 struct avs_tplg_module *t = mod->template;
368366 struct avs_asrc_cfg cfg;
369367
368+ memset(&cfg, 0, sizeof(cfg));
370369 cfg.base.cpc = t->cfg_base->cpc;
371370 cfg.base.ibs = t->cfg_base->ibs;
372371 cfg.base.obs = t->cfg_base->obs;
@@ -710,8 +709,6 @@ static int avs_path_pipeline_arm(struct avs_dev *adev, · 337 unmodified lines
710709 /* bind current module to next module on list */
711710 source = mod;
712711 sink = list_next_entry(mod, node);
713− if (!source || !sink)
714− return -EINVAL;
715712
716713 ret = avs_ipc_bind(adev, source->module_id, source->instance_id,
717714 sink->module_id, sink->instance_id, 0, 0);
sound/soc/intel/avs/pcm.c+33−1
@@ -356,6 +356,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn · 355 unmodified lines
356356 stream_info->sig_bits);
357357 format_val = snd_hdac_stream_format(runtime->channels, bits, runtime->rate);
358358
359+ snd_hdac_ext_stream_decouple(bus, link_stream, true);
359360 snd_hdac_ext_stream_reset(link_stream);
360361 snd_hdac_ext_stream_setup(link_stream, format_val);
361362
@@ -456,6 +457,26 @@ static const struct snd_pcm_hw_constraint_list hw_rates = { · 94 unmodified lines
456457
457458 const struct snd_soc_dai_ops avs_dai_fe_ops;
458459
460+static int hw_rule_param_size(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule)
461+{
462+ struct snd_interval *interval = hw_param_interval(params, rule->var);
463+ struct snd_interval to;
464+
465+ snd_interval_any(&to);
466+ to.integer = interval->integer;
467+ to.max = interval->max;
468+ /*
469+ * Commonly 2ms buffer size is used in HDA scenarios whereas 4ms is used
470+ * when streaming through GPDMA. Align to the latter to account for both.
471+ */
472+ to.min = params_rate(params) / 1000 * 4;
473+
474+ if (rule->var == SNDRV_PCM_HW_PARAM_PERIOD_SIZE)
475+ to.min /= params_periods(params);
476+
477+ return snd_interval_refine(interval, &to);
478+}
479+
459480 static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
460481 {
461482 struct snd_pcm_runtime *runtime = substream->runtime;
@@ -491,6 +512,14 @@ static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_so · 29 unmodified lines
491512 if (ret < 0)
492513 goto err;
493514
515+ /* Adjust buffer and period size based on the audio format. */
516+ snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, hw_rule_param_size, NULL,
517+ SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS,
518+ SNDRV_PCM_HW_PARAM_RATE, -1);
519+ snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, hw_rule_param_size, NULL,
520+ SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS,
521+ SNDRV_PCM_HW_PARAM_RATE, -1);
522+
494523 snd_pcm_set_sync(substream);
495524
496525 dev_dbg(dai->dev, "%s fe STARTUP tag %d str %p",
@@ -611,6 +640,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so · 114 unmodified lines
611640 struct avs_dev *adev = to_avs_dev(dai->dev);
612641 struct hdac_ext_stream *host_stream;
613642 unsigned int format_val;
643+ struct hdac_bus *bus;
614644 unsigned int bits;
615645 int ret;
616646
@@ -620,6 +650,8 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so · 3 unmodified lines
620650 if (hdac_stream(host_stream)->prepared)
621651 return 0;
622652
653+ bus = hdac_stream(host_stream)->bus;
654+ snd_hdac_ext_stream_decouple(bus, data->host_stream, true);
623655 snd_hdac_stream_reset(hdac_stream(host_stream));
624656
625657 stream_info = snd_soc_dai_get_pcm_stream(dai, substream->stream);
@@ -1416,7 +1448,7 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen · 790 unmodified lines
14161448
14171449 mach = dev_get_platdata(component->card->dev);
14181450 codec = mach->pdata;
1419− sprintf(name, "%s-cpu", dev_name(&codec->core.dev));
1451+ snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
14201452
14211453 for_each_component_dais_safe(component, dai, save) {
14221454 int stream;
sound/soc/intel/avs/probes.c+9−5
@@ -19,8 +19,11 @@ static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id · 18 unmodified lines
1919 struct avs_probe_cfg cfg = {{0}};
2020 struct avs_module_entry mentry;
2121 u8 dummy;
22+ int ret;
2223
23− avs_get_module_entry(adev, &AVS_PROBE_MOD_UUID, &mentry);
24+ ret = avs_get_module_entry(adev, &AVS_PROBE_MOD_UUID, &mentry);
25+ if (ret)
26+ return ret;
2427
2528 /*
2629 * Probe module uses no cycles, audio data format and input and output
@@ -39,11 +42,12 @@ static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id · 12 unmodified lines
3942 static void avs_dsp_delete_probe(struct avs_dev *adev)
4043 {
4144 struct avs_module_entry mentry;
45+ int ret;
4246
43− avs_get_module_entry(adev, &AVS_PROBE_MOD_UUID, &mentry);
44−
45− /* There is only ever one probe module instance. */
46− avs_dsp_delete_module(adev, mentry.module_id, 0, INVALID_PIPELINE_ID, 0);
47+ ret = avs_get_module_entry(adev, &AVS_PROBE_MOD_UUID, &mentry);
48+ if (!ret)
49+ /* There is only ever one probe module instance. */
50+ avs_dsp_delete_module(adev, mentry.module_id, 0, INVALID_PIPELINE_ID, 0);
4751 }
4852
4953 static inline struct hdac_ext_stream *avs_compr_get_host_stream(struct snd_compr_stream *cstream)
sound/soc/sof/ipc4-topology.c+16−3
@@ -1371,6 +1371,7 @@ static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_s · 1370 unmodified lines
13711371 int sample_rate, channel_count;
13721372 int bit_depth, ret;
13731373 u32 nhlt_type;
1374+ int dev_type = 0;
13741375
13751376 /* convert to NHLT type */
13761377 switch (linktype) {
@@ -1386,18 +1387,30 @@ static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_s · 9 unmodified lines
13861387 &bit_depth);
13871388 if (ret < 0)
13881389 return ret;
1390+
1391+ /*
1392+ * We need to know the type of the external device attached to a SSP
1393+ * port to retrieve the blob from NHLT. However, device type is not
1394+ * specified in topology.
1395+ * Query the type for the port and then pass that information back
1396+ * to the blob lookup function.
1397+ */
1398+ dev_type = intel_nhlt_ssp_device_type(sdev->dev, ipc4_data->nhlt,
1399+ dai_index);
1400+ if (dev_type < 0)
1401+ return dev_type;
13891402 break;
13901403 default:
13911404 return 0;
13921405 }
13931406
1394− dev_dbg(sdev->dev, "dai index %d nhlt type %d direction %d\n",
1395− dai_index, nhlt_type, dir);
1407+ dev_dbg(sdev->dev, "dai index %d nhlt type %d direction %d dev type %d\n",
1408+ dai_index, nhlt_type, dir, dev_type);
13961409
13971410 /* find NHLT blob with matching params */
13981411 cfg = intel_nhlt_get_endpoint_blob(sdev->dev, ipc4_data->nhlt, dai_index, nhlt_type,
13991412 bit_depth, bit_depth, channel_count, sample_rate,
1400− dir, 0);
1413+ dir, dev_type);
14011414
14021415 if (!cfg) {
14031416 dev_err(sdev->dev,
tools/Makefile+6−7
@@ -11,7 +11,6 @@ help: · 10 unmodified lines
1111 @echo ''
1212 @echo ' acpi - ACPI tools'
1313 @echo ' bpf - misc BPF tools'
14− @echo ' cgroup - cgroup tools'
1514 @echo ' counter - counter tools'
1615 @echo ' cpupower - a tool for all things x86 CPU power'
1716 @echo ' debugging - tools for debugging'
@@ -69,7 +68,7 @@ acpi: FORCE · 51 unmodified lines
6968 cpupower: FORCE
7069 $(call descend,power/$@)
7170
72−cgroup counter firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE
71+counter firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE
7372 $(call descend,$@)
7473
7574 bpf/%: FORCE
@@ -116,7 +115,7 @@ freefall: FORCE · 40 unmodified lines
116115 kvm_stat: FORCE
117116 $(call descend,kvm/$@)
118117
119−all: acpi cgroup counter cpupower gpio hv firewire \
118+all: acpi counter cpupower gpio hv firewire \
120119 perf selftests bootconfig spi turbostat usb \
121120 virtio mm bpf x86_energy_perf_policy \
122121 tmon freefall iio objtool kvm_stat wmi \
@@ -128,7 +127,7 @@ acpi_install: · 5 unmodified lines
128127 cpupower_install:
129128 $(call descend,power/$(@:_install=),install)
130129
131−cgroup_install counter_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install mm_install bpf_install objtool_install wmi_install pci_install debugging_install tracing_install:
130+counter_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install mm_install bpf_install objtool_install wmi_install pci_install debugging_install tracing_install:
132131 $(call descend,$(@:_install=),install)
133132
134133 selftests_install:
@@ -155,7 +154,7 @@ freefall_install: · 20 unmodified lines
155154 kvm_stat_install:
156155 $(call descend,kvm/$(@:_install=),install)
157156
158−install: acpi_install cgroup_install counter_install cpupower_install gpio_install \
157+install: acpi_install counter_install cpupower_install gpio_install \
159158 hv_install firewire_install iio_install \
160159 perf_install selftests_install turbostat_install usb_install \
161160 virtio_install mm_install bpf_install x86_energy_perf_policy_install \
@@ -169,7 +168,7 @@ acpi_clean: · 7 unmodified lines
169168 cpupower_clean:
170169 $(call descend,power/cpupower,clean)
171170
172−cgroup_clean counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean tracing_clean:
171+counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean tracing_clean:
173172 $(call descend,$(@:_clean=),clean)
174173
175174 libapi_clean:
@@ -209,7 +208,7 @@ freefall_clean: · 33 unmodified lines
209208 build_clean:
210209 $(call descend,build,clean)
211210
212−clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \
211+clean: acpi_clean counter_clean cpupower_clean hv_clean firewire_clean \
213212 perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
214213 mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
215214 freefall_clean build_clean libbpf_clean libsubcmd_clean \
tools/bpf/bpftool/gen.c+1−1
@@ -121,7 +121,7 @@ static bool get_datasec_ident(const char *sec_name, char *buf, size_t buf_sz) · 120 unmodified lines
121121 int i, n;
122122
123123 /* recognize hard coded LLVM section name */
124− if (strcmp(sec_name, ".arena.1") == 0) {
124+ if (strcmp(sec_name, ".addr_space.1") == 0) {
125125 /* this is the name to use in skeleton */
126126 snprintf(buf, buf_sz, "arena");
127127 return true;
tools/lib/bpf/libbpf.c+7−3
@@ -498,7 +498,7 @@ struct bpf_struct_ops { · 497 unmodified lines
498498 #define KSYMS_SEC ".ksyms"
499499 #define STRUCT_OPS_SEC ".struct_ops"
500500 #define STRUCT_OPS_LINK_SEC ".struct_ops.link"
501−#define ARENA_SEC ".arena.1"
501+#define ARENA_SEC ".addr_space.1"
502502
503503 enum libbpf_map_type {
504504 LIBBPF_MAP_UNSPEC,
@@ -1650,6 +1650,10 @@ static int sys_memfd_create(const char *name, unsigned flags) · 1145 unmodified lines
16501650 return syscall(__NR_memfd_create, name, flags);
16511651 }
16521652
1653+#ifndef MFD_CLOEXEC
1654+#define MFD_CLOEXEC 0x0001U
1655+#endif
1656+
16531657 static int create_placeholder_fd(void)
16541658 {
16551659 int fd;
@@ -5352,8 +5356,8 @@ retry: · 3696 unmodified lines
53525356 goto err_out;
53535357 }
53545358 if (map->def.type == BPF_MAP_TYPE_ARENA) {
5355− map->mmaped = mmap((void *)map->map_extra, bpf_map_mmap_sz(map),
5356− PROT_READ | PROT_WRITE,
5359+ map->mmaped = mmap((void *)(long)map->map_extra,
5360+ bpf_map_mmap_sz(map), PROT_READ | PROT_WRITE,
53575361 map->map_extra ? MAP_SHARED | MAP_FIXED : MAP_SHARED,
53585362 map->fd, 0);
53595363 if (map->mmaped == MAP_FAILED) {
tools/net/ynl/ynl-gen-c.py+5−2
@@ -228,8 +228,11 @@ class Type(SpecAttr): · 227 unmodified lines
228228 presence = ''
229229 for i in range(0, len(ref)):
230230 presence = f"{var}->{'.'.join(ref[:i] + [''])}_present.{ref[i]}"
231− if self.presence_type() == 'bit':
232− code.append(presence + ' = 1;')
231+ # Every layer below last is a nest, so we know it uses bit presence
232+ # last layer is "self" and may be a complex type
233+ if i == len(ref) - 1 and self.presence_type() != 'bit':
234+ continue
235+ code.append(presence + ' = 1;')
233236 code += self._setter_lines(ri, member, presence)
234237
235238 func_name = f"{op_prefix(ri, direction, deref=deref)}_set_{'_'.join(ref)}"
tools/objtool/check.c+1−1
@@ -585,7 +585,7 @@ static int add_dead_ends(struct objtool_file *file) · 584 unmodified lines
585585 struct section *rsec;
586586 struct reloc *reloc;
587587 struct instruction *insn;
588− unsigned long offset;
588+ uint64_t offset;
589589
590590 /*
591591 * Check for manually annotated dead ends.
tools/testing/kunit/configs/all_tests.config+3−0
@@ -28,6 +28,8 @@ CONFIG_MCTP_FLOWS=y · 27 unmodified lines
2828 CONFIG_INET=y
2929 CONFIG_MPTCP=y
3030
31+CONFIG_NETDEVICES=y
32+CONFIG_WLAN=y
3133 CONFIG_CFG80211=y
3234 CONFIG_MAC80211=y
3335 CONFIG_WLAN_VENDOR_INTEL=y
@@ -38,6 +40,7 @@ CONFIG_DAMON_VADDR=y · 4 unmodified lines
3840 CONFIG_DAMON_PADDR=y
3941 CONFIG_DEBUG_FS=y
4042 CONFIG_DAMON_DBGFS=y
43+CONFIG_DAMON_DBGFS_DEPRECATED=y
4144
4245 CONFIG_REGMAP_BUILD=y
4346
tools/testing/selftests/bpf/bpf_arena_common.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 */
3333 #endif
3434
35−#if defined(__BPF_FEATURE_ARENA_CAST) && !defined(BPF_ARENA_FORCE_ASM)
35+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST) && !defined(BPF_ARENA_FORCE_ASM)
3636 #define __arena __attribute__((address_space(1)))
3737 #define cast_kern(ptr) /* nop for bpf prog. emitted by LLVM */
3838 #define cast_user(ptr) /* nop for bpf prog. emitted by LLVM */
tools/testing/selftests/bpf/prog_tests/arena_htab.c+5−3
@@ -3,12 +3,14 @@ · 2 unmodified lines
33 #include <test_progs.h>
44 #include <sys/mman.h>
55 #include <network_helpers.h>
6−
6+#include <sys/user.h>
7+#ifndef PAGE_SIZE /* on some archs it comes in sys/user.h */
8+#include <unistd.h>
9+#define PAGE_SIZE getpagesize()
10+#endif
711 #include "arena_htab_asm.skel.h"
812 #include "arena_htab.skel.h"
913
10−#define PAGE_SIZE 4096
11−
1214 #include "bpf_arena_htab.h"
1315
1416 static void test_arena_htab_common(struct htab *htab)
tools/testing/selftests/bpf/prog_tests/arena_list.c+5−2
@@ -3,8 +3,11 @@ · 2 unmodified lines
33 #include <test_progs.h>
44 #include <sys/mman.h>
55 #include <network_helpers.h>
6−
7−#define PAGE_SIZE 4096
6+#include <sys/user.h>
7+#ifndef PAGE_SIZE /* on some archs it comes in sys/user.h */
8+#include <unistd.h>
9+#define PAGE_SIZE getpagesize()
10+#endif
811
912 #include "bpf_arena_list.h"
1013 #include "arena_list.skel.h"
tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c+6−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 /* Copyright (c) 2021 Facebook */
33
44 #include <sys/syscall.h>
5+#include <limits.h>
56 #include <test_progs.h>
67 #include "bloom_filter_map.skel.h"
78
@@ -21,6 +22,11 @@ static void test_fail_cases(void) · 13 unmodified lines
2122 if (!ASSERT_LT(fd, 0, "bpf_map_create bloom filter invalid value size 0"))
2223 close(fd);
2324
25+ /* Invalid value size: too big */
26+ fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, INT32_MAX, 100, NULL);
27+ if (!ASSERT_LT(fd, 0, "bpf_map_create bloom filter invalid value too large"))
28+ close(fd);
29+
2430 /* Invalid max entries size */
2531 fd = bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER, NULL, 0, sizeof(value), 0, NULL);
2632 if (!ASSERT_LT(fd, 0, "bpf_map_create bloom filter invalid max entries size"))
tools/testing/selftests/bpf/prog_tests/verifier.c+2−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include "cap_helpers.h"
66 #include "verifier_and.skel.h"
77 #include "verifier_arena.skel.h"
8+#include "verifier_arena_large.skel.h"
89 #include "verifier_array_access.skel.h"
910 #include "verifier_basic_stack.skel.h"
1011 #include "verifier_bitfield_write.skel.h"
@@ -120,6 +121,7 @@ static void run_tests_aux(const char *skel_name, · 109 unmodified lines
120121
121122 void test_verifier_and(void) { RUN(verifier_and); }
122123 void test_verifier_arena(void) { RUN(verifier_arena); }
124+void test_verifier_arena_large(void) { RUN(verifier_arena_large); }
123125 void test_verifier_basic_stack(void) { RUN(verifier_basic_stack); }
124126 void test_verifier_bitfield_write(void) { RUN(verifier_bitfield_write); }
125127 void test_verifier_bounds(void) { RUN(verifier_bounds); }
tools/testing/selftests/bpf/progs/arena_htab.c+1−1
@@ -22,7 +22,7 @@ int zero = 0; · 21 unmodified lines
2222 SEC("syscall")
2323 int arena_htab_llvm(void *ctx)
2424 {
25−#if defined(__BPF_FEATURE_ARENA_CAST) || defined(BPF_ARENA_FORCE_ASM)
25+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST) || defined(BPF_ARENA_FORCE_ASM)
2626 struct htab __arena *htab;
2727 __u64 i;
2828
tools/testing/selftests/bpf/progs/arena_list.c+5−5
@@ -30,13 +30,13 @@ int list_sum; · 29 unmodified lines
3030 int cnt;
3131 bool skip = false;
3232
33−#ifdef __BPF_FEATURE_ARENA_CAST
33+#ifdef __BPF_FEATURE_ADDR_SPACE_CAST
3434 long __arena arena_sum;
3535 int __arena test_val = 1;
3636 struct arena_list_head __arena global_head;
3737 #else
38−long arena_sum SEC(".arena.1");
39−int test_val SEC(".arena.1");
38+long arena_sum SEC(".addr_space.1");
39+int test_val SEC(".addr_space.1");
4040 #endif
4141
4242 int zero;
@@ -44,7 +44,7 @@ int zero; · 1 unmodified line
4444 SEC("syscall")
4545 int arena_list_add(void *ctx)
4646 {
47−#ifdef __BPF_FEATURE_ARENA_CAST
47+#ifdef __BPF_FEATURE_ADDR_SPACE_CAST
4848 __u64 i;
4949
5050 list_head = &global_head;
@@ -66,7 +66,7 @@ int arena_list_add(void *ctx) · 15 unmodified lines
6666 SEC("syscall")
6767 int arena_list_del(void *ctx)
6868 {
69−#ifdef __BPF_FEATURE_ARENA_CAST
69+#ifdef __BPF_FEATURE_ADDR_SPACE_CAST
7070 struct elem __arena *n;
7171 int sum = 0;
7272
tools/testing/selftests/bpf/progs/verifier_arena.c+7−3
@@ -12,14 +12,18 @@ struct { · 11 unmodified lines
1212 __uint(type, BPF_MAP_TYPE_ARENA);
1313 __uint(map_flags, BPF_F_MMAPABLE);
1414 __uint(max_entries, 2); /* arena of two pages close to 32-bit boundary*/
15− __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
15+#ifdef __TARGET_ARCH_arm64
16+ __ulong(map_extra, (1ull << 32) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
17+#else
18+ __ulong(map_extra, (1ull << 44) | (~0u - __PAGE_SIZE * 2 + 1)); /* start of mmap() region */
19+#endif
1620 } arena SEC(".maps");
1721
1822 SEC("syscall")
1923 __success __retval(0)
2024 int basic_alloc1(void *ctx)
2125 {
22−#if defined(__BPF_FEATURE_ARENA_CAST)
26+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
2327 volatile int __arena *page1, *page2, *no_page, *page3;
2428
2529 page1 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
@@ -58,7 +62,7 @@ SEC("syscall") · 32 unmodified lines
5862 __success __retval(0)
5963 int basic_alloc2(void *ctx)
6064 {
61−#if defined(__BPF_FEATURE_ARENA_CAST)
65+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
6266 volatile char __arena *page1, *page2, *page3, *page4;
6367
6468 page1 = bpf_arena_alloc_pages(&arena, NULL, 2, NUMA_NO_NODE, 0);
tools/testing/selftests/bpf/progs/verifier_arena_large.c+68−0
@@ -0,0 +1,68 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
3+
4+#include <vmlinux.h>
5+#include <bpf/bpf_helpers.h>
6+#include <bpf/bpf_tracing.h>
7+#include "bpf_misc.h"
8+#include "bpf_experimental.h"
9+#include "bpf_arena_common.h"
10+
11+#define ARENA_SIZE (1ull << 32)
12+
13+struct {
14+ __uint(type, BPF_MAP_TYPE_ARENA);
15+ __uint(map_flags, BPF_F_MMAPABLE);
16+ __uint(max_entries, ARENA_SIZE / PAGE_SIZE);
17+} arena SEC(".maps");
18+
19+SEC("syscall")
20+__success __retval(0)
21+int big_alloc1(void *ctx)
22+{
23+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
24+ volatile char __arena *page1, *page2, *no_page, *page3;
25+ void __arena *base;
26+
27+ page1 = base = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
28+ if (!page1)
29+ return 1;
30+ *page1 = 1;
31+ page2 = bpf_arena_alloc_pages(&arena, base + ARENA_SIZE - PAGE_SIZE,
32+ 1, NUMA_NO_NODE, 0);
33+ if (!page2)
34+ return 2;
35+ *page2 = 2;
36+ no_page = bpf_arena_alloc_pages(&arena, base + ARENA_SIZE,
37+ 1, NUMA_NO_NODE, 0);
38+ if (no_page)
39+ return 3;
40+ if (*page1 != 1)
41+ return 4;
42+ if (*page2 != 2)
43+ return 5;
44+ bpf_arena_free_pages(&arena, (void __arena *)page1, 1);
45+ if (*page2 != 2)
46+ return 6;
47+ if (*page1 != 0) /* use-after-free should return 0 */
48+ return 7;
49+ page3 = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
50+ if (!page3)
51+ return 8;
52+ *page3 = 3;
53+ if (page1 != page3)
54+ return 9;
55+ if (*page2 != 2)
56+ return 10;
57+ if (*(page1 + PAGE_SIZE) != 0)
58+ return 11;
59+ if (*(page1 - PAGE_SIZE) != 0)
60+ return 12;
61+ if (*(page2 + PAGE_SIZE) != 0)
62+ return 13;
63+ if (*(page2 - PAGE_SIZE) != 0)
64+ return 14;
65+#endif
66+ return 0;
67+}
68+char _license[] SEC("license") = "GPL";
tools/testing/selftests/dmabuf-heaps/config+3−0
@@ -0,0 +1,3 @@
1+CONFIG_DMABUF_HEAPS=y
2+CONFIG_DMABUF_HEAPS_SYSTEM=y
3+CONFIG_DRM_VGEM=y
tools/testing/selftests/drivers/net/netdevsim/settings+1−0
@@ -0,0 +1 @@
1+timeout=600
tools/testing/selftests/exec/Makefile+2−2
@@ -19,8 +19,8 @@ include ../lib.mk · 18 unmodified lines
1919
2020 $(OUTPUT)/subdir:
2121 mkdir -p $@
22−$(OUTPUT)/script:
23− echo '#!/bin/sh' > $@
22+$(OUTPUT)/script: Makefile
23+ echo '#!/bin/bash' > $@
2424 echo 'exit $$*' >> $@
2525 chmod +x $@
2626 $(OUTPUT)/execveat.symlink: $(OUTPUT)/execveat
tools/testing/selftests/exec/binfmt_script.py+9−1
@@ -16,6 +16,8 @@ SIZE=256 · 15 unmodified lines
1616 NAME_MAX=int(subprocess.check_output(["getconf", "NAME_MAX", "."]))
1717
1818 test_num=0
19+pass_num=0
20+fail_num=0
1921
2022 code='''#!/usr/bin/perl
2123 print "Executed interpreter! Args:\n";
@@ -42,7 +44,7 @@ foreach my $a (@ARGV) { · 20 unmodified lines
4244 # ...
4345 def test(name, size, good=True, leading="", root="./", target="/perl",
4446 fill="A", arg="", newline="\n", hashbang="#!"):
45− global test_num, tests, NAME_MAX
47+ global test_num, pass_num, fail_num, tests, NAME_MAX
4648 test_num += 1
4749 if test_num > tests:
4850 raise ValueError("more binfmt_script tests than expected! (want %d, expected %d)"
@@ -80,16 +82,20 @@ def test(name, size, good=True, leading="", root="./", target="/perl", · 31 unmodified lines
8082 if good:
8183 print("ok %d - binfmt_script %s (successful good exec)"
8284 % (test_num, name))
85+ pass_num += 1
8386 else:
8487 print("not ok %d - binfmt_script %s succeeded when it should have failed"
8588 % (test_num, name))
89+ fail_num = 1
8690 else:
8791 if good:
8892 print("not ok %d - binfmt_script %s failed when it should have succeeded (rc:%d)"
8993 % (test_num, name, proc.returncode))
94+ fail_num = 1
9095 else:
9196 print("ok %d - binfmt_script %s (correctly failed bad exec)"
9297 % (test_num, name))
98+ pass_num += 1
9399
94100 # Clean up crazy binaries
95101 os.unlink(script)
@@ -166,6 +172,8 @@ test(name="two-under-trunc-arg", size=int(SIZE/2), arg=" ") · 70 unmodified lines
166172 test(name="two-under-leading", size=int(SIZE/2), leading=" ")
167173 test(name="two-under-lead-trunc-arg", size=int(SIZE/2), leading=" ", arg=" ")
168174
175+print("# Totals: pass:%d fail:%d xfail:0 xpass:0 skip:0 error:0" % (pass_num, fail_num))
176+
169177 if test_num != tests:
170178 raise ValueError("fewer binfmt_script tests than expected! (ran %d, expected %d"
171179 % (test_num, tests))
tools/testing/selftests/exec/execveat.c+7−5
@@ -98,10 +98,9 @@ static int check_execveat_invoked_rc(int fd, const char *path, int flags, · 97 unmodified lines
9898 if (child == 0) {
9999 /* Child: do execveat(). */
100100 rc = execveat_(fd, path, argv, envp, flags);
101− ksft_print_msg("execveat() failed, rc=%d errno=%d (%s)\n",
101+ ksft_print_msg("child execveat() failed, rc=%d errno=%d (%s)\n",
102102 rc, errno, strerror(errno));
103− ksft_test_result_fail("%s\n", test_name);
104− exit(1); /* should not reach here */
103+ exit(errno);
105104 }
106105 /* Parent: wait for & check child's exit status. */
107106 rc = waitpid(child, &status, 0);
@@ -226,11 +225,14 @@ static int check_execveat_pathmax(int root_dfd, const char *src, int is_script) · 118 unmodified lines
226225 * "If the command name is found, but it is not an executable utility,
227226 * the exit status shall be 126."), so allow either.
228227 */
229− if (is_script)
228+ if (is_script) {
229+ ksft_print_msg("Invoke script via root_dfd and relative filename\n");
230230 fail += check_execveat_invoked_rc(root_dfd, longpath + 1, 0,
231231 127, 126);
232− else
232+ } else {
233+ ksft_print_msg("Invoke exec via root_dfd and relative filename\n");
233234 fail += check_execveat(root_dfd, longpath + 1, 0);
235+ }
234236
235237 return fail;
236238 }
tools/testing/selftests/exec/load_address.c+15−19
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include <link.h>
66 #include <stdio.h>
77 #include <stdlib.h>
8+#include "../kselftest.h"
89
910 struct Statistics {
1011 unsigned long long load_address;
@@ -41,28 +42,23 @@ int main(int argc, char **argv) · 30 unmodified lines
4142 unsigned long long misalign;
4243 int ret;
4344
45+ ksft_print_header();
46+ ksft_set_plan(1);
47+
4448 ret = dl_iterate_phdr(ExtractStatistics, &extracted);
45− if (ret != 1) {
46− fprintf(stderr, "FAILED\n");
47− return 1;
48− }
49+ if (ret != 1)
50+ ksft_exit_fail_msg("FAILED: dl_iterate_phdr\n");
4951
50− if (extracted.alignment == 0) {
51− fprintf(stderr, "No alignment found\n");
52− return 1;
53− } else if (extracted.alignment & (extracted.alignment - 1)) {
54− fprintf(stderr, "Alignment is not a power of 2\n");
55− return 1;
56− }
52+ if (extracted.alignment == 0)
53+ ksft_exit_fail_msg("FAILED: No alignment found\n");
54+ else if (extracted.alignment & (extracted.alignment - 1))
55+ ksft_exit_fail_msg("FAILED: Alignment is not a power of 2\n");
5756
5857 misalign = extracted.load_address & (extracted.alignment - 1);
59− if (misalign) {
60− printf("alignment = %llu, load_address = %llu\n",
61− extracted.alignment, extracted.load_address);
62− fprintf(stderr, "FAILED\n");
63− return 1;
64− }
58+ if (misalign)
59+ ksft_exit_fail_msg("FAILED: alignment = %llu, load_address = %llu\n",
60+ extracted.alignment, extracted.load_address);
6561
66− fprintf(stderr, "PASS\n");
67− return 0;
62+ ksft_test_result_pass("Completed\n");
63+ ksft_finished();
6864 }
tools/testing/selftests/exec/recursion-depth.c+26−27
@@ -23,45 +23,44 @@ · 22 unmodified lines
2323 #include <fcntl.h>
2424 #include <sys/mount.h>
2525 #include <unistd.h>
26+#include "../kselftest.h"
2627
2728 int main(void)
2829 {
30+ int fd, rv;
31+
32+ ksft_print_header();
33+ ksft_set_plan(1);
34+
2935 if (unshare(CLONE_NEWNS) == -1) {
3036 if (errno == ENOSYS || errno == EPERM) {
31− fprintf(stderr, "error: unshare, errno %d\n", errno);
32− return 4;
37+ ksft_test_result_skip("error: unshare, errno %d\n", errno);
38+ ksft_finished();
3339 }
34− fprintf(stderr, "error: unshare, errno %d\n", errno);
35− return 1;
36− }
37− if (mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) == -1) {
38− fprintf(stderr, "error: mount '/', errno %d\n", errno);
39− return 1;
40+ ksft_exit_fail_msg("error: unshare, errno %d\n", errno);
4041 }
42+
43+ if (mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL) == -1)
44+ ksft_exit_fail_msg("error: mount '/', errno %d\n", errno);
45+
4146 /* Require "exec" filesystem. */
42− if (mount(NULL, "/tmp", "ramfs", 0, NULL) == -1) {
43− fprintf(stderr, "error: mount ramfs, errno %d\n", errno);
44− return 1;
45− }
47+ if (mount(NULL, "/tmp", "ramfs", 0, NULL) == -1)
48+ ksft_exit_fail_msg("error: mount ramfs, errno %d\n", errno);
4649
4750 #define FILENAME "/tmp/1"
4851
49− int fd = creat(FILENAME, 0700);
50− if (fd == -1) {
51− fprintf(stderr, "error: creat, errno %d\n", errno);
52− return 1;
53− }
52+ fd = creat(FILENAME, 0700);
53+ if (fd == -1)
54+ ksft_exit_fail_msg("error: creat, errno %d\n", errno);
55+
5456 #define S "#!" FILENAME "\n"
55− if (write(fd, S, strlen(S)) != strlen(S)) {
56− fprintf(stderr, "error: write, errno %d\n", errno);
57− return 1;
58− }
57+ if (write(fd, S, strlen(S)) != strlen(S))
58+ ksft_exit_fail_msg("error: write, errno %d\n", errno);
59+
5960 close(fd);
6061
61− int rv = execve(FILENAME, NULL, NULL);
62− if (rv == -1 && errno == ELOOP) {
63− return 0;
64− }
65− fprintf(stderr, "error: execve, rv %d, errno %d\n", rv, errno);
66− return 1;
62+ rv = execve(FILENAME, NULL, NULL);
63+ ksft_test_result(rv == -1 && errno == ELOOP,
64+ "execve failed as expected (ret %d, errno %d)\n", rv, errno);
65+ ksft_finished();
6766 }
tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc+1−1
@@ -24,7 +24,7 @@ echo 0 > events/enable · 23 unmodified lines
2424 echo "Get the most frequently calling function"
2525 sample_events
2626
27−target_func=`cut -d: -f3 trace | sed 's/call_site=\([^+]*\)+0x.*/\1/' | sort | uniq -c | sort | tail -n 1 | sed 's/^[ 0-9]*//'`
27+target_func=`cat trace | grep -o 'call_site=\([^+]*\)' | sed 's/call_site=//' | sort | uniq -c | sort | tail -n 1 | sed 's/^[ 0-9]*//'`
2828 if [ -z "$target_func" ]; then
2929 exit_fail
3030 fi
tools/testing/selftests/mm/gup_test.c+1−1
@@ -203,7 +203,7 @@ int main(int argc, char **argv) · 202 unmodified lines
203203 ksft_print_header();
204204 ksft_set_plan(nthreads);
205205
206− filed = open(file, O_RDWR|O_CREAT);
206+ filed = open(file, O_RDWR|O_CREAT, 0664);
207207 if (filed < 0)
208208 ksft_exit_fail_msg("Unable to open %s: %s\n", file, strerror(errno));
209209
tools/testing/selftests/mm/protection_keys.c+5−1
@@ -1745,9 +1745,12 @@ void pkey_setup_shadow(void) · 1744 unmodified lines
17451745 shadow_pkey_reg = __read_pkey_reg();
17461746 }
17471747
1748+pid_t parent_pid;
1749+
17481750 void restore_settings_atexit(void)
17491751 {
1750− cat_into_file(buf, "/proc/sys/vm/nr_hugepages");
1752+ if (parent_pid == getpid())
1753+ cat_into_file(buf, "/proc/sys/vm/nr_hugepages");
17511754 }
17521755
17531756 void save_settings(void)
@@ -1773,6 +1776,7 @@ void save_settings(void) · 19 unmodified lines
17731776 exit(__LINE__);
17741777 }
17751778
1779+ parent_pid = getpid();
17761780 atexit(restore_settings_atexit);
17771781 close(fd);
17781782 }
tools/testing/selftests/mm/soft-dirty.c+1−1
@@ -137,7 +137,7 @@ static void test_mprotect(int pagemap_fd, int pagesize, bool anon) · 136 unmodified lines
137137 if (!map)
138138 ksft_exit_fail_msg("anon mmap failed\n");
139139 } else {
140− test_fd = open(fname, O_RDWR | O_CREAT);
140+ test_fd = open(fname, O_RDWR | O_CREAT, 0664);
141141 if (test_fd < 0) {
142142 ksft_test_result_skip("Test %s open() file failed\n", __func__);
143143 return;
tools/testing/selftests/mm/split_huge_page_test.c+1−1
@@ -223,7 +223,7 @@ void split_file_backed_thp(void) · 222 unmodified lines
223223 ksft_exit_fail_msg("Fail to create file-backed THP split testing file\n");
224224 }
225225
226− fd = open(testfile, O_CREAT|O_WRONLY);
226+ fd = open(testfile, O_CREAT|O_WRONLY, 0664);
227227 if (fd == -1) {
228228 ksft_perror("Cannot open testing file");
229229 goto cleanup;
tools/testing/selftests/mm/uffd-common.c+3−0
@@ -18,6 +18,7 @@ bool test_uffdio_wp = true; · 17 unmodified lines
1818 unsigned long long *count_verify;
1919 uffd_test_ops_t *uffd_test_ops;
2020 uffd_test_case_ops_t *uffd_test_case_ops;
21+atomic_bool ready_for_fork;
2122
2223 static int uffd_mem_fd_create(off_t mem_size, bool hugetlb)
2324 {
@@ -518,6 +519,8 @@ void *uffd_poll_thread(void *arg) · 494 unmodified lines
518519 pollfd[1].fd = pipefd[cpu*2];
519520 pollfd[1].events = POLLIN;
520521
522+ ready_for_fork = true;
523+
521524 for (;;) {
522525 ret = poll(pollfd, 2, -1);
523526 if (ret <= 0) {
tools/testing/selftests/mm/uffd-common.h+2−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <inttypes.h>
3333 #include <stdint.h>
3434 #include <sys/random.h>
35+#include <stdatomic.h>
3536
3637 #include "../kselftest.h"
3738 #include "vm_util.h"
@@ -103,6 +104,7 @@ extern bool map_shared; · 65 unmodified lines
103104 extern bool test_uffdio_wp;
104105 extern unsigned long long *count_verify;
105106 extern volatile bool test_uffdio_copy_eexist;
107+extern atomic_bool ready_for_fork;
106108
107109 extern uffd_test_ops_t anon_uffd_test_ops;
108110 extern uffd_test_ops_t shmem_uffd_test_ops;
tools/testing/selftests/mm/uffd-unit-tests.c+12−1
@@ -775,6 +775,8 @@ static void uffd_sigbus_test_common(bool wp) · 774 unmodified lines
775775 char c;
776776 struct uffd_args args = { 0 };
777777
778+ ready_for_fork = false;
779+
778780 fcntl(uffd, F_SETFL, uffd_flags | O_NONBLOCK);
779781
780782 if (uffd_register(uffd, area_dst, nr_pages * page_size,
@@ -790,6 +792,9 @@ static void uffd_sigbus_test_common(bool wp) · 9 unmodified lines
790792 if (pthread_create(&uffd_mon, NULL, uffd_poll_thread, &args))
791793 err("uffd_poll_thread create");
792794
795+ while (!ready_for_fork)
796+ ; /* Wait for the poll_thread to start executing before forking */
797+
793798 pid = fork();
794799 if (pid < 0)
795800 err("fork");
@@ -829,6 +834,8 @@ static void uffd_events_test_common(bool wp) · 33 unmodified lines
829834 char c;
830835 struct uffd_args args = { 0 };
831836
837+ ready_for_fork = false;
838+
832839 fcntl(uffd, F_SETFL, uffd_flags | O_NONBLOCK);
833840 if (uffd_register(uffd, area_dst, nr_pages * page_size,
834841 true, wp, false))
@@ -838,6 +845,9 @@ static void uffd_events_test_common(bool wp) · 3 unmodified lines
838845 if (pthread_create(&uffd_mon, NULL, uffd_poll_thread, &args))
839846 err("uffd_poll_thread create");
840847
848+ while (!ready_for_fork)
849+ ; /* Wait for the poll_thread to start executing before forking */
850+
841851 pid = fork();
842852 if (pid < 0)
843853 err("fork");
@@ -1427,7 +1437,8 @@ uffd_test_case_t uffd_tests[] = { · 583 unmodified lines
14271437 .uffd_fn = uffd_sigbus_wp_test,
14281438 .mem_targets = MEM_ALL,
14291439 .uffd_feature_required = UFFD_FEATURE_SIGBUS |
1430− UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP,
1440+ UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP |
1441+ UFFD_FEATURE_WP_HUGETLBFS_SHMEM,
14311442 },
14321443 {
14331444 .name = "events",
tools/testing/selftests/net/test_vxlan_mdb.sh+128−77
@@ -1177,6 +1177,7 @@ encap_params_common() · 1176 unmodified lines
11771177 local plen=$1; shift
11781178 local enc_ethtype=$1; shift
11791179 local grp=$1; shift
1180+ local grp_dmac=$1; shift
11801181 local src=$1; shift
11811182 local mz=$1; shift
11821183
@@ -1195,11 +1196,11 @@ encap_params_common() · 12 unmodified lines
11951196 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep2_ip src_vni 10020"
11961197
11971198 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $vtep1_ip action pass"
1198− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1199+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
11991200 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12001201 log_test $? 0 "Destination IP - match"
12011202
1202− run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1203+ run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12031204 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12041205 log_test $? 0 "Destination IP - no match"
12051206
@@ -1212,20 +1213,20 @@ encap_params_common() · 6 unmodified lines
12121213 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip dst_port 1111 src_vni 10020"
12131214
12141215 run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower ip_proto udp dst_port 4789 action pass"
1215− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1216+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12161217 tc_check_packets "$ns2" "dev veth0 ingress" 101 1
12171218 log_test $? 0 "Default destination port - match"
12181219
1219− run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1220+ run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12201221 tc_check_packets "$ns2" "dev veth0 ingress" 101 1
12211222 log_test $? 0 "Default destination port - no match"
12221223
12231224 run_cmd "tc -n $ns2 filter replace dev veth0 ingress pref 1 handle 101 proto $enc_ethtype flower ip_proto udp dst_port 1111 action pass"
1224− run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1225+ run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12251226 tc_check_packets "$ns2" "dev veth0 ingress" 101 1
12261227 log_test $? 0 "Non-default destination port - match"
12271228
1228− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1229+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12291230 tc_check_packets "$ns2" "dev veth0 ingress" 101 1
12301231 log_test $? 0 "Non-default destination port - no match"
12311232
@@ -1238,11 +1239,11 @@ encap_params_common() · 6 unmodified lines
12381239 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip src_vni 10020"
12391240
12401241 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 10010 action pass"
1241− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1242+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12421243 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12431244 log_test $? 0 "Default destination VNI - match"
12441245
1245− run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1246+ run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12461247 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12471248 log_test $? 0 "Default destination VNI - no match"
12481249
@@ -1250,11 +1251,11 @@ encap_params_common() · 1 unmodified line
12501251 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent dst $vtep1_ip vni 10010 src_vni 10020"
12511252
12521253 run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_key_id 10020 action pass"
1253− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1254+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12541255 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12551256 log_test $? 0 "Non-default destination VNI - match"
12561257
1257− run_cmd "ip netns exec $ns1 $mz br0.20 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1258+ run_cmd "ip netns exec $ns1 $mz br0.20 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
12581259 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
12591260 log_test $? 0 "Non-default destination VNI - no match"
12601261
@@ -1272,6 +1273,7 @@ encap_params_ipv4_ipv4() · 11 unmodified lines
12721273 local plen=32
12731274 local enc_ethtype="ip"
12741275 local grp=239.1.1.1
1276+ local grp_dmac=01:00:5e:01:01:01
12751277 local src=192.0.2.129
12761278
12771279 echo
@@ -1279,7 +1281,7 @@ encap_params_ipv4_ipv4() · 1 unmodified line
12791281 echo "------------------------------------------------------------------"
12801282
12811283 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \
1282− $grp $src "mausezahn"
1284+ $grp $grp_dmac $src "mausezahn"
12831285 }
12841286
12851287 encap_params_ipv6_ipv4()
@@ -1291,6 +1293,7 @@ encap_params_ipv6_ipv4() · 5 unmodified lines
12911293 local plen=32
12921294 local enc_ethtype="ip"
12931295 local grp=ff0e::1
1296+ local grp_dmac=33:33:00:00:00:01
12941297 local src=2001:db8:100::1
12951298
12961299 echo
@@ -1298,7 +1301,7 @@ encap_params_ipv6_ipv4() · 1 unmodified line
12981301 echo "------------------------------------------------------------------"
12991302
13001303 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \
1301− $grp $src "mausezahn -6"
1304+ $grp $grp_dmac $src "mausezahn -6"
13021305 }
13031306
13041307 encap_params_ipv4_ipv6()
@@ -1310,6 +1313,7 @@ encap_params_ipv4_ipv6() · 5 unmodified lines
13101313 local plen=128
13111314 local enc_ethtype="ipv6"
13121315 local grp=239.1.1.1
1316+ local grp_dmac=01:00:5e:01:01:01
13131317 local src=192.0.2.129
13141318
13151319 echo
@@ -1317,7 +1321,7 @@ encap_params_ipv4_ipv6() · 1 unmodified line
13171321 echo "------------------------------------------------------------------"
13181322
13191323 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \
1320− $grp $src "mausezahn"
1324+ $grp $grp_dmac $src "mausezahn"
13211325 }
13221326
13231327 encap_params_ipv6_ipv6()
@@ -1329,6 +1333,7 @@ encap_params_ipv6_ipv6() · 5 unmodified lines
13291333 local plen=128
13301334 local enc_ethtype="ipv6"
13311335 local grp=ff0e::1
1336+ local grp_dmac=33:33:00:00:00:01
13321337 local src=2001:db8:100::1
13331338
13341339 echo
@@ -1336,7 +1341,7 @@ encap_params_ipv6_ipv6() · 1 unmodified line
13361341 echo "------------------------------------------------------------------"
13371342
13381343 encap_params_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $enc_ethtype \
1339− $grp $src "mausezahn -6"
1344+ $grp $grp_dmac $src "mausezahn -6"
13401345 }
13411346
13421347 starg_exclude_ir_common()
@@ -1347,6 +1352,7 @@ starg_exclude_ir_common() · 4 unmodified lines
13471352 local vtep2_ip=$1; shift
13481353 local plen=$1; shift
13491354 local grp=$1; shift
1355+ local grp_dmac=$1; shift
13501356 local valid_src=$1; shift
13511357 local invalid_src=$1; shift
13521358 local mz=$1; shift
@@ -1368,14 +1374,14 @@ starg_exclude_ir_common() · 15 unmodified lines
13681374 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source_list $invalid_src dst $vtep2_ip src_vni 10010"
13691375
13701376 # Check that invalid source is not forwarded to any VTEP.
1371− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1377+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
13721378 tc_check_packets "$ns2" "dev vx0 ingress" 101 0
13731379 log_test $? 0 "Block excluded source - first VTEP"
13741380 tc_check_packets "$ns2" "dev vx0 ingress" 102 0
13751381 log_test $? 0 "Block excluded source - second VTEP"
13761382
13771383 # Check that valid source is forwarded to both VTEPs.
1378− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1384+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
13791385 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
13801386 log_test $? 0 "Forward valid source - first VTEP"
13811387 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -1385,14 +1391,14 @@ starg_exclude_ir_common() · 3 unmodified lines
13851391 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010"
13861392
13871393 # Check that invalid source is not forwarded to any VTEP.
1388− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1394+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
13891395 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
13901396 log_test $? 0 "Block excluded source after removal - first VTEP"
13911397 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
13921398 log_test $? 0 "Block excluded source after removal - second VTEP"
13931399
13941400 # Check that valid source is forwarded to the remaining VTEP.
1395− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1401+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
13961402 tc_check_packets "$ns2" "dev vx0 ingress" 101 2
13971403 log_test $? 0 "Forward valid source after removal - first VTEP"
13981404 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -1407,6 +1413,7 @@ starg_exclude_ir_ipv4_ipv4() · 8 unmodified lines
14071413 local vtep2_ip=198.51.100.200
14081414 local plen=32
14091415 local grp=239.1.1.1
1416+ local grp_dmac=01:00:5e:01:01:01
14101417 local valid_src=192.0.2.129
14111418 local invalid_src=192.0.2.145
14121419
@@ -1415,7 +1422,7 @@ starg_exclude_ir_ipv4_ipv4() · 2 unmodified lines
14151422 echo "-------------------------------------------------------------"
14161423
14171424 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1418− $valid_src $invalid_src "mausezahn"
1425+ $grp_dmac $valid_src $invalid_src "mausezahn"
14191426 }
14201427
14211428 starg_exclude_ir_ipv6_ipv4()
@@ -1426,6 +1433,7 @@ starg_exclude_ir_ipv6_ipv4() · 4 unmodified lines
14261433 local vtep2_ip=198.51.100.200
14271434 local plen=32
14281435 local grp=ff0e::1
1436+ local grp_dmac=33:33:00:00:00:01
14291437 local valid_src=2001:db8:100::1
14301438 local invalid_src=2001:db8:200::1
14311439
@@ -1434,7 +1442,7 @@ starg_exclude_ir_ipv6_ipv4() · 2 unmodified lines
14341442 echo "-------------------------------------------------------------"
14351443
14361444 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1437− $valid_src $invalid_src "mausezahn -6"
1445+ $grp_dmac $valid_src $invalid_src "mausezahn -6"
14381446 }
14391447
14401448 starg_exclude_ir_ipv4_ipv6()
@@ -1445,6 +1453,7 @@ starg_exclude_ir_ipv4_ipv6() · 4 unmodified lines
14451453 local vtep2_ip=2001:db8:2000::1
14461454 local plen=128
14471455 local grp=239.1.1.1
1456+ local grp_dmac=01:00:5e:01:01:01
14481457 local valid_src=192.0.2.129
14491458 local invalid_src=192.0.2.145
14501459
@@ -1453,7 +1462,7 @@ starg_exclude_ir_ipv4_ipv6() · 2 unmodified lines
14531462 echo "-------------------------------------------------------------"
14541463
14551464 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1456− $valid_src $invalid_src "mausezahn"
1465+ $grp_dmac $valid_src $invalid_src "mausezahn"
14571466 }
14581467
14591468 starg_exclude_ir_ipv6_ipv6()
@@ -1464,6 +1473,7 @@ starg_exclude_ir_ipv6_ipv6() · 4 unmodified lines
14641473 local vtep2_ip=2001:db8:2000::1
14651474 local plen=128
14661475 local grp=ff0e::1
1476+ local grp_dmac=33:33:00:00:00:01
14671477 local valid_src=2001:db8:100::1
14681478 local invalid_src=2001:db8:200::1
14691479
@@ -1472,7 +1482,7 @@ starg_exclude_ir_ipv6_ipv6() · 2 unmodified lines
14721482 echo "-------------------------------------------------------------"
14731483
14741484 starg_exclude_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1475− $valid_src $invalid_src "mausezahn -6"
1485+ $grp_dmac $valid_src $invalid_src "mausezahn -6"
14761486 }
14771487
14781488 starg_include_ir_common()
@@ -1483,6 +1493,7 @@ starg_include_ir_common() · 4 unmodified lines
14831493 local vtep2_ip=$1; shift
14841494 local plen=$1; shift
14851495 local grp=$1; shift
1496+ local grp_dmac=$1; shift
14861497 local valid_src=$1; shift
14871498 local invalid_src=$1; shift
14881499 local mz=$1; shift
@@ -1504,14 +1515,14 @@ starg_include_ir_common() · 15 unmodified lines
15041515 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source_list $valid_src dst $vtep2_ip src_vni 10010"
15051516
15061517 # Check that invalid source is not forwarded to any VTEP.
1507− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1518+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
15081519 tc_check_packets "$ns2" "dev vx0 ingress" 101 0
15091520 log_test $? 0 "Block excluded source - first VTEP"
15101521 tc_check_packets "$ns2" "dev vx0 ingress" 102 0
15111522 log_test $? 0 "Block excluded source - second VTEP"
15121523
15131524 # Check that valid source is forwarded to both VTEPs.
1514− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1525+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
15151526 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
15161527 log_test $? 0 "Forward valid source - first VTEP"
15171528 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -1521,14 +1532,14 @@ starg_include_ir_common() · 3 unmodified lines
15211532 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep2_ip src_vni 10010"
15221533
15231534 # Check that invalid source is not forwarded to any VTEP.
1524− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1535+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
15251536 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
15261537 log_test $? 0 "Block excluded source after removal - first VTEP"
15271538 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
15281539 log_test $? 0 "Block excluded source after removal - second VTEP"
15291540
15301541 # Check that valid source is forwarded to the remaining VTEP.
1531− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1542+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
15321543 tc_check_packets "$ns2" "dev vx0 ingress" 101 2
15331544 log_test $? 0 "Forward valid source after removal - first VTEP"
15341545 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -1543,6 +1554,7 @@ starg_include_ir_ipv4_ipv4() · 8 unmodified lines
15431554 local vtep2_ip=198.51.100.200
15441555 local plen=32
15451556 local grp=239.1.1.1
1557+ local grp_dmac=01:00:5e:01:01:01
15461558 local valid_src=192.0.2.129
15471559 local invalid_src=192.0.2.145
15481560
@@ -1551,7 +1563,7 @@ starg_include_ir_ipv4_ipv4() · 2 unmodified lines
15511563 echo "-------------------------------------------------------------"
15521564
15531565 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1554− $valid_src $invalid_src "mausezahn"
1566+ $grp_dmac $valid_src $invalid_src "mausezahn"
15551567 }
15561568
15571569 starg_include_ir_ipv6_ipv4()
@@ -1562,6 +1574,7 @@ starg_include_ir_ipv6_ipv4() · 4 unmodified lines
15621574 local vtep2_ip=198.51.100.200
15631575 local plen=32
15641576 local grp=ff0e::1
1577+ local grp_dmac=33:33:00:00:00:01
15651578 local valid_src=2001:db8:100::1
15661579 local invalid_src=2001:db8:200::1
15671580
@@ -1570,7 +1583,7 @@ starg_include_ir_ipv6_ipv4() · 2 unmodified lines
15701583 echo "-------------------------------------------------------------"
15711584
15721585 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1573− $valid_src $invalid_src "mausezahn -6"
1586+ $grp_dmac $valid_src $invalid_src "mausezahn -6"
15741587 }
15751588
15761589 starg_include_ir_ipv4_ipv6()
@@ -1581,6 +1594,7 @@ starg_include_ir_ipv4_ipv6() · 4 unmodified lines
15811594 local vtep2_ip=2001:db8:2000::1
15821595 local plen=128
15831596 local grp=239.1.1.1
1597+ local grp_dmac=01:00:5e:01:01:01
15841598 local valid_src=192.0.2.129
15851599 local invalid_src=192.0.2.145
15861600
@@ -1589,7 +1603,7 @@ starg_include_ir_ipv4_ipv6() · 2 unmodified lines
15891603 echo "-------------------------------------------------------------"
15901604
15911605 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1592− $valid_src $invalid_src "mausezahn"
1606+ $grp_dmac $valid_src $invalid_src "mausezahn"
15931607 }
15941608
15951609 starg_include_ir_ipv6_ipv6()
@@ -1600,6 +1614,7 @@ starg_include_ir_ipv6_ipv6() · 4 unmodified lines
16001614 local vtep2_ip=2001:db8:2000::1
16011615 local plen=128
16021616 local grp=ff0e::1
1617+ local grp_dmac=33:33:00:00:00:01
16031618 local valid_src=2001:db8:100::1
16041619 local invalid_src=2001:db8:200::1
16051620
@@ -1608,7 +1623,7 @@ starg_include_ir_ipv6_ipv6() · 2 unmodified lines
16081623 echo "-------------------------------------------------------------"
16091624
16101625 starg_include_ir_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $grp \
1611− $valid_src $invalid_src "mausezahn -6"
1626+ $grp_dmac $valid_src $invalid_src "mausezahn -6"
16121627 }
16131628
16141629 starg_exclude_p2mp_common()
@@ -1618,6 +1633,7 @@ starg_exclude_p2mp_common() · 3 unmodified lines
16181633 local mcast_grp=$1; shift
16191634 local plen=$1; shift
16201635 local grp=$1; shift
1636+ local grp_dmac=$1; shift
16211637 local valid_src=$1; shift
16221638 local invalid_src=$1; shift
16231639 local mz=$1; shift
@@ -1635,12 +1651,12 @@ starg_exclude_p2mp_common() · 11 unmodified lines
16351651 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode exclude source_list $invalid_src dst $mcast_grp src_vni 10010 via veth0"
16361652
16371653 # Check that invalid source is not forwarded.
1638− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1654+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
16391655 tc_check_packets "$ns2" "dev vx0 ingress" 101 0
16401656 log_test $? 0 "Block excluded source"
16411657
16421658 # Check that valid source is forwarded.
1643− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1659+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
16441660 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
16451661 log_test $? 0 "Forward valid source"
16461662
@@ -1648,7 +1664,7 @@ starg_exclude_p2mp_common() · 1 unmodified line
16481664 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0"
16491665
16501666 # Check that valid source is not received anymore.
1651− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1667+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
16521668 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
16531669 log_test $? 0 "Receive of valid source after removal from group"
16541670 }
@@ -1660,6 +1676,7 @@ starg_exclude_p2mp_ipv4_ipv4() · 5 unmodified lines
16601676 local mcast_grp=238.1.1.1
16611677 local plen=32
16621678 local grp=239.1.1.1
1679+ local grp_dmac=01:00:5e:01:01:01
16631680 local valid_src=192.0.2.129
16641681 local invalid_src=192.0.2.145
16651682
@@ -1667,7 +1684,7 @@ starg_exclude_p2mp_ipv4_ipv4() · 1 unmodified line
16671684 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv4 underlay"
16681685 echo "---------------------------------------------------------------"
16691686
1670− starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1687+ starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
16711688 $valid_src $invalid_src "mausezahn"
16721689 }
16731690
@@ -1678,6 +1695,7 @@ starg_exclude_p2mp_ipv6_ipv4() · 4 unmodified lines
16781695 local mcast_grp=238.1.1.1
16791696 local plen=32
16801697 local grp=ff0e::1
1698+ local grp_dmac=33:33:00:00:00:01
16811699 local valid_src=2001:db8:100::1
16821700 local invalid_src=2001:db8:200::1
16831701
@@ -1685,7 +1703,7 @@ starg_exclude_p2mp_ipv6_ipv4() · 1 unmodified line
16851703 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv4 underlay"
16861704 echo "---------------------------------------------------------------"
16871705
1688− starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1706+ starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
16891707 $valid_src $invalid_src "mausezahn -6"
16901708 }
16911709
@@ -1696,6 +1714,7 @@ starg_exclude_p2mp_ipv4_ipv6() · 4 unmodified lines
16961714 local mcast_grp=ff0e::2
16971715 local plen=128
16981716 local grp=239.1.1.1
1717+ local grp_dmac=01:00:5e:01:01:01
16991718 local valid_src=192.0.2.129
17001719 local invalid_src=192.0.2.145
17011720
@@ -1703,7 +1722,7 @@ starg_exclude_p2mp_ipv4_ipv6() · 1 unmodified line
17031722 echo "Data path: (*, G) EXCLUDE - P2MP - IPv4 overlay / IPv6 underlay"
17041723 echo "---------------------------------------------------------------"
17051724
1706− starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1725+ starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
17071726 $valid_src $invalid_src "mausezahn"
17081727 }
17091728
@@ -1714,6 +1733,7 @@ starg_exclude_p2mp_ipv6_ipv6() · 4 unmodified lines
17141733 local mcast_grp=ff0e::2
17151734 local plen=128
17161735 local grp=ff0e::1
1736+ local grp_dmac=33:33:00:00:00:01
17171737 local valid_src=2001:db8:100::1
17181738 local invalid_src=2001:db8:200::1
17191739
@@ -1721,7 +1741,7 @@ starg_exclude_p2mp_ipv6_ipv6() · 1 unmodified line
17211741 echo "Data path: (*, G) EXCLUDE - P2MP - IPv6 overlay / IPv6 underlay"
17221742 echo "---------------------------------------------------------------"
17231743
1724− starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1744+ starg_exclude_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
17251745 $valid_src $invalid_src "mausezahn -6"
17261746 }
17271747
@@ -1732,6 +1752,7 @@ starg_include_p2mp_common() · 4 unmodified lines
17321752 local mcast_grp=$1; shift
17331753 local plen=$1; shift
17341754 local grp=$1; shift
1755+ local grp_dmac=$1; shift
17351756 local valid_src=$1; shift
17361757 local invalid_src=$1; shift
17371758 local mz=$1; shift
@@ -1749,12 +1770,12 @@ starg_include_p2mp_common() · 11 unmodified lines
17491770 run_cmd "bridge -n $ns1 mdb replace dev vx0 port vx0 grp $grp permanent filter_mode include source_list $valid_src dst $mcast_grp src_vni 10010 via veth0"
17501771
17511772 # Check that invalid source is not forwarded.
1752− run_cmd "ip netns exec $ns1 $mz br0.10 -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1773+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $invalid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
17531774 tc_check_packets "$ns2" "dev vx0 ingress" 101 0
17541775 log_test $? 0 "Block excluded source"
17551776
17561777 # Check that valid source is forwarded.
1757− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1778+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
17581779 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
17591780 log_test $? 0 "Forward valid source"
17601781
@@ -1762,7 +1783,7 @@ starg_include_p2mp_common() · 1 unmodified line
17621783 run_cmd "ip -n $ns2 address del $mcast_grp/$plen dev veth0"
17631784
17641785 # Check that valid source is not received anymore.
1765− run_cmd "ip netns exec $ns1 $mz br0.10 -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1786+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $valid_src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
17661787 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
17671788 log_test $? 0 "Receive of valid source after removal from group"
17681789 }
@@ -1774,6 +1795,7 @@ starg_include_p2mp_ipv4_ipv4() · 5 unmodified lines
17741795 local mcast_grp=238.1.1.1
17751796 local plen=32
17761797 local grp=239.1.1.1
1798+ local grp_dmac=01:00:5e:01:01:01
17771799 local valid_src=192.0.2.129
17781800 local invalid_src=192.0.2.145
17791801
@@ -1781,7 +1803,7 @@ starg_include_p2mp_ipv4_ipv4() · 1 unmodified line
17811803 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv4 underlay"
17821804 echo "---------------------------------------------------------------"
17831805
1784− starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1806+ starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
17851807 $valid_src $invalid_src "mausezahn"
17861808 }
17871809
@@ -1792,6 +1814,7 @@ starg_include_p2mp_ipv6_ipv4() · 4 unmodified lines
17921814 local mcast_grp=238.1.1.1
17931815 local plen=32
17941816 local grp=ff0e::1
1817+ local grp_dmac=33:33:00:00:00:01
17951818 local valid_src=2001:db8:100::1
17961819 local invalid_src=2001:db8:200::1
17971820
@@ -1799,7 +1822,7 @@ starg_include_p2mp_ipv6_ipv4() · 1 unmodified line
17991822 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv4 underlay"
18001823 echo "---------------------------------------------------------------"
18011824
1802− starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1825+ starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
18031826 $valid_src $invalid_src "mausezahn -6"
18041827 }
18051828
@@ -1810,6 +1833,7 @@ starg_include_p2mp_ipv4_ipv6() · 4 unmodified lines
18101833 local mcast_grp=ff0e::2
18111834 local plen=128
18121835 local grp=239.1.1.1
1836+ local grp_dmac=01:00:5e:01:01:01
18131837 local valid_src=192.0.2.129
18141838 local invalid_src=192.0.2.145
18151839
@@ -1817,7 +1841,7 @@ starg_include_p2mp_ipv4_ipv6() · 1 unmodified line
18171841 echo "Data path: (*, G) INCLUDE - P2MP - IPv4 overlay / IPv6 underlay"
18181842 echo "---------------------------------------------------------------"
18191843
1820− starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1844+ starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
18211845 $valid_src $invalid_src "mausezahn"
18221846 }
18231847
@@ -1828,6 +1852,7 @@ starg_include_p2mp_ipv6_ipv6() · 4 unmodified lines
18281852 local mcast_grp=ff0e::2
18291853 local plen=128
18301854 local grp=ff0e::1
1855+ local grp_dmac=33:33:00:00:00:01
18311856 local valid_src=2001:db8:100::1
18321857 local invalid_src=2001:db8:200::1
18331858
@@ -1835,7 +1860,7 @@ starg_include_p2mp_ipv6_ipv6() · 1 unmodified line
18351860 echo "Data path: (*, G) INCLUDE - P2MP - IPv6 overlay / IPv6 underlay"
18361861 echo "---------------------------------------------------------------"
18371862
1838− starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp \
1863+ starg_include_p2mp_common $ns1 $ns2 $mcast_grp $plen $grp $grp_dmac \
18391864 $valid_src $invalid_src "mausezahn -6"
18401865 }
18411866
@@ -1847,6 +1872,7 @@ egress_vni_translation_common() · 5 unmodified lines
18471872 local plen=$1; shift
18481873 local proto=$1; shift
18491874 local grp=$1; shift
1875+ local grp_dmac=$1; shift
18501876 local src=$1; shift
18511877 local mz=$1; shift
18521878
@@ -1882,20 +1908,20 @@ egress_vni_translation_common() · 29 unmodified lines
18821908 # Make sure that packets sent from the first VTEP over VLAN 10 are
18831909 # received by the SVI corresponding to the L3VNI (14000 / VLAN 4000) on
18841910 # the second VTEP, since it is configured as PVID.
1885− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1911+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
18861912 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 1
18871913 log_test $? 0 "Egress VNI translation - PVID configured"
18881914
18891915 # Remove PVID flag from VLAN 4000 on the second VTEP and make sure
18901916 # packets are no longer received by the SVI interface.
18911917 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0"
1892− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1918+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
18931919 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 1
18941920 log_test $? 0 "Egress VNI translation - no PVID configured"
18951921
18961922 # Reconfigure the PVID and make sure packets are received again.
18971923 run_cmd "bridge -n $ns2 vlan add vid 4000 dev vx0 pvid"
1898− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
1924+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
18991925 tc_check_packets "$ns2" "dev br0.4000 ingress" 101 2
19001926 log_test $? 0 "Egress VNI translation - PVID reconfigured"
19011927 }
@@ -1908,6 +1934,7 @@ egress_vni_translation_ipv4_ipv4() · 6 unmodified lines
19081934 local plen=32
19091935 local proto="ipv4"
19101936 local grp=239.1.1.1
1937+ local grp_dmac=01:00:5e:01:01:01
19111938 local src=192.0.2.129
19121939
19131940 echo
@@ -1915,7 +1942,7 @@ egress_vni_translation_ipv4_ipv4() · 1 unmodified line
19151942 echo "----------------------------------------------------------------"
19161943
19171944 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \
1918− $src "mausezahn"
1945+ $grp_dmac $src "mausezahn"
19191946 }
19201947
19211948 egress_vni_translation_ipv6_ipv4()
@@ -1926,6 +1953,7 @@ egress_vni_translation_ipv6_ipv4() · 4 unmodified lines
19261953 local plen=32
19271954 local proto="ipv6"
19281955 local grp=ff0e::1
1956+ local grp_dmac=33:33:00:00:00:01
19291957 local src=2001:db8:100::1
19301958
19311959 echo
@@ -1933,7 +1961,7 @@ egress_vni_translation_ipv6_ipv4() · 1 unmodified line
19331961 echo "----------------------------------------------------------------"
19341962
19351963 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \
1936− $src "mausezahn -6"
1964+ $grp_dmac $src "mausezahn -6"
19371965 }
19381966
19391967 egress_vni_translation_ipv4_ipv6()
@@ -1944,6 +1972,7 @@ egress_vni_translation_ipv4_ipv6() · 4 unmodified lines
19441972 local plen=128
19451973 local proto="ipv4"
19461974 local grp=239.1.1.1
1975+ local grp_dmac=01:00:5e:01:01:01
19471976 local src=192.0.2.129
19481977
19491978 echo
@@ -1951,7 +1980,7 @@ egress_vni_translation_ipv4_ipv6() · 1 unmodified line
19511980 echo "----------------------------------------------------------------"
19521981
19531982 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \
1954− $src "mausezahn"
1983+ $grp_dmac $src "mausezahn"
19551984 }
19561985
19571986 egress_vni_translation_ipv6_ipv6()
@@ -1962,6 +1991,7 @@ egress_vni_translation_ipv6_ipv6() · 4 unmodified lines
19621991 local plen=128
19631992 local proto="ipv6"
19641993 local grp=ff0e::1
1994+ local grp_dmac=33:33:00:00:00:01
19651995 local src=2001:db8:100::1
19661996
19671997 echo
@@ -1969,7 +1999,7 @@ egress_vni_translation_ipv6_ipv6() · 1 unmodified line
19691999 echo "----------------------------------------------------------------"
19702000
19712001 egress_vni_translation_common $ns1 $ns2 $mcast_grp $plen $proto $grp \
1972− $src "mausezahn -6"
2002+ $grp_dmac $src "mausezahn -6"
19732003 }
19742004
19752005 all_zeros_mdb_common()
@@ -1982,12 +2012,18 @@ all_zeros_mdb_common() · 6 unmodified lines
19822012 local vtep4_ip=$1; shift
19832013 local plen=$1; shift
19842014 local ipv4_grp=239.1.1.1
2015+ local ipv4_grp_dmac=01:00:5e:01:01:01
19852016 local ipv4_unreg_grp=239.2.2.2
2017+ local ipv4_unreg_grp_dmac=01:00:5e:02:02:02
19862018 local ipv4_ll_grp=224.0.0.100
2019+ local ipv4_ll_grp_dmac=01:00:5e:00:00:64
19872020 local ipv4_src=192.0.2.129
19882021 local ipv6_grp=ff0e::1
2022+ local ipv6_grp_dmac=33:33:00:00:00:01
19892023 local ipv6_unreg_grp=ff0e::2
2024+ local ipv6_unreg_grp_dmac=33:33:00:00:00:02
19902025 local ipv6_ll_grp=ff02::1
2026+ local ipv6_ll_grp_dmac=33:33:00:00:00:01
19912027 local ipv6_src=2001:db8:100::1
19922028
19932029 # Install all-zeros (catchall) MDB entries for IPv4 and IPv6 traffic
@@ -2023,7 +2059,7 @@ all_zeros_mdb_common() · 29 unmodified lines
20232059
20242060 # Send registered IPv4 multicast and make sure it only arrives to the
20252061 # first VTEP.
2026− run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2062+ run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_grp_dmac -A $ipv4_src -B $ipv4_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20272063 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
20282064 log_test $? 0 "Registered IPv4 multicast - first VTEP"
20292065 tc_check_packets "$ns2" "dev vx0 ingress" 102 0
@@ -2031,7 +2067,7 @@ all_zeros_mdb_common() · 1 unmodified line
20312067
20322068 # Send unregistered IPv4 multicast that is not link-local and make sure
20332069 # it arrives to the first and second VTEPs.
2034− run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2070+ run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_unreg_grp_dmac -A $ipv4_src -B $ipv4_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20352071 tc_check_packets "$ns2" "dev vx0 ingress" 101 2
20362072 log_test $? 0 "Unregistered IPv4 multicast - first VTEP"
20372073 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -2039,7 +2075,7 @@ all_zeros_mdb_common() · 1 unmodified line
20392075
20402076 # Send IPv4 link-local multicast traffic and make sure it does not
20412077 # arrive to any VTEP.
2042− run_cmd "ip netns exec $ns1 mausezahn br0.10 -A $ipv4_src -B $ipv4_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2078+ run_cmd "ip netns exec $ns1 mausezahn br0.10 -a own -b $ipv4_ll_grp_dmac -A $ipv4_src -B $ipv4_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20432079 tc_check_packets "$ns2" "dev vx0 ingress" 101 2
20442080 log_test $? 0 "Link-local IPv4 multicast - first VTEP"
20452081 tc_check_packets "$ns2" "dev vx0 ingress" 102 1
@@ -2074,7 +2110,7 @@ all_zeros_mdb_common() · 28 unmodified lines
20742110
20752111 # Send registered IPv6 multicast and make sure it only arrives to the
20762112 # third VTEP.
2077− run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2113+ run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_grp_dmac -A $ipv6_src -B $ipv6_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20782114 tc_check_packets "$ns2" "dev vx0 ingress" 103 1
20792115 log_test $? 0 "Registered IPv6 multicast - third VTEP"
20802116 tc_check_packets "$ns2" "dev vx0 ingress" 104 0
@@ -2082,7 +2118,7 @@ all_zeros_mdb_common() · 1 unmodified line
20822118
20832119 # Send unregistered IPv6 multicast that is not link-local and make sure
20842120 # it arrives to the third and fourth VTEPs.
2085− run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2121+ run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_unreg_grp_dmac -A $ipv6_src -B $ipv6_unreg_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20862122 tc_check_packets "$ns2" "dev vx0 ingress" 103 2
20872123 log_test $? 0 "Unregistered IPv6 multicast - third VTEP"
20882124 tc_check_packets "$ns2" "dev vx0 ingress" 104 1
@@ -2090,7 +2126,7 @@ all_zeros_mdb_common() · 1 unmodified line
20902126
20912127 # Send IPv6 link-local multicast traffic and make sure it does not
20922128 # arrive to any VTEP.
2093− run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -A $ipv6_src -B $ipv6_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2129+ run_cmd "ip netns exec $ns1 mausezahn -6 br0.10 -a own -b $ipv6_ll_grp_dmac -A $ipv6_src -B $ipv6_ll_grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
20942130 tc_check_packets "$ns2" "dev vx0 ingress" 103 2
20952131 log_test $? 0 "Link-local IPv6 multicast - third VTEP"
20962132 tc_check_packets "$ns2" "dev vx0 ingress" 104 1
@@ -2165,6 +2201,7 @@ mdb_fdb_common() · 68 unmodified lines
21652201 local plen=$1; shift
21662202 local proto=$1; shift
21672203 local grp=$1; shift
2204+ local grp_dmac=$1; shift
21682205 local src=$1; shift
21692206 local mz=$1; shift
21702207
@@ -2188,7 +2225,7 @@ mdb_fdb_common() · 17 unmodified lines
21882225
21892226 # Send IP multicast traffic and make sure it is forwarded by the MDB
21902227 # and only arrives to the first VTEP.
2191− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2228+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
21922229 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
21932230 log_test $? 0 "IP multicast - first VTEP"
21942231 tc_check_packets "$ns2" "dev vx0 ingress" 102 0
@@ -2205,7 +2242,7 @@ mdb_fdb_common() · 10 unmodified lines
22052242 # Remove the MDB entry and make sure that IP multicast is now forwarded
22062243 # by the FDB to the second VTEP.
22072244 run_cmd "bridge -n $ns1 mdb del dev vx0 port vx0 grp $grp dst $vtep1_ip src_vni 10010"
2208− run_cmd "ip netns exec $ns1 $mz br0.10 -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
2245+ run_cmd "ip netns exec $ns1 $mz br0.10 -a own -b $grp_dmac -A $src -B $grp -t udp sp=12345,dp=54321 -p 100 -c 1 -q"
22092246 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
22102247 log_test $? 0 "IP multicast after removal - first VTEP"
22112248 tc_check_packets "$ns2" "dev vx0 ingress" 102 2
@@ -2221,14 +2258,15 @@ mdb_fdb_ipv4_ipv4() · 9 unmodified lines
22212258 local plen=32
22222259 local proto="ipv4"
22232260 local grp=239.1.1.1
2261+ local grp_dmac=01:00:5e:01:01:01
22242262 local src=192.0.2.129
22252263
22262264 echo
22272265 echo "Data path: MDB with FDB - IPv4 overlay / IPv4 underlay"
22282266 echo "------------------------------------------------------"
22292267
2230− mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \
2231− "mausezahn"
2268+ mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \
2269+ $grp_dmac $src "mausezahn"
22322270 }
22332271
22342272 mdb_fdb_ipv6_ipv4()
@@ -2240,14 +2278,15 @@ mdb_fdb_ipv6_ipv4() · 5 unmodified lines
22402278 local plen=32
22412279 local proto="ipv6"
22422280 local grp=ff0e::1
2281+ local grp_dmac=33:33:00:00:00:01
22432282 local src=2001:db8:100::1
22442283
22452284 echo
22462285 echo "Data path: MDB with FDB - IPv6 overlay / IPv4 underlay"
22472286 echo "------------------------------------------------------"
22482287
2249− mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \
2250− "mausezahn -6"
2288+ mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \
2289+ $grp_dmac $src "mausezahn -6"
22512290 }
22522291
22532292 mdb_fdb_ipv4_ipv6()
@@ -2259,14 +2298,15 @@ mdb_fdb_ipv4_ipv6() · 5 unmodified lines
22592298 local plen=128
22602299 local proto="ipv4"
22612300 local grp=239.1.1.1
2301+ local grp_dmac=01:00:5e:01:01:01
22622302 local src=192.0.2.129
22632303
22642304 echo
22652305 echo "Data path: MDB with FDB - IPv4 overlay / IPv6 underlay"
22662306 echo "------------------------------------------------------"
22672307
2268− mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \
2269− "mausezahn"
2308+ mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \
2309+ $grp_dmac $src "mausezahn"
22702310 }
22712311
22722312 mdb_fdb_ipv6_ipv6()
@@ -2278,14 +2318,15 @@ mdb_fdb_ipv6_ipv6() · 5 unmodified lines
22782318 local plen=128
22792319 local proto="ipv6"
22802320 local grp=ff0e::1
2321+ local grp_dmac=33:33:00:00:00:01
22812322 local src=2001:db8:100::1
22822323
22832324 echo
22842325 echo "Data path: MDB with FDB - IPv6 overlay / IPv6 underlay"
22852326 echo "------------------------------------------------------"
22862327
2287− mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp $src \
2288− "mausezahn -6"
2328+ mdb_fdb_common $ns1 $ns2 $vtep1_ip $vtep2_ip $plen $proto $grp \
2329+ $grp_dmac $src "mausezahn -6"
22892330 }
22902331
22912332 mdb_grp1_loop()
@@ -2320,7 +2361,9 @@ mdb_torture_common() · 28 unmodified lines
23202361 local vtep1_ip=$1; shift
23212362 local vtep2_ip=$1; shift
23222363 local grp1=$1; shift
2364+ local grp1_dmac=$1; shift
23232365 local grp2=$1; shift
2366+ local grp2_dmac=$1; shift
23242367 local src=$1; shift
23252368 local mz=$1; shift
23262369 local pid1
@@ -2345,9 +2388,9 @@ mdb_torture_common() · 18 unmodified lines
23452388 pid1=$!
23462389 mdb_grp2_loop $ns1 $vtep1_ip $vtep2_ip $grp2 &
23472390 pid2=$!
2348− ip netns exec $ns1 $mz br0.10 -A $src -B $grp1 -t udp sp=12345,dp=54321 -p 100 -c 0 -q &
2391+ ip netns exec $ns1 $mz br0.10 -a own -b $grp1_dmac -A $src -B $grp1 -t udp sp=12345,dp=54321 -p 100 -c 0 -q &
23492392 pid3=$!
2350− ip netns exec $ns1 $mz br0.10 -A $src -B $grp2 -t udp sp=12345,dp=54321 -p 100 -c 0 -q &
2393+ ip netns exec $ns1 $mz br0.10 -a own -b $grp2_dmac -A $src -B $grp2 -t udp sp=12345,dp=54321 -p 100 -c 0 -q &
23512394 pid4=$!
23522395
23532396 sleep 30
@@ -2363,15 +2406,17 @@ mdb_torture_ipv4_ipv4() · 9 unmodified lines
23632406 local vtep1_ip=198.51.100.100
23642407 local vtep2_ip=198.51.100.200
23652408 local grp1=239.1.1.1
2409+ local grp1_dmac=01:00:5e:01:01:01
23662410 local grp2=239.2.2.2
2411+ local grp2_dmac=01:00:5e:02:02:02
23672412 local src=192.0.2.129
23682413
23692414 echo
23702415 echo "Data path: MDB torture test - IPv4 overlay / IPv4 underlay"
23712416 echo "----------------------------------------------------------"
23722417
2373− mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \
2374− "mausezahn"
2418+ mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \
2419+ $grp2_dmac $src "mausezahn"
23752420 }
23762421
23772422 mdb_torture_ipv6_ipv4()
@@ -2380,15 +2425,17 @@ mdb_torture_ipv6_ipv4() · 2 unmodified lines
23802425 local vtep1_ip=198.51.100.100
23812426 local vtep2_ip=198.51.100.200
23822427 local grp1=ff0e::1
2428+ local grp1_dmac=33:33:00:00:00:01
23832429 local grp2=ff0e::2
2430+ local grp2_dmac=33:33:00:00:00:02
23842431 local src=2001:db8:100::1
23852432
23862433 echo
23872434 echo "Data path: MDB torture test - IPv6 overlay / IPv4 underlay"
23882435 echo "----------------------------------------------------------"
23892436
2390− mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \
2391− "mausezahn -6"
2437+ mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \
2438+ $grp2_dmac $src "mausezahn -6"
23922439 }
23932440
23942441 mdb_torture_ipv4_ipv6()
@@ -2397,15 +2444,17 @@ mdb_torture_ipv4_ipv6() · 2 unmodified lines
23972444 local vtep1_ip=2001:db8:1000::1
23982445 local vtep2_ip=2001:db8:2000::1
23992446 local grp1=239.1.1.1
2447+ local grp1_dmac=01:00:5e:01:01:01
24002448 local grp2=239.2.2.2
2449+ local grp2_dmac=01:00:5e:02:02:02
24012450 local src=192.0.2.129
24022451
24032452 echo
24042453 echo "Data path: MDB torture test - IPv4 overlay / IPv6 underlay"
24052454 echo "----------------------------------------------------------"
24062455
2407− mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \
2408− "mausezahn"
2456+ mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \
2457+ $grp2_dmac $src "mausezahn"
24092458 }
24102459
24112460 mdb_torture_ipv6_ipv6()
@@ -2414,15 +2463,17 @@ mdb_torture_ipv6_ipv6() · 2 unmodified lines
24142463 local vtep1_ip=2001:db8:1000::1
24152464 local vtep2_ip=2001:db8:2000::1
24162465 local grp1=ff0e::1
2466+ local grp1_dmac=33:33:00:00:00:01
24172467 local grp2=ff0e::2
2468+ local grp2_dmac=33:33:00:00:00:02
24182469 local src=2001:db8:100::1
24192470
24202471 echo
24212472 echo "Data path: MDB torture test - IPv6 overlay / IPv6 underlay"
24222473 echo "----------------------------------------------------------"
24232474
2424− mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp2 $src \
2425− "mausezahn -6"
2475+ mdb_torture_common $ns1 $vtep1_ip $vtep2_ip $grp1 $grp1_dmac $grp2 \
2476+ $grp2_dmac $src "mausezahn -6"
24262477 }
24272478
24282479 ################################################################################
tools/testing/selftests/net/tls.c+34−0
@@ -1615,6 +1615,40 @@ TEST_F(tls, getsockopt) · 1614 unmodified lines
16151615 EXPECT_EQ(errno, EINVAL);
16161616 }
16171617
1618+TEST_F(tls, recv_efault)
1619+{
1620+ char *rec1 = "1111111111";
1621+ char *rec2 = "2222222222";
1622+ struct msghdr hdr = {};
1623+ struct iovec iov[2];
1624+ char recv_mem[12];
1625+ int ret;
1626+
1627+ if (self->notls)
1628+ SKIP(return, "no TLS support");
1629+
1630+ EXPECT_EQ(send(self->fd, rec1, 10, 0), 10);
1631+ EXPECT_EQ(send(self->fd, rec2, 10, 0), 10);
1632+
1633+ iov[0].iov_base = recv_mem;
1634+ iov[0].iov_len = sizeof(recv_mem);
1635+ iov[1].iov_base = NULL; /* broken iov to make process_rx_list fail */
1636+ iov[1].iov_len = 1;
1637+
1638+ hdr.msg_iovlen = 2;
1639+ hdr.msg_iov = iov;
1640+
1641+ EXPECT_EQ(recv(self->cfd, recv_mem, 1, 0), 1);
1642+ EXPECT_EQ(recv_mem[0], rec1[0]);
1643+
1644+ ret = recvmsg(self->cfd, &hdr, 0);
1645+ EXPECT_LE(ret, sizeof(recv_mem));
1646+ EXPECT_GE(ret, 9);
1647+ EXPECT_EQ(memcmp(rec1, recv_mem, 9), 0);
1648+ if (ret > 9)
1649+ EXPECT_EQ(memcmp(rec2, recv_mem + 9, ret - 9), 0);
1650+}
1651+
16181652 FIXTURE(tls_err)
16191653 {
16201654 int fd, cfd;
tools/testing/selftests/seccomp/settings+1−1
@@ -1 +1 @@
1−timeout=120
1+timeout=180