[PATCH] Fix scanning state when sched_scan is stopped explicitly

Arik Nemtsov arik at wizery.com
Mon Mar 9 16:17:11 EDT 2015


On Mon, Mar 9, 2015 at 10:11 PM, Johannes Berg
<johannes at sipsolutions.net> wrote:
>
> On Mon, 2015-03-09 at 13:07 -0700, Dmitry Shmidt wrote:
>
> > If you can hint me what this change was about, I'll try to find it.
> > Meanwhile the only change I see between 3.19 and 3.4 in
> > __cfg80211_stop_sched_scan() is to use rtnl_lock instead of sched_scan_mtx.
> > Other than that the logic is the same - send stop command to the driver and send
> >  NL80211_CMD_SCHED_SCAN_STOPPED back to user space.
> > And I see (I didn't try 3.19) that it will come "too late".
>
> Looks like cfg80211 could do this correctly, but mac80211 insists on
> doing the scheduled work. Given that locks the RTNL it's not going to be
> simple to actually implement it.
>

Is this really about kernel-mode though? wpa_s is single threaded
(eloop), so even if the notification comes up right away, the event is
still only queued on the thread..

That said, I think Dmitry's version might hurt some state. It's safer
to just schedule the scan on the eloop with a very small delay (even
0), so that the pending sched-scan event has a chance to get
processed.

Arik


More information about the HostAP mailing list