Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jul 2010 15:36:57 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r210657 - user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201007301536.o6UFavSf002325@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007301536.o6UFavSf002325>