[PATCH 2/2] wcn36xx: fix the mesh STA for rejoin

Bob Copeland me at bobcopeland.com
Fri Mar 21 14:04:04 EDT 2014


On Fri, Mar 21, 2014 at 11:43:13PM +0800, Chun-Yeow Yeoh wrote:
> >
> >>               rcu_read_unlock();
> >
> > But this is a bit of a problem: the rcu_read_lock() is needed to
> > protect the sta, but wcn36xx_smd_config_sta() takes a mutex.
> > You aren't allowed to sleep inside rcu read critical sections.
> 
> Ok, got it. So it is make sense if rcu_read_unlock is called before
> taking a mutex?

Yes, but then the sta may be freed under you. [1]  So you also need
to use the sta fields under rcu lock while you can (e.g. copy the
data out, look up the sta index, or whatever), then drop the rcu lock,
then take the mutex.

[1] Sort of -- you can take advantage of the fact that the sta will
not be freed until driver's sta_remove() is called, and keep a private
list or spinlock or something, but then ieee80211_find_sta may not
work for stas the driver knows about since it may have already been
removed from mac80211's list.

> Agreed. If we can managed to turn this off and eliminating the QoS
> Null frame generated by the firmware, it will be better.

I'll try something along these lines today.

-- 
Bob Copeland %% www.bobcopeland.com



More information about the wcn36xx mailing list