From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
To: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Cc: Jeff Johnson <jjohnson@kernel.org>, Kalle Valo <kvalo@kernel.org>,
Baochen Qiang <quic_bqiang@quicinc.com>,
linux-wireless@vger.kernel.org, ath12k@lists.infradead.org
Subject: Re: [PATCH ath-current v3] wifi: ath12k: fix DMA direction for re-injected Rx buffers
Date: Sun, 15 Nov 2026 09:58:16 +0100 [thread overview]
Message-ID: <avl0KJunNkgixBIS@lore-desk> (raw)
In-Reply-To: <92d632b3-3aee-4786-9c89-b106b66a32ac@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]
> On 10/23/2026 9:49 AM, Lorenzo Bianconi wrote:
> > Defragmented MPDUs that are re-injected into the REO are mapped with
> > DMA_TO_DEVICE, but all the Rx reap and teardown paths unmap them with
> > DMA_FROM_DEVICE. The DMA API requires the unmap direction to match the
> > map direction, so this violates the contract.
> >
> > The mapping actually spans both directions, since the host has written
> > the buffer before the REO reads it and the buffer is read back by the
> > host afterwards, so DMA_BIDIRECTIONAL is the correct choice.
> >
> > Add a common ath12k_dp_unmap_rx_buf() helper that selects
> > DMA_BIDIRECTIONAL for re-injected buffers, identified by the existing
> > ath12k_skb_rxcb::is_frag flag, and DMA_FROM_DEVICE otherwise, then use it
> > in all the Rx reap and cleanup paths. Map and unmap the re-injected buffer
> > with DMA_BIDIRECTIONAL consistently.
> >
> > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3
> >
> > Fixes: 33322e3ef074 ("wifi: ath12k: change DMA direction while mapping reinjected packets")
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> > ---
> > Changes in v3:
> > - Set ATH12K_SKB_RXCB()->paddr before err_unmap_dma condition in
> > ath12k_wifi7_dp_rx_h_defrag_reo_reinject().
> > - Link to v2: https://lore.kernel.org/r/20261023-ath12k-fix-dma-mapping-for-reinject-packets-v2-1-9f436a26dd72@oss.qualcomm.com
> >
> > Changes in v2:
> > - Rely on ath12k_skb_rxcb is_frag field and drop reinjected one.
> > - Link to v1: https://lore.kernel.org/r/20261017-ath12k-fix-dma-mapping-for-reinject-packets-v1-1-b94860e18ba4@oss.qualcomm.com
> > ---
> > drivers/net/wireless/ath/ath12k/dp.c | 6 ++---
> > drivers/net/wireless/ath/ath12k/dp_mon.c | 5 ++--
> > drivers/net/wireless/ath/ath12k/dp_rx.c | 3 +--
> > drivers/net/wireless/ath/ath12k/dp_rx.h | 11 ++++++++
> > drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c | 17 +++---------
> > drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c | 37 ++++++++------------------
> > 6 files changed, 31 insertions(+), 48 deletions(-)
> This conflicts with recently added:
> febe1f8cbccc ("wifi: ath12k: avoid double DMA unmap of held monitor RX buffers")
>
> Please rebase.
ack, I will fix it in v4. Thanks.
Regards,
Lorenzo
>
> /jeff
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2026-11-15 8:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 16:49 [PATCH ath-current v3] wifi: ath12k: fix DMA direction for re-injected Rx buffers Lorenzo Bianconi
2026-10-26 2:48 ` Baochen Qiang
2026-11-14 20:22 ` Jeff Johnson
2026-11-15 8:58 ` Lorenzo Bianconi [this message]
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=avl0KJunNkgixBIS@lore-desk \
--to=lorenzo.bianconi@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=jjohnson@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_bqiang@quicinc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.