iwlwifi sets power_save off on enabling/disabling Wi-Fi

Asked by Berte

Hi,

After upgrading Ubuntu 15.04->15.10 the power_save of my wifi is not set to on anymore after boot and resume. My wifi card does support the power_save and it was working well in Ubuntu 15.04. I can set the power_save feature to on manually. After some investigations, someone from (TLP/linrunner) pointed out that the power_save option is actually set to off each time the Wi-Fi is enabled or disabled.

I already checked with kernel 3.19 and I observed the same behaviour.

The annoying thing is that it consumes the battery of my laptop faster when the power_save option is off.
TLP is enabled on this machine and working correctly.

Anyone, any help? Is this an expected behaviour? Should I fill a bug report?

Here are some details of my system:

Computer: Asus UX305FA, Intel® Core™ M-5Y71 CPU @ 1.20GHz × 4
OS: Ubuntu 15.10, 4.2.0-17-generic

lspci => Network controller: Intel Corporation Wireless 7265 (rev 59)

sudo modinfo iwlwifi | grep 7265 =>
firmware: iwlwifi-7265D-12.ucode
firmware: iwlwifi-7265-12.ucode

sudo iw wlan0 get power_save =>
Power save: off

sudo iw wlan0 set power_save on && iw wlan0 get power_save
Power save: on

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Berte
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

sudo lshw -C network; lsb_release -a; uname -a

Thanks

Revision history for this message
Berte (berte) said :
#2

Hi,

Thanks for your fast answer.

Here is the info:

sudo lshw -C network =>
  *-network
       description: Wireless interface
       product: Wireless 7265
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 59
       serial: 60:57:18:88:b8:55
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.2.0-18-generic firmware=15.227938.0 ip=192.168.1.135 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:50 memory:f7000000-f7001fff

lsb_release -a =>
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

uname -a =>
Linux berte-UX305FA 4.2.0-18-generic #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Try:

echo "options iwlwifi auto_agg=0 power_save=1 power_level=3" | sudo tee /etc/modprobe.d/iwlwifi.conf > /dev/null

reboot to test. Those option may help.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

If you know how to apply the options in your own file you made, then use that.

You get the idea

Revision history for this message
Berte (berte) said :
#5

Unfortunately it doesn't seem to work. Actually, iwlwifi.conf was already present on my system. Here is the its content. Do you think it's normal?

# /etc/modprobe.d/iwlwifi.conf
# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
# microcode file installed on the system. When removing iwlwifi, first
# remove the iwl?vm module and then iwlwifi.
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211

options iwlwifi auto_agg=0 power_save=1 power_level=3

Revision history for this message
Berte (berte) said :
#6

Some more info...

auto_agg is not supported as seen by
dmesg | grep wifi =>
[ 1.947918] iwlwifi: unknown parameter 'auto_agg' ignored
[ 1.986423] iwlwifi 0000:02:00.0: loaded firmware version 15.227938.0 op_mode iwlmvm
[ 2.183309] iwlwifi 0000:02:00.0: Detected Intel(R) Dual Band Wireless AC 7265, REV=0x210
[ 2.183654] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
[ 2.184116] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
[ 5.355924] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
[ 5.356376] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
[ 5.417385] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled
[ 5.417888] iwlwifi 0000:02:00.0: L1 Enabled - LTR Enabled

Also, after some more testing, it seems that when I set power management on, my wifi connects to the 2.4 GHz band. Prior it was connected to the 5.2 GHz band (power_save off). A workaround could be to force the connection to only 2.4 GHz networks. Does anyone know how to do that?

Regards

Revision history for this message
Berte (berte) said :
#7

Forget about the 2/5 GHz thing... I get unpredictable behaviour.

Revision history for this message
Berte (berte) said :
#8

Hi,

If anyone is interested, the power_save was disabled on each connection/disconnection to a wifi network. I do not know if this came from the iwlwifi driver or from the NetworkManager.
Anyway, I wrote a small script as a workaround to reactivate the power_save on each connection/disconnection. It is not perfect as it is probably called too often but I am not a bash scripting guru. Here is the script.

sudo pico /etc/NetworkManager/dispatcher.d/80wifi-power-save

#!/bin/bash
iw wlan0 set power_save on
exit 0

sudo chmod go-w /etc/NetworkManager/dispatcher.d/80wifi-power-save
sudo chmod +x /etc/NetworkManager/dispatcher.d/80wifi-power-save