From owner-svn-src-all@FreeBSD.ORG Wed Feb 3 12:00:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95FBC1065672; Wed, 3 Feb 2010 12:00:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 845D28FC13; Wed, 3 Feb 2010 12:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o13C0ve5087451; Wed, 3 Feb 2010 12:00:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o13C0vPG087449; Wed, 3 Feb 2010 12:00:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002031200.o13C0vPG087449@svn.freebsd.org> From: Alexander Motin Date: Wed, 3 Feb 2010 12:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203426 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 12:00:57 -0000 Author: mav Date: Wed Feb 3 12:00:57 2010 New Revision: 203426 URL: http://svn.freebsd.org/changeset/base/203426 Log: 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). Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Feb 3 11:22:03 2010 (r203425) +++ head/sys/dev/ahci/ahci.c Wed Feb 3 12:00:57 2010 (r203426) @@ -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