Bug #1132
closed
Power off for PCI devices
Added by hasso about 16 years ago.
Updated about 16 years ago.
Description
http://leaf.dragonflybsd.org/~hasso/pci-detatch-powerdown.patch
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).
Nice! Do the modules have to be loaded (and then unloaded) for this to
take effect or is it enough to just not load them in the first place?
Thanks,
Johannes
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.
Cheers,
Johannes
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 [1]. lspci -vvv
shows to you all devices with decoded configuration space. For example
ABOUT my wireless card it shows this:
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA
PME
Status: D3 PME-Enable- DSel=0 DScale=0 PME-
Important bit is "Status: D3" - ie. this device is powered down.
[1] -
http://leaf.dragonflybsd.org/~hasso/pkgsrc-patches/pkgsrc-sysutils-pciutils.patch
lspci -vv indeed shows some devices (usb controller, sound card, ethernet card,
and modem) in D3 state.
Thanks,
Johannes
Also available in: Atom
PDF