From: Thomas Pedersen <thomas@cozybit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wirelss <linux-wireless@vger.kernel.org>,
Thomas Pedersen <thomas@cozybit.com>
Subject: [PATCH] mac80211: clean up mesh RCU warning
Date: Thu, 2 May 2013 16:11:19 -0700 [thread overview]
Message-ID: <1367536279-14241-1-git-send-email-thomas@cozybit.com> (raw)
When running a kernel with CONFIG_PROVE_RCU, the minstrel
rate update code would complain about being called without
the RCU read lock held. This is because
mesh_sta_info_init() may or may not have been called under
RCU read lock. Perform some bureaucratic critical section
toggling to always call mesh_sta_info_init() under RCU,
and silence this warning.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/mesh_plink.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 09bebed..4058bd7 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -473,13 +473,15 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata,
rcu_read_unlock();
/* can't run atomic */
sta = mesh_sta_info_alloc(sdata, addr, elems);
- if (!sta) {
- rcu_read_lock();
+
+ rcu_read_lock();
+ if (!sta)
return NULL;
- }
mesh_sta_info_init(sdata, sta, elems, true);
+ rcu_read_unlock();
+ /* also might sleep */
if (sta_info_insert_rcu(sta))
return NULL;
}
--
1.7.10.4
next reply other threads:[~2013-05-02 23:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 23:11 Thomas Pedersen [this message]
2013-05-03 6:41 ` [PATCH] mac80211: clean up mesh RCU warning Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367536279-14241-1-git-send-email-thomas@cozybit.com \
--to=thomas@cozybit.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.