From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Devin Wittmayer <lucid_duck@justthetip.ca>
Cc: Felix Fietkau <nbd@nbd.name>, Ryder Lee <ryder.lee@mediatek.com>,
Shayne Chen <shayne.chen@mediatek.com>,
Sean Wang <sean.wang@mediatek.com>,
linux-wireless@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] wifi: mt76: restrict NPU/PPE active checks to MMIO devices
Date: Tue, 21 Jul 2026 15:38:05 +0200 [thread overview]
Message-ID: <al92Pe2Z-oTiGsHv@lore-desk> (raw)
In-Reply-To: <20260720232640.41293-1-lucid_duck@justthetip.ca>
[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]
> mt76_npu_device_active() and mt76_ppe_device_active() read dev->mmio.npu
> and dev->mmio.ppe_dev. The mmio, usb and sdio bus structs share a union in
> struct mt76_dev, so on USB and SDIO these read unrelated data from the
> usb/sdio struct, which is non-NULL in practice.
>
> mt76_npu_device_active() then returns true on USB, and
> mt76_rx_poll_complete() takes the offload path and skips
> mt76_rx_aggr_reorder(). RX A-MPDU subframes are delivered out of order and
> the peer's TCP stack treats that as loss: heavy retransmissions and reduced
> throughput in AP mode. Seen on mt7921u, mt7925u, mt76x2u and mt76x0u.
>
> Gate both helpers on mt76_is_mmio() so they only run for the bus type that
> owns the mmio union member.
>
> Fixes: 7fb554b1b623 ("wifi: mt76: Introduce the NPU generic layer")
> Cc: stable@vger.kernel.org
> Tested-by: Nick Morrow <morrownr@gmail.com>
> Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> drivers/net/wireless/mediatek/mt76/mt76.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
> index 07955555f84d..a32ba7c23f92 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt76.h
> @@ -1736,12 +1736,12 @@ static inline int mt76_npu_send_txrx_addr(struct mt76_dev *dev, int ifindex,
>
> static inline bool mt76_npu_device_active(struct mt76_dev *dev)
> {
> - return !!rcu_access_pointer(dev->mmio.npu);
> + return mt76_is_mmio(dev) && !!rcu_access_pointer(dev->mmio.npu);
> }
>
> static inline bool mt76_ppe_device_active(struct mt76_dev *dev)
> {
> - return !!rcu_access_pointer(dev->mmio.ppe_dev);
> + return mt76_is_mmio(dev) && !!rcu_access_pointer(dev->mmio.ppe_dev);
> }
>
> static inline int mt76_npu_send_msg(struct airoha_npu *npu, int ifindex,
> --
> 2.55.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2026-07-21 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 23:27 [PATCH] wifi: mt76: restrict NPU/PPE active checks to MMIO devices Devin Wittmayer
2026-07-21 13:38 ` 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=al92Pe2Z-oTiGsHv@lore-desk \
--to=lorenzo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lucid_duck@justthetip.ca \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shayne.chen@mediatek.com \
--cc=stable@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