From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Shayne Chen <shayne.chen@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
linux-wireless <linux-wireless@vger.kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
Rex Lu <rex.lu@mediatek.com>
Subject: Re: [PATCH mt76 12/12] wifi: mt76: mt7996: fix EMI rings for RRO
Date: Wed, 5 Nov 2025 11:57:39 +0100 [thread overview]
Message-ID: <aQstowRMsLD-6A-z@lore-desk> (raw)
In-Reply-To: <20251105093100.541408-12-shayne.chen@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 3580 bytes --]
On Nov 05, Shayne Chen wrote:
> The RRO EMI rings only need to be allocated when WED is not active.
> This patch fixes command timeout issue for the setting of WED off and
> RRO on.
>
> Fixes: 3a29164425e9 ("wifi: mt76: mt7996: Add SW path for HW-RRO v3.1")
> Co-developed-by: Rex Lu <rex.lu@mediatek.com>
> Signed-off-by: Rex Lu <rex.lu@mediatek.com>
> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> .../net/wireless/mediatek/mt76/mt7996/dma.c | 15 +++++++++------
> .../net/wireless/mediatek/mt76/mt7996/init.c | 19 ++++++++++++++++---
> 2 files changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/dma.c b/drivers/net/wireless/mediatek/mt76/mt7996/dma.c
> index 7ac4defca29d..274b273df1ee 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/dma.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/dma.c
> @@ -515,12 +515,15 @@ int mt7996_dma_rro_init(struct mt7996_dev *dev)
> if (ret)
> return ret;
>
> - /* We need to set cpu idx pointer before resetting the EMI
> - * queues.
> - */
> - mdev->q_rx[MT_RXQ_RRO_RXDMAD_C].emi_cpu_idx =
> - &dev->wed_rro.emi_rings_cpu.ptr->ring[0].idx;
> - mt76_queue_reset(dev, &mdev->q_rx[MT_RXQ_RRO_RXDMAD_C], true);
> + if (!mtk_wed_device_active(&mdev->mmio.wed)) {
> + /* We need to set cpu idx pointer before resetting the
> + * EMI queues.
> + */
> + mdev->q_rx[MT_RXQ_RRO_RXDMAD_C].emi_cpu_idx =
> + &dev->wed_rro.emi_rings_cpu.ptr->ring[0].idx;
> + mt76_queue_reset(dev, &mdev->q_rx[MT_RXQ_RRO_RXDMAD_C],
> + true);
> + }
> goto start_hw_rro;
> }
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> index bd7b720c64c5..00a8286bd136 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> @@ -960,9 +960,10 @@ static int mt7996_wed_rro_init(struct mt7996_dev *dev)
> MT7996_RRO_MSDU_PG_SIZE_PER_CR);
> }
>
> - if (dev->mt76.hwrro_mode == MT76_HWRRO_V3_1) {
> + if (!mtk_wed_device_active(&dev->mt76.mmio.wed) &&
> + dev->mt76.hwrro_mode == MT76_HWRRO_V3_1) {
> ptr = dmam_alloc_coherent(dev->mt76.dma_dev,
> - sizeof(dev->wed_rro.emi_rings_cpu.ptr),
> + sizeof(*dev->wed_rro.emi_rings_cpu.ptr),
> &dev->wed_rro.emi_rings_cpu.phy_addr,
> GFP_KERNEL);
> if (!ptr)
> @@ -971,7 +972,7 @@ static int mt7996_wed_rro_init(struct mt7996_dev *dev)
> dev->wed_rro.emi_rings_cpu.ptr = ptr;
>
> ptr = dmam_alloc_coherent(dev->mt76.dma_dev,
> - sizeof(dev->wed_rro.emi_rings_dma.ptr),
> + sizeof(*dev->wed_rro.emi_rings_dma.ptr),
> &dev->wed_rro.emi_rings_dma.phy_addr,
> GFP_KERNEL);
> if (!ptr)
> @@ -1037,6 +1038,18 @@ static void mt7996_wed_rro_free(struct mt7996_dev *dev)
> dev->wed_rro.msdu_pg[i].phy_addr);
> }
>
> + if (dev->wed_rro.emi_rings_cpu.ptr)
> + dmam_free_coherent(dev->mt76.dma_dev,
> + sizeof(*dev->wed_rro.emi_rings_cpu.ptr),
> + dev->wed_rro.emi_rings_cpu.ptr,
> + dev->wed_rro.emi_rings_cpu.phy_addr);
> +
> + if (dev->wed_rro.emi_rings_dma.ptr)
> + dmam_free_coherent(dev->mt76.dma_dev,
> + sizeof(*dev->wed_rro.emi_rings_dma.ptr),
> + dev->wed_rro.emi_rings_dma.ptr,
> + dev->wed_rro.emi_rings_dma.phy_addr);
> +
> if (!dev->wed_rro.session.ptr)
> return;
>
> --
> 2.51.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2025-11-05 10:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 9:30 [PATCH mt76 01/12] wifi: mt76: mt7996: fix max nss value when getting rx chainmask Shayne Chen
2025-11-05 9:30 ` [PATCH mt76 02/12] wifi: mt76: mt7996: no need to wait ACK event for SDO command Shayne Chen
2025-11-05 9:30 ` [PATCH mt76 03/12] wifi: mt76: mt7996: fix implicit beamforming support for mt7992 Shayne Chen
2025-11-05 9:30 ` [PATCH mt76 04/12] wifi: mt76: mt7996: support fixed rate for link station Shayne Chen
2025-11-05 9:30 ` [PATCH mt76 05/12] wifi: mt76: mt7996: fix several fields in mt7996_mcu_bss_basic_tlv() Shayne Chen
2025-11-05 10:04 ` Lorenzo Bianconi
2025-11-05 9:30 ` [PATCH mt76 06/12] wifi: mt76: mt7996: fix teardown command for an MLD peer Shayne Chen
2025-11-05 10:09 ` Lorenzo Bianconi
2025-11-05 9:30 ` [PATCH mt76 07/12] wifi: mt76: mt7996: set link_valid field when initializing wcid Shayne Chen
2025-11-05 10:15 ` Lorenzo Bianconi
2025-11-05 9:30 ` [PATCH mt76 08/12] wifi: mt76: mt7996: use correct link_id when filling TXD and TXP Shayne Chen
2025-11-05 10:34 ` Lorenzo Bianconi
2025-11-05 9:30 ` [PATCH mt76 09/12] wifi: mt76: mt7996: fix MLD group index assignment Shayne Chen
2025-11-05 10:42 ` Lorenzo Bianconi
2025-11-05 9:30 ` [PATCH mt76 10/12] wifi: mt76: mt7996: fix MLO set key and group key issues Shayne Chen
2025-11-05 9:30 ` [PATCH mt76 11/12] wifi: mt76: mt7996: fix using wrong phy to start in mt7996_mac_restart() Shayne Chen
2025-11-05 10:45 ` Lorenzo Bianconi
2025-11-05 9:31 ` [PATCH mt76 12/12] wifi: mt76: mt7996: fix EMI rings for RRO Shayne Chen
2025-11-05 10:57 ` 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=aQstowRMsLD-6A-z@lore-desk \
--to=lorenzo@kernel.org \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=rex.lu@mediatek.com \
--cc=ryder.lee@mediatek.com \
--cc=shayne.chen@mediatek.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.