On Mon, Oct 04, 2010 at 03:11:01PM +0200, Johannes Berg wrote: > On Fri, 2010-10-01 at 14:05 +0200, Stanislaw Gruszka wrote: > > When cfg80211 request the scan and mac80211 perform some management work, > > we defer the scan request. We do not canceling such requests when calling > > ieee80211_scan_cancel(), because of SCAN_SW_SCANNING bit check just > > before the call. So fix that problem. Keeping local->mtx lock assures > > that the deferred scan will not become "working" HW scan. > > But don't we also delay it becoming a working scan while we have work > pending? Which seems OK? Yes, you have right, we cancel the scan_work before that, so transition will not happen. > Also what's with all the other changes here, they don't seem related to > this? This change mutex_lock(&local->mtx); if (test_bit(SCAN_SW_SCANNING, &local->scanning) || - (!local->scanning && local->scan_req)) + (!test_bit(SCAN_HW_SCANNING, &local->scanning) && local->scan_req)) finish = __ieee80211_scan_completed(&local->hw, true, false); mutex_unlock(&local->mtx); is for ignore local->scanning bits, in case we have some bits set up but no hw scanning is pending. Not sure If this fix some real problem, but make things safer IMHO. We have to think here about hw, sw and deferred scan. Canceling scan_work seems to wrong for hw_scan, but we still have to remember about sw scan and deferred scan ... I will try to rewrite patch to cope with all cases. Stanislaw -- 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