From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mt76: mt7921: set MT76_RESET during mac reset
Date: Fri, 28 May 2021 16:48:19 +0200 [thread overview]
Message-ID: <YLECsxSLgurAzyIS@lore-desk> (raw)
In-Reply-To: <f201e2d43858d022eb149a7cc29c82ea0361d328.1622210344.git.lorenzo@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2170 bytes --]
> Set MT76_RESET during mt7921_mac_reset in order to avoid packet
> transmissions. Move tx scheduling at the end of reset routine.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Hi Felix,
please drop this patch, I need to fix an issue.
Regards,
Lorenzo
> ---
> Changes since v1:
> - move tx scheduling at the end of reset routine
> ---
> .../net/wireless/mediatek/mt76/mt7921/mac.c | 20 ++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index 4d1050ae9f39..baaca4eb715e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -1255,6 +1255,7 @@ mt7921_mac_reset(struct mt7921_dev *dev)
> mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA, 0);
> mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0x0);
>
> + set_bit(MT76_RESET, &dev->mphy.state);
> set_bit(MT76_MCU_RESET, &dev->mphy.state);
> wake_up(&dev->mt76.mcu.wait);
> skb_queue_purge(&dev->mt76.mcu.res_q);
> @@ -1274,17 +1275,13 @@ mt7921_mac_reset(struct mt7921_dev *dev)
> if (err)
> return err;
>
> + clear_bit(MT76_MCU_RESET, &dev->mphy.state);
> +
> mt76_for_each_q_rx(&dev->mt76, i) {
> napi_enable(&dev->mt76.napi[i]);
> napi_schedule(&dev->mt76.napi[i]);
> }
>
> - napi_enable(&dev->mt76.tx_napi);
> - napi_schedule(&dev->mt76.tx_napi);
> - mt76_worker_enable(&dev->mt76.tx_worker);
> -
> - clear_bit(MT76_MCU_RESET, &dev->mphy.state);
> -
> mt76_wr(dev, MT_WFDMA0_HOST_INT_ENA,
> MT_INT_RX_DONE_ALL | MT_INT_TX_DONE_ALL |
> MT_INT_MCU_CMD);
> @@ -1302,7 +1299,16 @@ mt7921_mac_reset(struct mt7921_dev *dev)
> if (err)
> return err;
>
> - return __mt7921_start(&dev->phy);
> + err = __mt7921_start(&dev->phy);
> + if (err)
> + return err;
> +
> + clear_bit(MT76_RESET, &dev->mphy.state);
> + napi_enable(&dev->mt76.tx_napi);
> + napi_schedule(&dev->mt76.tx_napi);
> + mt76_worker_enable(&dev->mt76.tx_worker);
> +
> + return 0;
> }
>
> /* system error recovery */
> --
> 2.31.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2021-05-28 14:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 14:00 [PATCH v2] mt76: mt7921: set MT76_RESET during mac reset Lorenzo Bianconi
2021-05-28 14:48 ` 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=YLECsxSLgurAzyIS@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
/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