From owner-svn-src-user@FreeBSD.ORG Fri Jul 30 15:36:57 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85C31065670; Fri, 30 Jul 2010 15:36:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96ACC8FC08; Fri, 30 Jul 2010 15:36: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 o6UFavjt002327; Fri, 30 Jul 2010 15:36:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6UFavSf002325; Fri, 30 Jul 2010 15:36:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007301536.o6UFavSf002325@svn.freebsd.org> From: Adrian Chadd Date: Fri, 30 Jul 2010 15:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210657 - user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2010 15:36:57 -0000 Author: adrian Date: Fri Jul 30 15:36:57 2010 New Revision: 210657 URL: http://svn.freebsd.org/changeset/base/210657 Log: Don't perform any periodic or longcal calibrations if a noise floor (NF) calibration is in progress. Scheduling any kind of calibration whilst another is pending is a big no-no. This should fix the issue of periodic calibrations being performed during NF calibrations but it doesn't stop NF calibrations being scheduled during a periodic calibration. That'll come next. Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jul 30 15:25:57 2010 (r210656) +++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jul 30 15:36:57 2010 (r210657) @@ -406,6 +406,30 @@ ar5416PerCalibrationN(struct ath_hal *ah OS_MARK(ah, AH_MARK_PERCAL, chan->ic_freq); + /* + * Don't do any of these calibrations if there's a NF + * calibration in progress. Long calibration will try to program + * the CCA registers and kick another NF calibration ; periodic + * calibrations shouldn't be occuring during a NF calibration. + */ + if (ar5416IsNFCalInProgress(ah)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: NF calibration in-progress; skipping\n", + __func__); + + /* + * Is there a percal in progress? Return + * "not-done" so we're re-prodded very soon. + */ + if (currCal && ((currCal->calState == CAL_WAITING) || + (currCal->calState == CAL_RUNNING))) + *isCalDone = AH_FALSE; + else + *isCalDone = AH_TRUE; + + return AH_TRUE; + } + *isCalDone = AH_TRUE; /*