Skip to content

Commit 0c5986c

Browse files
committed
wifi: mt76: mt7925: fix the unfinished command of regd_notifier before suspend
jira LE-3460 Rebuild_History Non-Buildable kernel-6.12.0-55.11.1.el10_0 commit-author Quan Zhou <[email protected]> commit 1b97fc8 Before entering suspend, we need to ensure that all MCU command are completed. In some cases, such as with regd_notifier, there is a chance that CLC commands, will be executed before suspend. Signed-off-by: Quan Zhou <[email protected]> Link: https://patch.msgid.link/3af7b4e5bf7437832b016e32743657d1d55b1f9d.1735910288.git.quan.zhou@mediatek.com Signed-off-by: Felix Fietkau <[email protected]> (cherry picked from commit 1b97fc8) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 2684c2d commit 0c5986c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ mt7925_regd_notifier(struct wiphy *wiphy,
7979
mdev->region = req->dfs_region;
8080
dev->country_ie_env = req->country_ie_env;
8181

82+
dev->regd_in_progress = true;
8283
mt792x_mutex_acquire(dev);
8384
mt7925_mcu_set_clc(dev, req->alpha2, req->country_ie_env);
8485
mt7925_mcu_set_channel_domain(hw->priv);
8586
mt7925_set_tx_sar_pwr(hw, NULL);
8687
mt792x_mutex_release(dev);
88+
dev->regd_in_progress = false;
89+
wake_up(&dev->wait);
8790
}
8891

8992
static void mt7925_mac_init_basic_rates(struct mt792x_dev *dev)
@@ -225,6 +228,7 @@ int mt7925_register_device(struct mt792x_dev *dev)
225228
spin_lock_init(&dev->pm.wake.lock);
226229
mutex_init(&dev->pm.mutex);
227230
init_waitqueue_head(&dev->pm.wait);
231+
init_waitqueue_head(&dev->wait);
228232
spin_lock_init(&dev->pm.txq_lock);
229233
INIT_DELAYED_WORK(&dev->mphy.mac_work, mt792x_mac_work);
230234
INIT_DELAYED_WORK(&dev->phy.scan_work, mt7925_scan_work);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ static int mt7925_pci_suspend(struct device *device)
455455
if (err < 0)
456456
goto restore_suspend;
457457

458+
wait_event_timeout(dev->wait,
459+
!dev->regd_in_progress, 5 * HZ);
460+
458461
/* always enable deep sleep during suspend to reduce
459462
* power consumption
460463
*/

0 commit comments

Comments
 (0)