Skip to content

Commit 4fa11ec

Browse files
Sachin Kulkarnijmberg-intel
authored andcommitted
mac80211: Requeue work after scan complete for all VIF types.
During a sw scan ieee80211_iface_work ignores work items for all vifs. However after the scan complete work is requeued only for STA, ADHOC and MESH iftypes. This occasionally results in event processing getting delayed/not processed for iftype AP when it coexists with a STA. This can result in data halt and eventually disconnection on the AP interface. Cc: stable@vger.kernel.org Signed-off-by: Sachin Kulkarni <Sachin.Kulkarni@imgtec.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent da629cf commit 4fa11ec

5 files changed

Lines changed: 11 additions & 19 deletions

File tree

‎net/mac80211/ibss.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,6 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local)
17331733
if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
17341734
continue;
17351735
sdata->u.ibss.last_scan_completed = jiffies;
1736-
ieee80211_queue_work(&local->hw, &sdata->work);
17371736
}
17381737
mutex_unlock(&local->iflist_mtx);
17391738
}

‎net/mac80211/mesh.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,17 +1370,6 @@ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
13701370
sdata_unlock(sdata);
13711371
}
13721372

1373-
void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local)
1374-
{
1375-
struct ieee80211_sub_if_data *sdata;
1376-
1377-
rcu_read_lock();
1378-
list_for_each_entry_rcu(sdata, &local->interfaces, list)
1379-
if (ieee80211_vif_is_mesh(&sdata->vif) &&
1380-
ieee80211_sdata_running(sdata))
1381-
ieee80211_queue_work(&local->hw, &sdata->work);
1382-
rcu_read_unlock();
1383-
}
13841373

13851374
void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
13861375
{

‎net/mac80211/mesh.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,10 @@ static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
362362
return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP;
363363
}
364364

365-
void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local);
366-
367365
void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
368366
void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata);
369367
void ieee80211s_stop(void);
370368
#else
371-
static inline void
372-
ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) {}
373369
static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
374370
{ return false; }
375371
static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)

‎net/mac80211/mlme.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4005,8 +4005,6 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
40054005
if (!ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR))
40064006
ieee80211_queue_work(&sdata->local->hw,
40074007
&sdata->u.mgd.monitor_work);
4008-
/* and do all the other regular work too */
4009-
ieee80211_queue_work(&sdata->local->hw, &sdata->work);
40104008
}
40114009
}
40124010

‎net/mac80211/scan.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
314314
bool was_scanning = local->scanning;
315315
struct cfg80211_scan_request *scan_req;
316316
struct ieee80211_sub_if_data *scan_sdata;
317+
struct ieee80211_sub_if_data *sdata;
317318

318319
lockdep_assert_held(&local->mtx);
319320

@@ -373,7 +374,16 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
373374

374375
ieee80211_mlme_notify_scan_completed(local);
375376
ieee80211_ibss_notify_scan_completed(local);
376-
ieee80211_mesh_notify_scan_completed(local);
377+
378+
/* Requeue all the work that might have been ignored while
379+
* the scan was in progress; if there was none this will
380+
* just be a no-op for the particular interface.
381+
*/
382+
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
383+
if (ieee80211_sdata_running(sdata))
384+
ieee80211_queue_work(&sdata->local->hw, &sdata->work);
385+
}
386+
377387
if (was_scanning)
378388
ieee80211_start_next_roc(local);
379389
}

0 commit comments

Comments
 (0)