- Joined
- Dec 23, 2014
- Messages
- 42
- Motherboard
- Lenovo U310 (Clover)
- CPU
- i3-3217U (IvyBridge 1.80Ghz)
- Graphics
- HD4000, 1366x768
- Mac
- Classic Mac
- Mobile Phone
For some time there has been a problem with laptops running Linux that some BIOSes wouldn't enable PCI Express power saving features ("Active State Power Management" or ASPM) for certain wireless cards, substantially reducing battery life.
I found this to be the case in my Hackbook: i installed lspci (I found it by googling 'lspci osx') and found out that the RTL8101E ethernet card in my laptop only had the L0s mode enabled by default, and the corresponding PCIe root complex wasn't enabling that either, while the AR9285 was enabling L1 only and ASPM for the root complex was again disabled.
To check which ASPM states are available and activated on your machine run lspci -vvv and look at the LinkCap(ability) and LinkCtl lines for each of your PCIe devices. If they differ, something is missing and you can try to enable it manually.
Somebody came up with a script based on setpci that enables the ASPM bit for the PCIe cards and root complexes specified by the user. The script is here http://drvbp1.linux-foundation.org/~...ts/enable-aspm
For ASPM to be effective the L0s and L1 modes should be enabled for both the endpoint (the card itself) and the root complex (the chipset bit). You can find the root complex corresponding to each card by running lspci -t. The script has to be edited according to their position (it is very well commented) and launched at startup. I am using it to enable ASPM states for my wireless and wired ethernet cards (so 2 endpoints and 2 root complexes).
I am not sure if setpci is normally available on OSX or it was installed by lspci, but it's working fine so far and I have all the ASPM capabilities turned on. My version of the script is here.
The best way to launch the script should be with a LaunchDaemon plist, but it was failing for me as it was probably being run too early in the boot process, so I resorted to launching it as a LoginHook, moving it in /usr/local/sbin and enabling it with
This slows the login proces by a couple of seconds, but so far is working well.
Now I am not the primary user of this hack, I can't really say if and how much this improves battery life. Maybe somebody could give it a try and report back..
I found this to be the case in my Hackbook: i installed lspci (I found it by googling 'lspci osx') and found out that the RTL8101E ethernet card in my laptop only had the L0s mode enabled by default, and the corresponding PCIe root complex wasn't enabling that either, while the AR9285 was enabling L1 only and ASPM for the root complex was again disabled.
To check which ASPM states are available and activated on your machine run lspci -vvv and look at the LinkCap(ability) and LinkCtl lines for each of your PCIe devices. If they differ, something is missing and you can try to enable it manually.
Somebody came up with a script based on setpci that enables the ASPM bit for the PCIe cards and root complexes specified by the user. The script is here http://drvbp1.linux-foundation.org/~...ts/enable-aspm
For ASPM to be effective the L0s and L1 modes should be enabled for both the endpoint (the card itself) and the root complex (the chipset bit). You can find the root complex corresponding to each card by running lspci -t. The script has to be edited according to their position (it is very well commented) and launched at startup. I am using it to enable ASPM states for my wireless and wired ethernet cards (so 2 endpoints and 2 root complexes).
I am not sure if setpci is normally available on OSX or it was installed by lspci, but it's working fine so far and I have all the ASPM capabilities turned on. My version of the script is here.
The best way to launch the script should be with a LaunchDaemon plist, but it was failing for me as it was probably being run too early in the boot process, so I resorted to launching it as a LoginHook, moving it in /usr/local/sbin and enabling it with
Code:
sudo defaults write com.apple.loginwindow LoginHook /usr/local/sbin/aspm.sh
Now I am not the primary user of this hack, I can't really say if and how much this improves battery life. Maybe somebody could give it a try and report back..