From patchwork Thu Apr 18 22:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 2462791 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 E8CF2DF2E5 for ; Thu, 18 Apr 2013 22:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936653Ab3DRWFP (ORCPT ); Thu, 18 Apr 2013 18:05:15 -0400 Received: from mail-ia0-f171.google.com ([209.85.210.171]:40459 "EHLO mail-ia0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936487Ab3DRWFP (ORCPT ); Thu, 18 Apr 2013 18:05:15 -0400 Received: by mail-ia0-f171.google.com with SMTP id f27so2917869iae.30 for ; Thu, 18 Apr 2013 15:05:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent:x-gm-message-state; bh=Ohb20PdbMBrp8KR8rXTpR/aSNl8HtT/Ddfv99nBSyRg=; b=PM22L0mttVJqNtRFpoAxWIVGQw7APYRJnerw1NkBqd7htknxSgKwn2Grbdh7rxnooU 2gS/QoNA1U4lTrKQ/Ao5zbgPBRHoPMg1XlPyC3w3mOPgPqLpgnq7yAWI50spC1P58cZC BhAo76FTQymvDU8dOsCCRgxsJyr9BwbOYHi+9pdasEngEFAqP8dx7LaMud9hoAEZ4+Ne CPR9rMBOG9mOGLj7My8vtdRwGgI0qbsIOfFJobuvZicbuiC2yspq1I5aEsdEoZn85h7+ NVUDdGS5d7ay4mCuYPufYTYLu6uLS0tvfdI8QaL6jLneJFcbVKdZ146SVsY+t+8WJUNe NI2Q== X-Received: by 10.42.50.202 with SMTP id b10mr6834672icg.7.1366322714264; Thu, 18 Apr 2013 15:05:14 -0700 (PDT) Received: from hash.lan (CPE0018e7fe5281-CM78cd8ec60a0d.cpe.net.cable.rogers.com. [99.242.255.161]) by mx.google.com with ESMTPSA id d4sm24376igc.3.2013.04.18.15.05.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Apr 2013 15:05:13 -0700 (PDT) Received: from bob by hash.lan with local (Exim 4.72) (envelope-from ) id 1USwwn-0000jV-Qi; Thu, 18 Apr 2013 18:04:53 -0400 Date: Thu, 18 Apr 2013 18:04:43 -0400 From: Bob Copeland To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, paulmck@linux.vnet.ibm.com Subject: [PATCH] mac80211: use synchronize_rcu() with rcu_barrier() Message-ID: <20130418220443.GB3759@localhost> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Gm-Message-State: ALoCoQl+NlsQIUVoI/zQamxAPEphHNBvK1afP8mldnBBuvBhT4NvzaHvswYOx+48yEQDboyQPhsC Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The RCU docs used to state that rcu_barrier() included a wait for an RCU grace period; however the comments for rcu_barrier() as of commit f0a0e6f... "rcu: Clarify memory-ordering properties of grace-period primitives" contradict this. So add back synchronize_{rcu,net}() to where they once were, but keep the rcu_barrier()s for the call_rcu() callbacks. Cc: stable Signed-off-by: Bob Copeland Reviewed-by: Paul E. McKenney --- net/mac80211/iface.c | 5 +++-- net/mac80211/pm.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index b6abaaa..c634aff 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -836,11 +836,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, * * sta_info_flush_cleanup() requires rcu_barrier() * first to wait for the station call_rcu() calls - * to complete, here we need at least sychronize_rcu() - * it to wait for the RX path in case it is using the + * to complete, and we also need synchronize_rcu() + * to wait for the RX path in case it is using the * interface and enqueuing frames at this very time on * another CPU. */ + synchronize_rcu(); rcu_barrier(); sta_info_flush_cleanup(sdata); diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index 4431f0f..7fc5d0d 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c @@ -38,6 +38,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) IEEE80211_QUEUE_STOP_REASON_SUSPEND); /* flush out all packets and station cleanup call_rcu()s */ + synchronize_net(); rcu_barrier(); ieee80211_flush_queues(local, NULL);