]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.6.4/mac80211-call-drv_get_tsf-in-sleepable-context.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.6.4 / mac80211-call-drv_get_tsf-in-sleepable-context.patch
1 From 55fabefe3695241e6ccfa0cd4974f3fa497693dc Mon Sep 17 00:00:00 2001
2 From: Thomas Pedersen <thomas@cozybit.com>
3 Date: Fri, 5 Oct 2012 17:57:39 -0700
4 Subject: mac80211: call drv_get_tsf() in sleepable context
5
6 From: Thomas Pedersen <thomas@cozybit.com>
7
8 commit 55fabefe3695241e6ccfa0cd4974f3fa497693dc upstream.
9
10 The call to drv_get/set_tsf() was put on the workqueue to perform tsf
11 adjustments since that function might sleep. However it ended up inside
12 a spinlock, whose critical section must be atomic. Do tsf adjustment
13 outside the spinlock instead, and get rid of a warning.
14
15 Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
16 Signed-off-by: John W. Linville <linville@tuxdriver.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 net/mac80211/mesh_sync.c | 3 +--
21 1 file changed, 1 insertion(+), 2 deletions(-)
22
23 --- a/net/mac80211/mesh_sync.c
24 +++ b/net/mac80211/mesh_sync.c
25 @@ -56,7 +56,6 @@ void mesh_sync_adjust_tbtt(struct ieee80
26 u64 tsfdelta;
27
28 spin_lock_bh(&ifmsh->sync_offset_lock);
29 -
30 if (ifmsh->sync_offset_clockdrift_max < beacon_int_fraction) {
31 msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting\n",
32 (long long) ifmsh->sync_offset_clockdrift_max);
33 @@ -69,11 +68,11 @@ void mesh_sync_adjust_tbtt(struct ieee80
34 tsfdelta = -beacon_int_fraction;
35 ifmsh->sync_offset_clockdrift_max -= beacon_int_fraction;
36 }
37 + spin_unlock_bh(&ifmsh->sync_offset_lock);
38
39 tsf = drv_get_tsf(local, sdata);
40 if (tsf != -1ULL)
41 drv_set_tsf(local, sdata, tsf + tsfdelta);
42 - spin_unlock_bh(&ifmsh->sync_offset_lock);
43 }
44
45 static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,