On Fri, Apr 1, 2011 at 2:49 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Fri, 2011-04-01 at 14:47 -0700, Luis R. Rodriguez wrote: >> On Fri, Apr 1, 2011 at 1:28 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: >> > On Fri, 2011-04-01 at 13:10 -0700, Luis R. Rodriguez wrote: >> >> >> >> The order should not matter except that we want the queue to be >> >> cleared before processing core hints when doing restoration, otherwise >> >> the next user hint in the queue can be bogus and it will prevent a >> >> restore. >> > >> > I'm just thinking this temporary clearing could cause us to reject a >> > reply from CRDA that's coming in at the same time that is due to a user >> > request. >> >> Ah, I see, hmm well I tested this with: >> >> iw reg set US; iw reg set XA; iw reg set XB; iw reg set CR; iw dev >> wlan0 disconnect; iw reg set FR; > > was CRDA running though? Yes > If so, it will probably reply right away Except for the cases that are bogus: XA, XB > -- I don't think you can hit the race easily. I'm just trying to see the entry points on the code for such a race, apart from the points I mentioned I cannot see any other case. Can you? >> and things were still being processed in the order sent. There is a >> small race between the unlock of the reg_mutex on >> restore_regulatory_settings() down until where we lock the >> regulatory_hint_core() and regulatory_hint_user(). The chances of a >> user regulatory hint coming in between is very low, I could not do it. >> Then there is also a small race of getting a user reg hint on >> restore_regulatory_settings() in between the regulatory_hint_user() >> and the lock of the reg_mutex again for processing old regulatory >> hints, but the worst that can happen in that case is we squeeze in a >> user regulatory hint in before the other older regulatory hints, and >> this is fine. >> >> I cannot see any other cases here where we'd block a request from userspace. > > No not block a request. I'm just thinking that this taking things off > the list temporarily might erroneously discard a crda response. Ah, but the stuff in the queue is stuff which we have not yet sent out to userspace. CRDA and the kernel process regulatory requests atomically. Luis -- 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