From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Sujuan Chen <sujuan.chen@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
linux-wireless <linux-wireless@vger.kernel.org>,
Bo Jiao <bo.jiao@mediatek.com>,
Ryder Lee <ryder.lee@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2] wifi: mt76: mt7915: add dev->hif2 support for mt7916 WED device
Date: Wed, 22 Feb 2023 11:23:54 +0100 [thread overview]
Message-ID: <Y/XtOhW5fUshrUPY@lore-desk> (raw)
In-Reply-To: <73e1988a12a60fa0c661edc8328a302b92392b94.1677056399.git.sujuan.chen@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 3122 bytes --]
> Enable two PCIe interfaces (dev->hif2) support for mt7916 when WED is enabled.
>
> Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7915/dma.c | 10 ++++++++--
> drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 4 +++-
> drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 10 +++++-----
> 3 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/dma.c b/drivers/net/wireless/mediatek/mt76/mt7915/dma.c
> index abe17dac9996..43a5456d4b97 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/dma.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/dma.c
> @@ -87,8 +87,14 @@ static void mt7915_dma_config(struct mt7915_dev *dev)
> MT7916_RXQ_BAND0);
> RXQ_CONFIG(MT_RXQ_MCU_WA, WFDMA0, MT_INT_WED_RX_DONE_WA_MT7916,
> MT7916_RXQ_MCU_WA);
> - RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0, MT_INT_WED_RX_DONE_BAND1_MT7916,
> - MT7916_RXQ_BAND1);
> + if (dev->hif2)
> + RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0,
> + MT_INT_RX_DONE_BAND1_MT7916,
> + MT7916_RXQ_BAND1);
> + else
> + RXQ_CONFIG(MT_RXQ_BAND1, WFDMA0,
> + MT_INT_WED_RX_DONE_BAND1_MT7916,
> + MT7916_RXQ_BAND1);
> RXQ_CONFIG(MT_RXQ_MAIN_WA, WFDMA0, MT_INT_WED_RX_DONE_WA_MAIN_MT7916,
> MT7916_RXQ_MCU_WA_MAIN);
> TXQ_CONFIG(0, WFDMA0, MT_INT_WED_TX_DONE_BAND0,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index 5545a8bdf1d0..1dfbcc9bf755 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -2370,7 +2370,9 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
> if (ret)
> return ret;
>
> - if (mtk_wed_device_active(&dev->mt76.mmio.wed) && is_mt7915(&dev->mt76))
> + if ((mtk_wed_device_active(&dev->mt76.mmio.wed) &&
> + is_mt7915(&dev->mt76)) ||
> + (!mtk_wed_get_rx_capa(&dev->mt76.mmio.wed)))
you do not need brackets around mtk_wed_get_rx_capa().
Regards,
Lorenzo
> mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(CAPABILITY), 0, 0, 0);
>
> ret = mt7915_mcu_set_mwds(dev, 1);
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> index 225a19604d3e..6f0c0e2ae045 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
> @@ -989,13 +989,13 @@ irqreturn_t mt7915_irq_handler(int irq, void *dev_instance)
> struct mt7915_dev *dev = dev_instance;
> struct mtk_wed_device *wed = &dev->mt76.mmio.wed;
>
> - if (mtk_wed_device_active(wed)) {
> + if (mtk_wed_device_active(wed))
> mtk_wed_device_irq_set_mask(wed, 0);
> - } else {
> + else
> mt76_wr(dev, MT_INT_MASK_CSR, 0);
> - if (dev->hif2)
> - mt76_wr(dev, MT_INT1_MASK_CSR, 0);
> - }
> +
> + if (dev->hif2)
> + mt76_wr(dev, MT_INT1_MASK_CSR, 0);
>
> if (!test_bit(MT76_STATE_INITIALIZED, &dev->mphy.state))
> return IRQ_NONE;
> --
> 2.18.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-02-22 10:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 9:08 [PATCH v2] wifi: mt76: mt7915: add dev->hif2 support for mt7916 WED device Sujuan Chen
2023-02-22 10:23 ` Lorenzo Bianconi [this message]
2023-02-22 13:03 ` Sujuan Chen (陈素娟)
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=Y/XtOhW5fUshrUPY@lore-desk \
--to=lorenzo@kernel.org \
--cc=bo.jiao@mediatek.com \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=sujuan.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox