@@ -63,9 +63,13 @@ void mt7925_regd_update(struct mt792x_dev *dev)
struct mt76_dev *mdev = &dev->mt76;
struct ieee80211_hw *hw = mdev->hw;
+ if (!dev->regd_change)
+ return;
+
mt7925_mcu_set_clc(dev, mdev->alpha2, dev->country_ie_env);
mt7925_mcu_set_channel_domain(hw->priv);
mt7925_set_tx_sar_pwr(hw, NULL);
+ dev->regd_change = false;
}
EXPORT_SYMBOL_GPL(mt7925_regd_update);
@@ -91,6 +95,7 @@ mt7925_regd_notifier(struct wiphy *wiphy,
memcpy(mdev->alpha2, req->alpha2, 2);
mdev->region = req->dfs_region;
dev->country_ie_env = req->country_ie_env;
+ dev->regd_change = true;
if (pm->suspended)
return;
@@ -1300,6 +1300,7 @@ void mt7925_mac_reset_work(struct work_struct *work)
cancel_delayed_work_sync(&dev->mphy.mac_work);
cancel_delayed_work_sync(&pm->ps_work);
cancel_work_sync(&pm->wake_work);
+ dev->sar_inited = false;
for (i = 0; i < 10; i++) {
mutex_lock(&dev->mt76.mutex);
@@ -310,6 +310,7 @@ void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy)
int __mt7925_start(struct mt792x_phy *phy)
{
struct mt76_phy *mphy = phy->mt76;
+ struct mt792x_dev *dev = phy->dev;
int err;
err = mt7925_mcu_set_channel_domain(mphy);
@@ -320,9 +321,12 @@ int __mt7925_start(struct mt792x_phy *phy)
if (err)
return err;
- err = mt7925_set_tx_sar_pwr(mphy->hw, NULL);
- if (err)
- return err;
+ if (!dev->sar_inited) {
+ err = mt7925_set_tx_sar_pwr(mphy->hw, NULL);
+ if (err)
+ return err;
+ dev->sar_inited = true;
+ }
mt792x_mac_reset_counters(phy);
set_bit(MT76_STATE_RUNNING, &mphy->state);
@@ -224,6 +224,8 @@ struct mt792x_dev {
bool aspm_supported:1;
bool hif_idle:1;
bool hif_resumed:1;
+ bool sar_inited:1;
+ bool regd_change:1;
wait_queue_head_t wait;
struct work_struct init_work;
The mt7925e takes a long time to resume in platform resume scenarios. This is due to the mt7925 reconfiguring the tx power for each wifi channel during resume. By streamlining the process and removing redundant power configurations, the resume time for the mt7925 can be shortened. Signed-off-by: Quan Zhou <quan.zhou@mediatek.com> --- drivers/net/wireless/mediatek/mt76/mt7925/init.c | 5 +++++ drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 1 + drivers/net/wireless/mediatek/mt76/mt7925/main.c | 10 +++++++--- drivers/net/wireless/mediatek/mt76/mt792x.h | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-)