From patchwork Mon Apr 8 18:06:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2410761 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 AB491DFB78 for ; Mon, 8 Apr 2013 18:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934642Ab3DHSIE (ORCPT ); Mon, 8 Apr 2013 14:08:04 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:57713 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934675Ab3DHSID (ORCPT ); Mon, 8 Apr 2013 14:08:03 -0400 Received: by mail-pa0-f45.google.com with SMTP id kl13so3377022pab.18 for ; Mon, 08 Apr 2013 11:08:02 -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:in-reply-to :references:x-gm-message-state; bh=Awjm2IRvREvLH8OESU5uCL21WkGs9J74KQV8hphwJaU=; b=K+AMIhPQQ5dAVixOjIsSlY6FxKAhJqpxcTSBkLOfvcJ1xyvo+C3MQxE/zdxPF9jy5Q dai4ewTcvfEDHBr9F9Xs65SYrt0QZ7ptZb+FV6ahXF9O1U/nAtqH/AwU+/KHdA3l+/Ys PiwiuD2Gh6wL8lbgzqAW+epOkm5jfydGE2rXtnv3mjVAf8yFYnH+e5Hn5R0He3vSm3M0 kc2Y4J/PNWSFYy1iOI8CCEjO+zPfEA6SeT0QxfA5mHTDKw9RKo3Dyvo+bgauocuFuEAX H9tf/PrMhTvAblXCKPh2g9hAGDgkF58dUTkKWJxVGIzomq1kgulFSlsQ5485gZytwjOL Gowg== X-Received: by 10.66.162.103 with SMTP id xz7mr38489167pab.2.1365444482730; Mon, 08 Apr 2013 11:08:02 -0700 (PDT) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id pa2sm40603095pac.9.2013.04.08.11.08.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 11:08:01 -0700 (PDT) From: Thomas Pedersen To: Johannes Berg Cc: linux-wirelss , open80211s , Thomas Pedersen Subject: [PATCH 6/6] mac80211: avoid mesh peer rate update warning Date: Mon, 8 Apr 2013 11:06:17 -0700 Message-Id: <1365444377-9959-6-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365444377-9959-1-git-send-email-thomas@cozybit.com> References: <1365444377-9959-1-git-send-email-thomas@cozybit.com> X-Gm-Message-State: ALoCoQml7nLnC5/ZC/5uvcHdZ+wro+2cSXudegrX5WTKGeUjqxHTVETCdBVS4TQKwrdEP6aAXtVi Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Some drivers (like ath9k_htc) will take a mutex in rate_control_rate_update(), so drop the sta lock before we get there. Signed-off-by: Thomas Pedersen Can go towards 3.9. --- net/mac80211/mesh_plink.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index cdd4183..ca284ee 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -379,8 +379,10 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, sta->last_rx = jiffies; /* rates and capabilities don't change during peering */ - if (sta->plink_state == NL80211_PLINK_ESTAB) - goto out; + if (sta->plink_state == NL80211_PLINK_ESTAB) { + spin_unlock_bh(&sta->lock); + return; + } if (sta->sta.supp_rates[band] != rates) changed |= IEEE80211_RC_SUPP_RATES_CHANGED; @@ -398,13 +400,12 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, changed |= IEEE80211_RC_BW_CHANGED; sta->sta.bandwidth = IEEE80211_STA_RX_BW_20; } + spin_unlock_bh(&sta->lock); if (insert) rate_control_rate_init(sta); else rate_control_rate_update(local, sband, sta, changed); -out: - spin_unlock_bh(&sta->lock); } static struct sta_info *