Skip to contentSkip to conversation

mt76: mt7921s: make pm->suspended usage consistent

PATCH [email protected] 1 participant 1 message Dec 13, 2021 1 message not in the archive Arm MediaTek

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): YbcYJ47OKfh0A5Vt@lore-desk--annotate

#1 lore raw

From: Sean Wang <[email protected]>

Quoted 44 lines
Quoted 44 lines

From: Sean Wang <[email protected]>

Quoted 31 lines
Quoted 23 lines

From: Sean Wang <[email protected]>

Update pm->suspended usage to be consistent with mt7921e driver.

---
 drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c +0 -1
index 84be229a899d..44ee9369f6bf 100644
@@ -278,7 +278,6 @@ static int mt7921s_resume(struct device *__dev)
 	struct mt76_dev *mdev = &dev->mt76;
 	int err;
 
-	pm->suspended = false;
 	clear_bit(MT76_STATE_SUSPEND, &mdev->phy.state);
 
 	err = mt7921_mcu_drv_pmctrl(dev);

drivers/net/wireless/mediatek/mt76/mt7921/sdio.c static int mt7921s_resume(struct device *__dev) · line 296

Quoted 5 lines
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c +1 -1
@@ -294,7 +293,11 @@ static int mt7921s_resume(struct device *__dev)
 	if (!pm->ds_enable)
 		mt76_connac_mcu_set_deep_sleep(mdev, false);
 
-	return mt76_connac_mcu_set_hif_suspend(mdev, false);
+	err = mt76_connac_mcu_set_hif_suspend(mdev, false);

should we check return value here? Something like:

Quoted 7 lines
	if (err)
		return err;

	pm->suspended = false;
	return 0;

Or, is the chip up even if mt76_connac_mcu_set_hif_suspend() fails?

yes, chip is eventually up again by recovered with the following wifi reset

Quoted 6 lines
Quoted 4 lines

with current logic, if do so (not mark pm->suspended back as false to show suspend/resume is over),

the pm runtime would not be enabled again after the wifi reset

maybe we should just set pm->suspended = false; in mt7921_mac_reset_work() as we do for hw_full_reset, wdyt?

That looks fine to me. I will submit another patch for that prior to the patch.

Quoted 15 lines

Regards,
Lorenzo

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c +4 -1
+
+	pm->suspended = false;
+
+	return err;
 }
 
 static const struct dev_pm_ops mt7921s_pm_ops = {
--

2.25.1