diff options
author | Alexander Motin <mav@FreeBSD.org> | 2010-02-03 12:00:57 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2010-02-03 12:00:57 +0000 |
commit | 4c9d5e6b0fe0a70c99206bf60a2b3ac15ad51e39 (patch) | |
tree | bf5e3c4bc0e5852f4d172a7e9e365b92bc99f5ad /sys | |
parent | 6c9462571f74f7d01e44d28a24c526b6a44e288a (diff) | |
download | src-4c9d5e6b0fe0a70c99206bf60a2b3ac15ad51e39.tar.gz src-4c9d5e6b0fe0a70c99206bf60a2b3ac15ad51e39.zip |
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).
Notes
Notes:
svn path=/head/; revision=203426
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ahci/ahci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index fe3ce096346d..3db477d23533 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 |