From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796074687; b=fcXz6Be/wUpHfvpisLb89T/kwG/1LXABtl5Dehjcq7bIcUbTWWI3GvNQkne/CfG0+1g1 ldDZEWFeuKcO8OuUGzxEvI6pVvZj4EF7nL+AEGTJeImphn2iiKnj4LBLIKv0uu6BEtYKz AMLgeeADCm2+DmdA+PvSIt6hPFJ/xCmiPFomZQ5kkYaloca04JOY5O4CKWQMA8dPSzrhm NSd7TJ5h2LkDHluA34Gdp1za+2pSuGCuyJqRk4C01nWdEo5XJZQtS/98YuRGs3hLgtWMH WcRksHkaTqHkAQS6o0otB8808ytamNUeV1q7sE/ST5GiPTS5dJOURq0q9uisjZppt2g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796074687; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=LDwy4F3Fxd7JH92zCHSWlVMqQYK70MHbBCXHYkwios0=; b=3+5aV/FFCU6HFNQzpBzjKmVaT/n9deDJWh7GG1j43TrntsmctS1trqt+b32sikE4C5Qn lf4G80riFMurBXao8TbilliXb6AGisbrtWjcVJ/DU39FvsM3sIO68EfC5b/7RbOVWkgV9 yN/tEp8Q7CAqiwsMHkyfK+ngLQ3BinPrgV/3YGc3PxEHEBA3ZGLbfaut436r3x2U1lPOW 4He9A8degHIFMtqb70NTziyX0Tc8T6qRNKncQBd2vwK0AM0RX9XktDeEEmcESctpAji/8 ueTLdGAzgZnjz3l4x39uiPIP3/FUpGEW268DroAnusep2Am8j6BOOjmVDHHf14Jv7bw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QkePWysz; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 214E560A263B; Mon, 30 Nov 2026 21:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QkePWysz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 998631F0181E; Mon, 30 Nov 2026 21:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796074686; bh=LDwy4F3Fxd7JH92zCHSWlVMqQYK70MHbBCXHYkwios0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=QkePWyszUKZ8tHV3nawNrYNAayOFUvrS1Bpm8VJ2U8PhtzJT5WVBbi858SK7azh2Z ZzKCxK87kdlax8sXPXuEJcNi4s6Hs4FX6T++IDHyAONstWHxmkPMDoMctvbGGnZ9Mk BFMpVRxk2OYhRY7Wmho9gE5C5+W8cWK2Ncob5OweL9MWD/1yFoyGUD84pvSDWyJVFf u1Fm6OwF7udXLKVvwo+4ZBYaTIX7RCwLHGYYElmn2S+9Xn3Yfglswz2wzlGVLivKMt HzDJrPXlJ0LsF+HHsWG1ki3ObdmN87y58tv3+h54Cn/P7tqQdGt87KiNm2tM5JAmwB 3z0Rz52FjOtsA== Message-ID: <6aa42305-03a5-4c7a-b811-ba82548bd6c8@kernel.org> Date: Mon, 30 Nov 2026 13:38:05 -0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH ath-next 0/7] wifi: ath12k: fix MLO active-links handling To: Miaoqing Pan , jjohnson@kernel.org Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261118025520.39269-1-miaoqing.pan@oss.qualcomm.com> From: Jeff Johnson Content-Language: en-US In-Reply-To: <20261118025520.39269-1-miaoqing.pan@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/17/2026 6:55 PM, Miaoqing Pan wrote: > mac80211 calls drv_change_vif_links() and drv_change_sta_links() for > both valid-links and active-links changes. ath12k does not distinguish > between the two, causing WARN_ON/incorrect teardown in change_vif_links(), > inconsistent vdev state in the chanctx callbacks, and silent > firmware miss in change_sta_links(). > > This series derives link object lifetime from vif->valid_links and > sta->valid_links, which mac80211 updates before calling the driver, > instead of from the active-links sets. A STA link vdev keeps running when > its link is deactivated. The active/inactive link state is programmed to > firmware with WMI_MLO_LINK_SET_ACTIVE_CMDID, sent to each device that > holds vdevs of the STA, and only when it differs from the state last > programmed. > > Patch 1 adds WMI infrastructure: the response event struct, > WMI_TAG_MLO_LINK_SET_ACTIVE_RESP_EVENT tag, and the event handler > registered in ath12k_wmi_op_rx(). The handler only parses and logs > the event at this point; delivery to the waiter is wired up in patch 7. > > Patch 2 sets CTRL_F_OVERWRITE_FORCE_ACTIVE_BITMAP and > CTRL_F_OVERWRITE_FORCE_INACTIVE_BITMAP for FORCE_ACTIVE_INACTIVE, so that > firmware replaces the force bitmaps instead of accumulating them. It also > copies the AP MLD address into the command, and fixes the > CRTL_F_DYNC_FORCE_LINK_NUM typo. > > Patch 3 fixes ath12k_mac_op_change_vif_links() so that link vif lifetime > follows vif->valid_links. A link that is only deactivated keeps its link > vif, and a disconnect (valid_links == 0) removes all remaining link vifs. > > Patch 4 makes ath12k_mac_get_vif_up() skip links without a channel > context. A deactivated link keeps its vdev up in firmware but has > released its channel context, so it must not be used to derive the > target pdev. The WARN_ON() in ath12k_mac_get_target_pdev_id_from_vif() > is kept. > > Patch 5 stops clearing is_started for a STA vdev in > unassign_vif_chanctx(). The vdev is not stopped there, so the flag now > keeps matching the firmware state. assign_vif_chanctx() then compares the > new channel with started_chandef: if it is unchanged nothing is done. > Otherwise the vdev is restarted on the new channel, or stopped and started > if it is not up. Station removal clears is_started once the STA vdev has > been stopped, so that a reconnect on targets with vdev_start_delay starts > the vdev again. > > Patch 6 fixes the bounds checks in ath12k_mac_mlo_sta_set_link_active(). > The vdev_bitmap and inactive_vdev_bitmap arrays are sized by > WMI_MLO_VDEV_BITMAP_SZ, but the checks compared against > WMI_MLO_LINK_NUM_SZ. Both are 2 today, so there is no functional change. > The checks now use the constant of the array they guard. > > Patch 7 makes ath12k_mac_op_change_sta_links() create link STAs for > sta->valid_links that are not yet in links_map. Link STA removal is > still left to STA removal, as firmware does not support it. Once the STA > is authorized, a link holding a channel context is active, and a link > with a link STA and link vif but no channel context is inactive. The > result is compared with ahvif->fw_active_links and > ahvif->fw_inactive_links, and WMI_MLO_LINK_SET_ACTIVE_CMDID is sent only > when it differs. It is sent to each device that holds vdevs of the STA, > with that device's links, and the driver waits for each device's > response, except in the INACTIVE_LINK_NUM case, which is sent without > waiting. If a device holds some of the STA's links but none of them is > active, the update fails with -EOPNOTSUPP. If the device crashes while a request is pending, > ath12k_core_pre_reconfigure_recovery() releases the waiter before it > takes the wiphy lock. > > Patch 7 depends on patches 1, 2, 3 and 5: it needs the response event > from patch 1, the ap_mld_addr argument from patch 2, link vifs that > survive deactivation from patch 3, and a STA link vdev that stays > started across deactivation from patch 5. Patches 1-6 each apply to the > base on their own, and the whole series applies in order. > > > Miaoqing Pan (7): > wifi: ath12k: add WMI response handling for MLO link set active > command > wifi: ath12k: send overwrite flags and AP MLD addr in MLO link set > active > wifi: ath12k: fix ath12k_mac_op_change_vif_links() for active-link > updates > wifi: ath12k: skip links without channel context in > ath12k_mac_get_vif_up() > wifi: ath12k: restart STA link vdev on chanctx assign if channel > changed > wifi: ath12k: use WMI_MLO_VDEV_BITMAP_SZ for vdev bitmap bounds check > wifi: ath12k: handle MLO active link updates > > drivers/net/wireless/ath/ath12k/core.c | 15 ++ > drivers/net/wireless/ath/ath12k/core.h | 25 ++ > drivers/net/wireless/ath/ath12k/mac.c | 335 ++++++++++++++++++++++--- > drivers/net/wireless/ath/ath12k/wmi.c | 54 +++- > drivers/net/wireless/ath/ath12k/wmi.h | 11 +- > 5 files changed, 405 insertions(+), 35 deletions(-) > > > base-commit: 4016f6c3149e7e3faccc1654db6a3030c069383a pw-bot: cr