From patchwork Mon Apr 14 09:51:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3979121 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC8369F2BA for ; Mon, 14 Apr 2014 09:54:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64C70201EC for ; Mon, 14 Apr 2014 09:54:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A45F2012B for ; Mon, 14 Apr 2014 09:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722AbaDNJxy (ORCPT ); Mon, 14 Apr 2014 05:53:54 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:59166 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbaDNJvy (ORCPT ); Mon, 14 Apr 2014 05:51:54 -0400 Received: by mail-pa0-f42.google.com with SMTP id fb1so8115108pad.1 for ; Mon, 14 Apr 2014 02:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VVoJwD6fQGpIM3xT3cDa+1L0GVgrq3YmWKxivAXfWnw=; b=AB3vIeJeyHFLhAJ2sVxtgxScsm2zXbhI90b0xZxsp9sneBjy8ExRbcwF69xmJzfotk z7AlgBJ5hvKDziyAGMVULjaP+7YegiDA8KZD+9PrjTVurUHURKvOMdTqkM39QXn1ZWyN v2m7uQv0GIRWlCKI8MVIZ7cU9dbOhj/X2vroZxo9DKCiOEeJ5s3M3+Z5PmyXQOZoMsI5 oIjporth5eNUFSZtvq8QbR6tKnRODs+fwiM5EDXlbiAKp5C56dxtrgiXmh8Ke6+jG3q0 V+qRW9vCFfj2+Vu6uBYDd4R4xSztRG/bVpyPfr6LPdOSq+r+A93fZH3FLmXnpmCwM293 Tgiw== X-Received: by 10.68.186.33 with SMTP id fh1mr2057696pbc.140.1397469113870; Mon, 14 Apr 2014 02:51:53 -0700 (PDT) Received: from localhost.localdomain ([175.153.40.114]) by mx.google.com with ESMTPSA id j3sm32747430pbh.38.2014.04.14.02.51.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Apr 2014 02:51:53 -0700 (PDT) From: "Zhao, Gang" To: Cc: Johannes Berg Subject: [PATCH 1/6] cfg80211: some workqueue improvements Date: Mon, 14 Apr 2014 17:51:30 +0800 Message-Id: <8b5c4a61ae1f49400478b030fa7ae4e3a5ca2bcb.1397469035.git.gamerh2o@gmail.com> X-Mailer: git-send-email 1.9.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rdev->rfkill_sync and rdev->sched_scan_results_wk works are canceled when unregistering wiphy. Reg_regdb_work is canceled in regulatory_exit(), if related config option is enabled. Queue cfg80211_disconnect_work to cfg80211_wq, since it's a work used by cfg80211. Change flush_work() to more robust cancel_work_sync(). Signed-off-by: Zhao, Gang --- net/wireless/core.c | 6 ++++-- net/wireless/reg.c | 4 ++++ net/wireless/sme.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index 276cf93..68a027c 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -671,9 +671,11 @@ void wiphy_unregister(struct wiphy *wiphy) rtnl_unlock(); - flush_work(&rdev->scan_done_wk); + cancel_work_sync(&rdev->rfkill_sync); + cancel_work_sync(&rdev->scan_done_wk); + cancel_work_sync(&rdev->sched_scan_results_wk); cancel_work_sync(&rdev->conn_work); - flush_work(&rdev->event_work); + cancel_work_sync(&rdev->event_work); cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); #ifdef CONFIG_PM diff --git a/net/wireless/reg.c b/net/wireless/reg.c index f59aaac..12d3194 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2666,6 +2666,10 @@ void regulatory_exit(void) cancel_work_sync(®_work); cancel_delayed_work_sync(®_timeout); +#ifdef CONFIG_CFG80211_INTERNAL_REGDB + cancel_work_sync(®_regdb_work); +#endif + /* Lock to suppress warnings */ rtnl_lock(); reset_regdomains(true, NULL); diff --git a/net/wireless/sme.c b/net/wireless/sme.c index acdcb4a8..11b2779 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -873,7 +873,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie, wdev->wext.connect.ssid_len = 0; #endif - schedule_work(&cfg80211_disconnect_work); + queue_work(cfg80211_wq, &cfg80211_disconnect_work); } void cfg80211_disconnected(struct net_device *dev, u16 reason,