From: <sean.wang@mediatek.com>
To: <nbd@nbd.name>, <lorenzo.bianconi@redhat.com>
Cc: <sean.wang@mediatek.com>, <Soul.Huang@mediatek.com>,
<YN.Chen@mediatek.com>, <Leon.Yen@mediatek.com>,
<Eric-SY.Chang@mediatek.com>, <Deren.Wu@mediatek.com>,
<km.lin@mediatek.com>, <robin.chiu@mediatek.com>,
<ch.yeh@mediatek.com>, <posh.sun@mediatek.com>,
<Eric.Liang@mediatek.com>, <Stella.Chang@mediatek.com>,
<jemele@google.com>, <yenlinlai@google.com>,
<linux-wireless@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: [PATCH 4/7] mt76: mt7921: avoid unnecessary consecutive WiFi resets
Date: Thu, 20 May 2021 11:46:38 +0800 [thread overview]
Message-ID: <1621482401-29025-4-git-send-email-sean.wang@mediatek.com> (raw)
In-Reply-To: <1621482401-29025-1-git-send-email-sean.wang@mediatek.com>
From: Sean Wang <sean.wang@mediatek.com>
Avoid unnecessary consecutive WiFi resets by dropping reset
request when reset work is working.
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 5 ++++-
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index ebd365ceb70d..fdc69f306f7e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -1312,6 +1312,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
int i;
dev_err(dev->mt76.dev, "chip reset\n");
+ dev->hw_full_reset = true;
ieee80211_stop_queues(hw);
cancel_delayed_work_sync(&dev->mphy.mac_work);
@@ -1338,6 +1339,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
ieee80211_scan_completed(dev->mphy.hw, &info);
}
+ dev->hw_full_reset = false;
ieee80211_wake_queues(hw);
ieee80211_iterate_active_interfaces(hw,
IEEE80211_IFACE_ITER_RESUME_ALL,
@@ -1349,7 +1351,8 @@ void mt7921_reset(struct mt76_dev *mdev)
{
struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
- queue_work(dev->mt76.wq, &dev->reset_work);
+ if (!dev->hw_full_reset)
+ queue_work(dev->mt76.wq, &dev->reset_work);
}
static void
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
index 03bcb210c357..710ad242fd53 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
@@ -156,6 +156,7 @@ struct mt7921_dev {
u16 chainmask;
struct work_struct reset_work;
+ bool hw_full_reset;
struct list_head sta_poll_list;
spinlock_t sta_poll_lock;
--
2.25.1
next prev parent reply other threads:[~2021-05-20 3:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1621482401-29025-1-git-send-email-sean.wang@mediatek.com>
2021-05-20 3:46 ` [PATCH 2/7] mt76: connac: update BA win size in Rx direction sean.wang
2021-05-20 3:46 ` [PATCH 3/7] mt76: mt7921: fix reset under the deep sleep is enabled sean.wang
2021-05-23 21:14 ` Lorenzo Bianconi
2021-05-20 3:46 ` sean.wang [this message]
2021-05-20 3:46 ` [PATCH 5/7] mt76: mt7921: fix invalid register access in wake_work sean.wang
2021-05-20 3:46 ` [PATCH 6/7] mt76: mt7921: fix OMAC idx usage sean.wang
2021-05-20 3:46 ` [PATCH 7/7] mt76: mt7921: enable runtime pm by default sean.wang
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=1621482401-29025-4-git-send-email-sean.wang@mediatek.com \
--to=sean.wang@mediatek.com \
--cc=Deren.Wu@mediatek.com \
--cc=Eric-SY.Chang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=Stella.Chang@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=ch.yeh@mediatek.com \
--cc=jemele@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=yenlinlai@google.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