From patchwork Thu May 2 23:11:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2514121 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 09CE0E00DD for ; Thu, 2 May 2013 23:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759307Ab3EBXNf (ORCPT ); Thu, 2 May 2013 19:13:35 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:58730 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759101Ab3EBXNW (ORCPT ); Thu, 2 May 2013 19:13:22 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq8so589499pbb.5 for ; Thu, 02 May 2013 16:13:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=IRdXV+Zlv3OFXN0DGFET2tiTR1lFAob1eH19+BfHiRs=; b=fFH6Xx/pPXfVWX3YgYG+xaBtv/gr83FYl812fDJJOnUpWXXEEBWfgU1drFR1l3sByD DJlt0v/LCiQypPZXT5s0EZYcI2YGznFDmThDEfxLXoe8L+38TsFxeTrtrvKRsMtJQJck ETZtUN6N8287D4jpoBbTYTsaLZFg9qlmOrOIMlTmKBPGGaKXCvvUi29AosTnMFNwHYTU dSGwrVp83z/1mgfZ5ioMvvyGcLmy16u1B9oFHjtv2yMqEHLy8F0qCZfLQLp3ItM2vFA4 k0UlO5kFEtRorYoWXQlVZr0REiGsQ485HlnUgYKkdtgczSRGz4qpL+LpBY+44BOm1nCb /XlA== X-Received: by 10.66.249.195 with SMTP id yw3mr11964829pac.12.1367536402010; Thu, 02 May 2013 16:13:22 -0700 (PDT) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPSA id wz9sm9010503pbc.5.2013.05.02.16.13.19 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 16:13:20 -0700 (PDT) From: Thomas Pedersen To: Johannes Berg Cc: linux-wirelss , Thomas Pedersen Subject: [PATCH] mac80211: clean up mesh RCU warning Date: Thu, 2 May 2013 16:11:19 -0700 Message-Id: <1367536279-14241-1-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlnG6m7vq+AqhbcVymXlytzs7k2k5pWAIegOPAFzEKsRIvIybGeMYbIAdRMD+KxKOQ/aRX+ Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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; }