Date: Tue, 13 Jan 2009 05:50:22 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r187129 - head/sys/dev/ath/ath_hal/ar5212 Message-ID: <200901130550.n0D5oMpG091434@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901130550.n0D5oMpG091434>