summaryrefslogtreecommitdiff
path: root/SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-09-29 18:47:10 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-09-29 18:47:10 +0200
commitef01225be755d288eab47a64d2ea35824cb9a4fe (patch)
treeb519cccc7a920f9dda6cdc2711b96a75c64f9a01 /SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch
parent3a4e2ca3e411b3a2d55fc79b63d5494ec171cf7b (diff)
downloadkernel-fsync-ef01225be755d288eab47a64d2ea35824cb9a4fe.tar.gz
kernel-fsync-ef01225be755d288eab47a64d2ea35824cb9a4fe.zip
kernel 5.19.12
Diffstat (limited to 'SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch')
-rw-r--r--SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch b/SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch
new file mode 100644
index 0000000..099b4a4
--- /dev/null
+++ b/SOURCES/mt76:-mt7921:-Disable-powersave-features-by-default.patch
@@ -0,0 +1,43 @@
+From ca89780690f7492c2d357e0ed2213a1d027341ae Mon Sep 17 00:00:00 2001
+From: Sultan Alsawaf <sultan@kerneltoast.com>
+Date: Sun, 29 May 2022 01:32:19 -0700
+Subject: [PATCH] mt76: mt7921: Disable powersave features by default
+
+This brings WiFi latency down considerably and makes latency consistent by
+disabling runtime PM and typical powersave features by default. The actual
+power consumption difference is inconsequential on desktops and laptops,
+while the performance difference is monumental. Latencies of 20+ ms are no
+longer observed after this change, and the connection is much more stable.
+
+Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
+---
+ drivers/net/wireless/mediatek/mt76/mt7921/init.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+index 91fc41922d95..cfa0bb51004d 100644
+--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+@@ -67,7 +67,8 @@
+
+ wiphy->iface_combinations = if_comb;
+ wiphy->flags &= ~(WIPHY_FLAG_IBSS_RSN | WIPHY_FLAG_4ADDR_AP |
+- WIPHY_FLAG_4ADDR_STATION);
++ WIPHY_FLAG_4ADDR_STATION |
++ WIPHY_FLAG_PS_ON_BY_DEFAULT);
+ wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_AP);
+ wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
+@@ -266,12 +267,6 @@ int mt7921_register_device(struct mt7921_dev *dev)
+ dev->pm.idle_timeout = MT7921_PM_TIMEOUT;
+ dev->pm.stats.last_wake_event = jiffies;
+ dev->pm.stats.last_doze_event = jiffies;
+- if (!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;
+- }
+
+ if (!mt76_is_mmio(&dev->mt76))
+ hw->extra_tx_headroom += MT_SDIO_TXD_SIZE + MT_SDIO_HDR_SIZE;