public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: mt76: mt7921: Disable powersaving by default
@ 2023-12-12  9:08 Mario Limonciello
  2023-12-12  9:08 ` [PATCH 2/2] wifi: mt76: mt7925: " Mario Limonciello
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Mario Limonciello @ 2023-12-12  9:08 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee
  Cc: Shayne Chen, Sean Wang, Kalle Valo, Matthias Brugger,
	AngeloGioacchino Del Regno, Deren Wu, Ming Yen Hsieh, Ben Greear,
	open list:MEDIATEK MT76 WIRELESS LAN DRIVER,
	open list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support, Mario Limonciello,
	Sultan Alsawaf

Several users have reported awful latency when powersaving is enabled
with certain access point combinations. It's also reported that the
powersaving feature doesn't provide an ample enough savings to justify
being enabled by default with these issues.

Introduce a module parameter that would control the power saving
behavior.  Set it to default as disabled. This mirrors what some other
WLAN drivers like iwlwifi do.

Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Link: https://codeberg.org/Hybrid-Project-Developers/linux-tkg/blame/branch/master/mt76:-mt7921:-Disable-powersave-features-by-default.mypatch
Link: https://aur.archlinux.org/cgit/aur.git/tree/0027-mt76_-mt7921_-Disable-powersave-features-by-default.patch?h=linux-g14
Link: https://community.frame.work/t/responded-strange-wlan-problems-with-kernel-branch-6-2/41868/4
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/net/wireless/mediatek/mt76/mt7921/init.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 7d6a9d746011..78d4197988c8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -10,6 +10,11 @@
 #include "../mt76_connac2_mac.h"
 #include "mcu.h"
 
+static bool mt7921_powersave;
+module_param_named(power_save, mt7921_powersave, bool, 0444);
+MODULE_PARM_DESC(power_save,
+		 "enable WiFi power management (default: disable)");
+
 static ssize_t mt7921_thermal_temp_show(struct device *dev,
 					struct device_attribute *attr,
 					char *buf)
@@ -271,11 +276,13 @@ int mt7921_register_device(struct mt792x_dev *dev)
 	dev->pm.idle_timeout = MT792x_PM_TIMEOUT;
 	dev->pm.stats.last_wake_event = jiffies;
 	dev->pm.stats.last_doze_event = jiffies;
-	if (!mt76_is_usb(&dev->mt76)) {
+	if (mt7921_powersave && !mt76_is_usb(&dev->mt76)) {
 		dev->pm.enable_user = true;
 		dev->pm.enable = true;
 		dev->pm.ds_enable_user = true;
 		dev->pm.ds_enable = true;
+	} else {
+		hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
 	}
 
 	if (!mt76_is_mmio(&dev->mt76))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-17  4:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12  9:08 [PATCH 1/2] wifi: mt76: mt7921: Disable powersaving by default Mario Limonciello
2023-12-12  9:08 ` [PATCH 2/2] wifi: mt76: mt7925: " Mario Limonciello
2023-12-12 22:18 ` [PATCH 1/2] wifi: mt76: mt7921: " Sultan Alsawaf
2023-12-13 12:45 ` Kalle Valo
2023-12-13 13:26   ` Lorenzo Bianconi
2023-12-13 14:45     ` Ben Greear
2023-12-13 19:27       ` Mario Limonciello
2023-12-14 12:39         ` James Prestwood
2024-01-17  4:18           ` Mario Limonciello
2023-12-13 17:27   ` rwahler
2023-12-13 18:18     ` Kalle Valo
2023-12-13 19:26   ` Mario Limonciello
2023-12-13 13:35 ` Felix Fietkau
2023-12-13 19:28   ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox