From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>, jjohnson@kernel.org
Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] wifi: ath12k: fix MLO dp_peer ID desync with firmware
Date: Fri, 31 Jul 2026 16:02:52 +0800 [thread overview]
Message-ID: <f7e90024-df8e-4fad-ad42-864c092a56d2@oss.qualcomm.com> (raw)
In-Reply-To: <20260727162748.963275-4-jtornosm@redhat.com>
On 7/28/2026 12:27 AM, Jose Ignacio Tornos Martinez wrote:
> TX completions fail with:
> "dp_tx: failed to find the peer with peer_id <N>"
>
> where <N> is an ML peer_id (host-assigned ml_peer_id OR'd with
> ATH12K_PEER_ML_ID_VALID, BIT(13) = 0x2000). This happens because
> the firmware uses an internal monotonic counter for ML peer IDs that
> does not necessarily match the host-assigned ml_peer_id. The desync
> has been observed in normal MLO operation and is particularly
> reproducible after firmware crash recovery, where the
> create-delete-create cycle guarantees the firmware increments its
> internal counter.
>
> Currently, ath12k_dp_peer_create() stores the host-assigned
> ml_peer_id (with ATH12K_PEER_ML_ID_VALID OR'd in) as dp_peer->peer_id
> and immediately populates the dp_peers[] RCU lookup table at that
> index. When the firmware later uses a different peer_id in its data
> path descriptors, ath12k_dp_peer_find_by_peerid() looks up the wrong
> index and returns NULL, causing the "failed to find peer" error on
> every TX completion.
>
> Fix this by initializing dp_peer->peer_id to ATH12K_DP_PEER_ID_INVALID
> for MLO peers at creation time, deferring the dp_peers[] RCU table
> population. When ath12k_dp_peer_find_by_peerid() encounters a lookup
> miss for an ML peer_id (one with ATH12K_PEER_ML_ID_VALID set), it
> walks dp_peers_list for an MLO peer whose peer_id is still INVALID,
> syncs peer_id from the firmware's actual value, and populates the
> dp_peers[] table. This lazy sync approach ensures the host always uses
> the firmware's real ML peer_id regardless of any internal firmware
> counter behavior.
>
> Guard the dp_peers[] RCU table clear in ath12k_dp_peer_delete() and
> ath12k_mac_dp_peer_cleanup() against ATH12K_DP_PEER_ID_INVALID to
> avoid clearing uninitialized slots. Replace per-peer clear_bit() with
> bitmap_zero() in ath12k_mac_dp_peer_cleanup() to avoid out-of-bounds
> access when peer_id has not been synced yet.
>
this is a known issue and has been fixed by [1], and that fix has landed in ath.git [2], please try.
[1] https://lore.kernel.org/ath12k/20260720-ath12k-fw-allocated-ml-peer-id-v2-0-630632758a80@oss.qualcomm.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/
next prev parent reply other threads:[~2026-07-31 8:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 16:27 [PATCH 0/5] wifi: ath12k: fixes to improve MLO station stability Jose Ignacio Tornos Martinez
2026-07-27 16:27 ` [PATCH 1/5] wifi: ath12k: fix MLO station firmware crash recovery Jose Ignacio Tornos Martinez
2026-07-31 8:48 ` Baochen Qiang
2026-08-03 15:02 ` Jose Ignacio Tornos Martinez
2026-07-27 16:27 ` [PATCH 2/5] wifi: ath12k: prevent scan during firmware recovery Jose Ignacio Tornos Martinez
2026-07-31 8:16 ` Baochen Qiang
2026-08-03 15:08 ` Jose Ignacio Tornos Martinez
2026-07-27 16:27 ` [PATCH 3/5] wifi: ath12k: fix MLO dp_peer ID desync with firmware Jose Ignacio Tornos Martinez
2026-07-31 8:02 ` Baochen Qiang [this message]
2026-08-03 15:12 ` Jose Ignacio Tornos Martinez
2026-07-27 16:27 ` [PATCH 4/5] wifi: ath12k: fix MLO beacon handling using per-link addressing Jose Ignacio Tornos Martinez
2026-07-31 8:48 ` Baochen Qiang
2026-08-03 15:18 ` Jose Ignacio Tornos Martinez
2026-07-27 16:27 ` [PATCH 5/5] wifi: ath12k: skip connection_loss_work for MLO beacon miss Jose Ignacio Tornos Martinez
2026-07-31 8:48 ` Baochen Qiang
2026-08-03 15:22 ` Jose Ignacio Tornos Martinez
2026-07-31 22:04 ` [PATCH 0/5] wifi: ath12k: fixes to improve MLO station stability Jeff Johnson
2026-08-03 14:56 ` Jose Ignacio Tornos Martinez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7e90024-df8e-4fad-ad42-864c092a56d2@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=ath11k@lists.infradead.org \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=jtornosm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox