From owner-svn-src-head@FreeBSD.ORG Sat Nov 24 02:41:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF337A74; Sat, 24 Nov 2012 02:41:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BB8C8FC12; Sat, 24 Nov 2012 02:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO2fItH047897; Sat, 24 Nov 2012 02:41:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO2fIBn047896; Sat, 24 Nov 2012 02:41:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211240241.qAO2fIBn047896@svn.freebsd.org> From: Adrian Chadd Date: Sat, 24 Nov 2012 02:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243472 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 02:41:18 -0000 Author: adrian Date: Sat Nov 24 02:41:18 2012 New Revision: 243472 URL: http://svnweb.freebsd.org/changeset/base/243472 Log: Add a comment which covers what's going on with the 64 bit TSF write. After chatting with the MAC team, the TSF writes (at least on the 11n MACs, I don't know about pre-11n MACs) are done as 64 bit writes that can take some time. So, doing a 32 bit TSF write is definitely not supported. Leave a comment here which explains that. Whilst here, add a comment which outlines that after a reset or TSF write, the TSF write may take a while (up to 50uS) to update. A write or reset shouldn't be done whilst the previous one is in flight. Also (and this isn't currently done) a read shouldn't occur until the SLEEP32_TSF_WRITE_STAT is clear. Right now we're not doing that, mostly because we haven't been doing lots of TSF resets/writes until recently. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:13:18 2012 (r243471) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat Nov 24 02:41:18 2012 (r243472) @@ -128,6 +128,18 @@ ar5416GetTsf64(struct ath_hal *ah) return (((uint64_t) u32) << 32) | ((uint64_t) low2); } +/* + * Update the TSF. + * + * The full TSF is only updated once the upper 32 bits have + * been written. Writing only the lower 32 bits of the TSF + * will not actually correctly update the TSF. + * + * The #if 0'ed code is to check whether the previous TSF + * reset or write has completed before writing to the + * TSF. Strictly speaking, it should be also checked before + * reading the TSF as the write/reset may not have completed. + */ void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64) {