Power off for PCI devices
With this tiny patch power is turned off for PCI devices during detach
(ie. when you unload module). It makes is possible to preserve power in
laptops (and make them cooler) with unloading network and/or sound device
modules not in use and load them only if really needed.
However, I'm really not sure about all consequences this patch might
cause, might knowledge about newbus and friends are still quite limited.
Any objections to commit this?
Tested with em(4), ath(4) and snd_hda(4).
#3 Updated by hasso about 6 years ago
It was enough to just not load them even before this patch. Powering down
not used devices at boot time was already there with this commit:
This patch adds just the ability to power down a devices on module unload.
#4 Updated by Johannes.Hofmann about 6 years ago
Ah ok. Is there a way to verify the state of the pci devices?
On my T42 thinkpad I don't see any difference in power consumption
with hw.pci.do_power_nodriver=1 (measured with an external device and
battery removed). I'm always around 20 Watt, with est enabled,
"DynamicClocks" "on" in xorg.conf, and screen backlight set to the
lowest possible value.
#5 Updated by hasso about 6 years ago
I use hw.pci.do_power_nodriver=3, btw, but it shouldn't matter much. Is
there unused devices at all? And these devices have to have power
management capabilities, not all PCI devices have these.
I use sysutils/pciutils from pkgsrc to play with PCI configuration space.
It doesn't compile in DragonFly without the patch, pkgsrc bugreport is
there about year or so :(. Take patch is available at . lspci -vvv
shows to you all devices with decoded configuration space. For example
ABOUT my wireless card it shows this:
Capabilities:  Power Management version 2
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA
Status: D3 PME-Enable- DSel=0 DScale=0 PME-
Important bit is "Status: D3" - ie. this device is powered down.