From patchwork Mon Sep 27 03:22:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 210722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8R3MafV003865 for ; Mon, 27 Sep 2010 03:22:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932633Ab0I0DWf (ORCPT ); Sun, 26 Sep 2010 23:22:35 -0400 Received: from mail30s.wh2.ocn.ne.jp ([125.206.180.198]:27589 "HELO mail30s.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932631Ab0I0DWf (ORCPT ); Sun, 26 Sep 2010 23:22:35 -0400 Received: from vs3000.wh2.ocn.ne.jp (125.206.180.163) by mail30s.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 2-0205927752 for ; Mon, 27 Sep 2010 12:22:32 +0900 (JST) Received: (qmail 18412 invoked from network); 27 Sep 2010 03:22:32 -0000 Received: from unknown (HELO ?192.168.3.123?) (220.110.201.18) by with SMTP; 27 Sep 2010 03:22:32 -0000 Subject: [PATCH 4/4] ath5k: Disable interrupts in ath5k_hw_get_tsf64 To: linville@tuxdriver.com From: Bruno Randolf Cc: ath5k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org Date: Mon, 27 Sep 2010 12:22:32 +0900 Message-ID: <20100927032232.8754.25109.stgit@tt-desk> In-Reply-To: <20100927032211.8754.49870.stgit@tt-desk> References: <20100927032211.8754.49870.stgit@tt-desk> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Sep 2010 03:22:37 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c index 604114f..095d30b 100644 --- a/drivers/net/wireless/ath/ath5k/pcu.c +++ b/drivers/net/wireless/ath/ath5k/pcu.c @@ -495,6 +495,10 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah) { u32 tsf_lower, tsf_upper1, tsf_upper2; int i; + unsigned long flags; + + /* This code is time critical - we don't want to be interrupted here */ + local_irq_save(flags); /* * While reading TSF upper and then lower part, the clock is still @@ -517,6 +521,8 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah) tsf_upper1 = tsf_upper2; } + local_irq_restore(flags); + WARN_ON( i == ATH5K_MAX_TSF_READ ); return (((u64)tsf_upper1 << 32) | tsf_lower);