Commit 55fabefe3695241e6ccfa0cd4974f3fa497693dc

Authored by Thomas Pedersen
Committed by John W. Linville
1 parent cf193f6d2a

mac80211: call drv_get_tsf() in sleepable context

The call to drv_get/set_tsf() was put on the workqueue to perform tsf
adjustments since that function might sleep. However it ended up inside
a spinlock, whose critical section must be atomic. Do tsf adjustment
outside the spinlock instead, and get rid of a warning.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

net/mac80211/mesh_sync.c
... ... @@ -56,7 +56,6 @@
56 56 u64 tsfdelta;
57 57  
58 58 spin_lock_bh(&ifmsh->sync_offset_lock);
59   -
60 59 if (ifmsh->sync_offset_clockdrift_max < beacon_int_fraction) {
61 60 msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting\n",
62 61 (long long) ifmsh->sync_offset_clockdrift_max);
63 62  
... ... @@ -69,11 +68,11 @@
69 68 tsfdelta = -beacon_int_fraction;
70 69 ifmsh->sync_offset_clockdrift_max -= beacon_int_fraction;
71 70 }
  71 + spin_unlock_bh(&ifmsh->sync_offset_lock);
72 72  
73 73 tsf = drv_get_tsf(local, sdata);
74 74 if (tsf != -1ULL)
75 75 drv_set_tsf(local, sdata, tsf + tsfdelta);
76   - spin_unlock_bh(&ifmsh->sync_offset_lock);
77 76 }
78 77  
79 78 static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,