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 <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/f075d43d87a5eefa5869baf755e9986edf735860.1735910836.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Quan Zhou 2025-01-03 21:53:50 +08:00 committed by Felix Fietkau
parent 8f6571ad47
commit 0e19942e6d
4 changed files with 15 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;