summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-04-29 21:17:18 +0000
committermav <mav@FreeBSD.org>2009-04-29 21:17:18 +0000
commit3dc3901e620940ba07bb79d79b198c33373f9f97 (patch)
tree1b163858d9c61d296281a1cd9a3977f00ed15967 /sys/dev/ata/ata-pci.c
parent453b86f943612b273e23c7de9941d00149802f15 (diff)
downloadFreeBSD-src-3dc3901e620940ba07bb79d79b198c33373f9f97.zip
FreeBSD-src-3dc3901e620940ba07bb79d79b198c33373f9f97.tar.gz
Add experimental support for SATA interface power management.
Feature is controlled by hint.ata.X.pm_level tunable: 0 - PM disabled, old behaviour, default. 1 - device is allowed to initiate PM state change, host is passive. 2 - host initiates PARTIAL state transition every time port is idle. 3 - host initiates SLUMBER state transition every time port is idle. PARTIAL state has up to 100us (50us for me) wakeup latency, but for my ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms (3.5ms for me) wakeup latency, but saves 0.8W of power. Modes 2 and 3 are implemented only for AHCI driver now. Interface power management is incompatible with device presence detection (host receives no signal from drive, so unable to monitor it), so later is disabled when PM is used.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index a903da7..9a0af1c 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -556,6 +556,9 @@ ata_pcichannel_attach(device_t dev)
ch->unit = (intptr_t)device_get_ivars(dev);
+ resource_int_value(device_get_name(dev),
+ device_get_unit(dev), "pm_level", &ch->pm_level);
+
if ((error = ctlr->ch_attach(dev)))
return error;
OpenPOWER on IntegriCloud