summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-02-03 12:00:57 +0000
committermav <mav@FreeBSD.org>2010-02-03 12:00:57 +0000
commitae135106517ff27079b2d0900337d161db755dc4 (patch)
treebf5e3c4bc0e5852f4d172a7e9e365b92bc99f5ad
parentdcc17451da0e7bd6ea4fd2031a20ba568e236f1e (diff)
downloadFreeBSD-src-ae135106517ff27079b2d0900337d161db755dc4.zip
FreeBSD-src-ae135106517ff27079b2d0900337d161db755dc4.tar.gz
Disable PHY of unconnected ports when interface power management enabled.
It allows to save a bit more power (about 0.5W on 2 unused ports of ICH8M).
-rw-r--r--sys/dev/ahci/ahci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index fe3ce09..3db477d 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -2297,7 +2297,12 @@ ahci_sata_phy_reset(device_t dev)
ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 :
(ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)));
DELAY(5000);
- return (ahci_sata_connect(ch));
+ if (!ahci_sata_connect(ch)) {
+ if (ch->pm_level > 0)
+ ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_DISABLE);
+ return (0);
+ }
+ return (1);
}
static void
OpenPOWER on IntegriCloud