You are not logged in.

#1 2013-06-25 23:42:49

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

wifi power management no longer works

Long time ago, when I switched to systemd, I had written an udev rules for activate power management of my wifi card on laptop boot. It had worked for a long time, but now it doesn't work.

udev rules:

virgolus@santech:/etc/udev/rules.d$ cat 81-wifi-powerManagement.rules 
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan0" RUN+="/usr/sbin/iw dev wlan0 set power_save on"

If I launch manually the command above (/usr/sbin/iw dev wlan0 set power_save on), powermanagement turn to ON.

Any uggestions?

Last edited by virgolus (2013-06-28 17:40:41)

Offline

#2 2013-06-26 08:33:58

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

https://www.archlinux.org/packages/core/i686/iw/ .
See package content: /usr/bin/iw (/sbin -> /bin merge)

Last edited by nierro (2013-06-26 08:34:20)

Offline

#3 2013-06-26 08:40:55

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

Thanks. I'll try a reboot in the next hour (I'm at work now). So, the wiki need an update (https://wiki.archlinux.org/index.php/Po … wer_saving) because report the old bin directory path (/usr/sbin).

Offline

#4 2013-06-26 08:44:00

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

Updated smile Thanks for the report!

Offline

#5 2013-06-26 21:00:09

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

Thank you for support. I've tried to modify my udev rules, but after a reboot did'nt work anymore.
I think are a udev related problem, because of three rules, the only one that work doesn't use binary program. If I launch the command via console, work like a charm.

DON'T WORK:

virgolus@santech:/etc/udev/rules.d$ cat 81-disable-wuol.rules 
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth0" RUN+="/usr/bin/ethtool -s eth0 wol d"

virgolus@santech:/etc/udev/rules.d$ cat 81-wifi-powerManagement.rules 
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan0" RUN+="/usr/bin/iw dev wlan0 set power_save on"

WORK:

virgolus@santech:/etc/udev/rules.d$ cat 60_disk_scheduler.rules 
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

# set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"

I should open another post or simply change this post title?

P.S: Thanks for your work on arch wiki, is the best wiki in the linux world.

Last edited by virgolus (2013-06-28 17:41:11)

Offline

#6 2013-06-27 09:01:54

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

Uhm actually i have this rule:

cat /etc/udev/rules.d/60-hdparm.rules 
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 255 /dev/sda"

And it is working flawlessly.
I guess it is related to /usr/lib/udev/rules.d/80-net-name-slot.rules. Are you masking it? I.e. , post here the output of

ls /etc/udev/rules.d/

I think that when udev starts running those rules, eth0 and wlan0 are named differently. But after their name gets changed in eth0 and wlan0...this is the only idea i come up with.

Last edited by nierro (2013-06-27 09:02:21)

Offline

#7 2013-06-27 13:25:06

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

I agree with you, but I've the "80-net-name-slot.rules" rule and no manual entry.

virgolus@santech:/etc/udev/rules.d$ ls
60_disk_scheduler.rules  80-net-name-slot.rules  81-disable-wuol.rules  81-wifi-powerManagement.rules  90-pci_pm.rules
virgolus@santech:/etc/udev/rules.d$ cat 80-net-name-slot.rules 
# This file masks persistent renaming rules for network devices. If you
# delete this file, /usr/lib/udev/rules.d/80-net-name-slot.rules may
# rename network devices according to ID_NET_NAME_{ONBOARD,SLOT,PATH}
# properties of your network devices, with priority in that order. See
# the output of 'udevadm test-builtin net_id /sys/class/net/$interface'
# for details on what that new name might be.
# 
# [url]http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames[/url]

Last edited by virgolus (2013-06-28 17:40:20)

Offline

#8 2013-06-27 14:19:22

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

Uhm, please edit previous posts using code tag.
I really don't know what's happening here. Your 80-net-name-slot.rules (the one in /usr/lib/udev/rules.d) is overwritten by the one in /etc/udev/rules.d, so there should not be any network card renaming there. Try to reboot and then execute from root user "udevadm trigger". Then check your values. If they will be right, then there is a timing problem.

Offline

#9 2013-06-28 17:46:38

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

I've added code tags to my posts. Sorry smile.

I've tried to log as root and launch "udevadm trigger" but didn't work. No error log, no results.

virgolus@santech:/etc/udev/rules.d$ su - root
Password: 
[root@santech ~]# udevadm trigger 
[root@santech ~]# 

Rules permissions seems ok

virgolus@santech:~$ ls -lha /etc/udev/rules.d/
total 28K
drwxr-xr-x 2 root root 4.0K Jun 26 01:08 .
drwxr-xr-x 4 root root 4.0K Jun  4 19:23 ..
-rw-r--r-- 1 root root  288 Dec 15  2012 60_disk_scheduler.rules
-rw-r--r-- 1 root root  487 Jan 15 23:18 80-net-name-slot.rules
-rw-r--r-- 1 root root   86 Jun 26 01:18 81-disable-wuol.rules
-rw-r--r-- 1 root root   96 Jun 26 10:35 81-wifi-powerManagement.rules
-rw-r--r-- 1 root root   60 Jun 26 00:45 90-pci_pm.rules

As I've reported at the start of the post, if I manually launch the command, everithing works ok.
Any suggestions?

Offline

#10 2013-06-28 17:49:18

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

Have you checked your wlan0 powersave, after the "udevadm trigger" execution?

Offline

#11 2013-06-28 17:49:20

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

The result after manually command launch is this:

virgolus@santech:~$ iwconfig wlan0 
wlan0     IEEE 802.11abgn  ESSID:"Dlink is my love"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1B:11:F7:F6:7C   
          Bit Rate=54 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:71   Missed beacon:0

virgolus@santech:~$ sudo /usr/bin/iw dev wlan0 set power_save on
virgolus@santech:~$ iwconfig wlan0 
wlan0     IEEE 802.11abgn  ESSID:"Dlink is my love"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1B:11:F7:F6:7C   
          Bit Rate=54 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:71   Missed beacon:0

Offline

#12 2013-06-28 18:01:15

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

Yes, I've checked the result, and the power management is off.

For a try, I've added this rules (90-hd_power_save.rules):

SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power"

With powertop I can see the result:
before "udevadm trigger":

BAD - Enable SATA link power Managmenet for host1

after "udevadm trigger":

GOOD - Enable SATA link power Managmenet for host1

My problem seems related to udev and binary program, but I don't know what to do.

Offline

#13 2013-06-28 18:03:34

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

I don't really know whatelse you can do...try to report a bug against systemd(udev) on arch bug tracker. You'll get better help for sure smile

Offline

#14 2013-06-28 20:20:44

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

Ok, I'll do it. Thx for the help.

Offline

#15 2013-06-29 11:31:59

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

I've found  the problem...
Yesterday I've used my laptop on battery and all the rules work, so today I've tried to connect and disconnect my battery charger and I had discovered that these rules are applied only when I'm in battery.
I thought that udev rules was triggered however (on battery or with battery charge), there are something that prevent to trigger these rules If my battery charge is linked (uPower?).
Everithing is ok now, sorry if it was my mistake, I don't consider that this hypothesis could be.
How to tag as resolved this post?

Thanks for support

Offline

#16 2013-06-29 11:35:41

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 849

Re: wifi power management no longer works

Edit first post and change title: add [SOLVED] smile
Btw i don't think it is actually solved, well there must be a bug somewhere. Udev rules must be loaded on AC or on battery...

Offline

#17 2013-06-29 11:57:44

virgolus
Member
From: Brescia, Italy
Registered: 2012-10-16
Posts: 18

Re: wifi power management no longer works

I agree with you. I'll investigate in the next days. Thanks

Offline

Board footer

Powered by FluxBB