Hi Luis, On Tue, Apr 22, 2014 at 5:39 AM, Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx> wrote: > From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx> > > This allows processing of the last regulatory request when > we determine its still pending. Without this if a regulatory > request failed to get processed by userspace we wouldn't > be able to re-process it later. An example situation that can > lead to an unprocessed last_request is enabling cfg80211 to > be built-in to the kernel, not enabling CFG80211_INTERNAL_REGDB > and the CRDA binary not being available at the time the udev > rule that kicks of CRDA triggers. > > In such a situation we want to let some cfg80211 triggers > eventually kick CRDA for us again. Without this if the first > cycle attempt to kick off CRDA failed we'd be stuck without > the ability to change process any further regulatory domains. > > cfg80211 will trigger re-processing of the regulatory queue > whenever schedule_work(®_work) is called, currently this > happens when: > > * suspend / resume > * disconnect > * a beacon hint gets triggered (non DFS 5 GHz AP found) > * a regulatory request gets added to the queue > > We don't have any specific opportunistic late boot triggers > to address a late mount of where CRDA resides though, adding > that should be done separately through another patch. > Without an opportunistic fix then this fix relies at least > one of the triggeres above to happen. > > Reported-by: Sander Eikelenboom <linux@xxxxxxxxxxxxxx> > Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx> > --- > net/wireless/reg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/wireless/reg.c b/net/wireless/reg.c > index 081c571..625c41e 100644 > --- a/net/wireless/reg.c > +++ b/net/wireless/reg.c > @@ -1912,7 +1912,7 @@ static void reg_process_pending_hints(void) > > /* When last_request->processed becomes true this will be rescheduled */ > if (lr && !lr->processed) { > - REG_DBG_PRINT("Pending regulatory request, waiting for it to be processed...\n"); > + reg_process_hint(lr); > return; > } > This change created a race in my setup (ar9344 based AP with two ath9k devices): Sometimes during boot the following happens: ... [ 6.190000] ath: Country alpha2 being used: US ... [ 6.210000] ath: Country alpha2 being used: US ... [ 6.240000] cfg80211: Calling CRDA for country: US [ 6.240000] cfg80211: Calling CRDA for country: US [ 6.240000] cfg80211: Current regulatory domain intersected: [ 6.240000] cfg80211: DFS Master region: unset [ 6.240000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 6.240000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 6.240000] cfg80211: (2457000 KHz - 2472000 KHz @ 15000 KHz), (N/A, 2000 mBm), (N/A) [ 6.240000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A) [ 6.240000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm), (0 s) [ 6.240000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 6.240000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) ... CRDA (or in my case the internal regdb) is called twice for country code US by two different devices. In this case the second request came in before the first one was completely processed and the first request will be re-processed (due to this patch) leading to an intersected regdomain (US with US :) ). Reverting this patch fixes this race for me but I think you had some good reasons to do this patch. Any ideas? Thanks, Helmut -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html