]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
mac80211: proper STA info locking
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 2 May 2008 23:02:02 +0000 (01:02 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 14 May 2008 20:29:34 +0000 (16:29 -0400)
commit07346f81e87d6e4cca7ae9adfa711d0c61c87b56
tree237450c49843e0e19afc79356240a891da64d9fa
parent3434fbd39862d471c92b66c28cd449deea8e9f90
mac80211: proper STA info locking

As discussed earlier, we can unify locking in struct sta_info
and use just a single spinlock protecting all members of the
structure that need protection. Many don't, but one of the
especially bad ones is the 'flags' member that can currently
be clobbered when RX and TX is being processed on different
CPUs at the same time.

Because having four spinlocks for different, mostly exclusive
parts of a single structure is overkill, this patch also kills
the ampdu and mesh plink spinlocks and uses just a single one
for everything. Because none of the spinlocks are nested, this
is safe.

It remains to be seen whether or not we should make the sta
flags use atomic bit operations instead, for now though this
is a safe thing and using atomic operations instead will be
very simple using the new static inline functions this patch
introduces for accessing sta->flags.

Since spin_lock_bh() is used with this lock, there shouldn't
be any contention even if aggregation is enabled at around the
same time as both requires frame transmission/reception which
is in a bh context.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Tomas Winkler <tomasw@gmail.com>
Cc: Ron Rindjunsky <ron.rindjunsky@intel.com>
Cc: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
net/mac80211/cfg.c
net/mac80211/debugfs_sta.c
net/mac80211/key.c
net/mac80211/main.c
net/mac80211/mesh_plink.c
net/mac80211/mlme.c
net/mac80211/rx.c
net/mac80211/sta_info.c
net/mac80211/sta_info.h
net/mac80211/tx.c