From owner-svn-src-all@FreeBSD.ORG Tue Jan 13 05:50:23 2009 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 2544D1065680; Tue, 13 Jan 2009 05:50:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14DDE8FC1E; Tue, 13 Jan 2009 05:50:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0D5oM23091435; Tue, 13 Jan 2009 05:50:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0D5oMpG091434; Tue, 13 Jan 2009 05:50:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901130550.n0D5oMpG091434@svn.freebsd.org> From: Sam Leffler Date: Tue, 13 Jan 2009 05:50:22 +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: r187129 - head/sys/dev/ath/ath_hal/ar5212 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: Tue, 13 Jan 2009 05:50:24 -0000 Author: sam Date: Tue Jan 13 05:50:22 2009 New Revision: 187129 URL: http://svn.freebsd.org/changeset/base/187129 Log: On some platforms touching the bb registers when the phy is powered down will cause a fault. Check the phy power state before possibly reading from the bb, this can happen as ar5212Reset intentionally calls ar5212GetRfgain before bringing the bb out of reset (but we do it here and not in the caller to guard against other possible uses). Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 05:13:20 2009 (r187128) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c Tue Jan 13 05:50:22 2009 (r187129) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_rfgain.c,v 1.2 2008/11/19 21:23:01 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -280,7 +280,8 @@ ar5212GetRfgain(struct ath_hal *ah) GAIN_VALUES *gv = &ahp->ah_gainValues; uint32_t rddata, probeType; - if (!gv->active) + /* NB: beware of touching the BB when PHY is powered down */ + if (!gv->active || !ahp->ah_phyPowerOn) return HAL_RFGAIN_INACTIVE; if (ahp->ah_rfgainState == HAL_RFGAIN_READ_REQUESTED) {