From: Diego Escalante Urrelo Date: Thu, 23 Jul 2020 09:46:52 -0500 Subject: wl: Make sure power_mgmt settings are honored The driver does *not* respect calls to set_power_mgmt() to turn power saving off, it sets "PM_OFF" when it is asked to turn off PM by userspace. However, it seems that unidentified circumstances will turn PM to PM_FAST automatically again and again, disregarding user input. This patch uses PM_FORCE_OFF instead of PM_OFF which seems to reliably keep PM off, no matter the circumstances. --- amd64/src/wl/sys/wl_cfg80211_hybrid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c index 111ec5a..e81389f 100644 --- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c +++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c @@ -1479,7 +1479,9 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, s32 pm; s32 err = 0; - pm = enabled ? PM_FAST : PM_OFF; + /* NOTICE: Use PM_FORCE_OFF, otherwise powersaving will turn itself + * ON again (PM_FAST) when on battery power. */ + pm = enabled ? PM_FAST : PM_FORCE_OFF; pm = htod32(pm); WL_DBG(("power save %s\n", (pm ? "enabled" : "disabled"))); err = wl_dev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));