Skip to content

Commit 0e19942

Browse files
Quanzhoucennbd168
authored andcommitted
wifi: mt76: mt7925e: fix too long of wifi resume time
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 <[email protected]> Link: https://patch.msgid.link/f075d43d87a5eefa5869baf755e9986edf735860.1735910836.git.quan.zhou@mediatek.com Signed-off-by: Felix Fietkau <[email protected]>
1 parent 8f6571a commit 0e19942

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

drivers/net/wireless/mediatek/mt76/mt7925/init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ void mt7925_regd_update(struct mt792x_dev *dev)
6363
struct mt76_dev *mdev = &dev->mt76;
6464
struct ieee80211_hw *hw = mdev->hw;
6565

66+
if (!dev->regd_change)
67+
return;
68+
6669
mt7925_mcu_set_clc(dev, mdev->alpha2, dev->country_ie_env);
6770
mt7925_mcu_set_channel_domain(hw->priv);
6871
mt7925_set_tx_sar_pwr(hw, NULL);
72+
dev->regd_change = false;
6973
}
7074
EXPORT_SYMBOL_GPL(mt7925_regd_update);
7175

@@ -91,6 +95,7 @@ mt7925_regd_notifier(struct wiphy *wiphy,
9195
memcpy(mdev->alpha2, req->alpha2, 2);
9296
mdev->region = req->dfs_region;
9397
dev->country_ie_env = req->country_ie_env;
98+
dev->regd_change = true;
9499

95100
if (pm->suspended)
96101
return;

drivers/net/wireless/mediatek/mt76/mt7925/mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ void mt7925_mac_reset_work(struct work_struct *work)
13001300
cancel_delayed_work_sync(&dev->mphy.mac_work);
13011301
cancel_delayed_work_sync(&pm->ps_work);
13021302
cancel_work_sync(&pm->wake_work);
1303+
dev->sar_inited = false;
13031304

13041305
for (i = 0; i < 10; i++) {
13051306
mutex_lock(&dev->mt76.mutex);

drivers/net/wireless/mediatek/mt76/mt7925/main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy)
310310
int __mt7925_start(struct mt792x_phy *phy)
311311
{
312312
struct mt76_phy *mphy = phy->mt76;
313+
struct mt792x_dev *dev = phy->dev;
313314
int err;
314315

315316
err = mt7925_mcu_set_channel_domain(mphy);
@@ -320,9 +321,12 @@ int __mt7925_start(struct mt792x_phy *phy)
320321
if (err)
321322
return err;
322323

323-
err = mt7925_set_tx_sar_pwr(mphy->hw, NULL);
324-
if (err)
325-
return err;
324+
if (!dev->sar_inited) {
325+
err = mt7925_set_tx_sar_pwr(mphy->hw, NULL);
326+
if (err)
327+
return err;
328+
dev->sar_inited = true;
329+
}
326330

327331
mt792x_mac_reset_counters(phy);
328332
set_bit(MT76_STATE_RUNNING, &mphy->state);

drivers/net/wireless/mediatek/mt76/mt792x.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ struct mt792x_dev {
224224
bool aspm_supported:1;
225225
bool hif_idle:1;
226226
bool hif_resumed:1;
227+
bool sar_inited:1;
228+
bool regd_change:1;
227229
wait_queue_head_t wait;
228230

229231
struct work_struct init_work;

0 commit comments

Comments
 (0)