diff options
author | Bruno Randolf <br1@einfach.org> | 2010-09-26 23:22:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-28 15:47:57 -0400 |
commit | 28df897a42aa41d6318be5b9872c4bb5c8d8d7e3 (patch) | |
tree | 7979dd5d8a894603389e42b513e6e19c4a6601ae /drivers/net/wireless/ath/ath5k/pcu.c | |
parent | 11f21df36cbcffbfada9307e809d4372ece27f47 (diff) |
ath5k: Disable interrupts in ath5k_hw_get_tsf64
The code in ath5k_hw_get_tsf64() is time critical and will return wrong results
if we get interrupted, so disable local interrupts.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/pcu.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/pcu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c index 604114fb34b1..095d30b50ec7 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) | |||
495 | { | 495 | { |
496 | u32 tsf_lower, tsf_upper1, tsf_upper2; | 496 | u32 tsf_lower, tsf_upper1, tsf_upper2; |
497 | int i; | 497 | int i; |
498 | unsigned long flags; | ||
499 | |||
500 | /* This code is time critical - we don't want to be interrupted here */ | ||
501 | local_irq_save(flags); | ||
498 | 502 | ||
499 | /* | 503 | /* |
500 | * While reading TSF upper and then lower part, the clock is still | 504 | * 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) | |||
517 | tsf_upper1 = tsf_upper2; | 521 | tsf_upper1 = tsf_upper2; |
518 | } | 522 | } |
519 | 523 | ||
524 | local_irq_restore(flags); | ||
525 | |||
520 | WARN_ON( i == ATH5K_MAX_TSF_READ ); | 526 | WARN_ON( i == ATH5K_MAX_TSF_READ ); |
521 | 527 | ||
522 | return (((u64)tsf_upper1 << 32) | tsf_lower); | 528 | return (((u64)tsf_upper1 << 32) | tsf_lower); |