From patchwork Thu Jan 22 21:34:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5688841 X-Patchwork-Delegate: johannes@sipsolutions.net 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A3369F2ED for ; Thu, 22 Jan 2015 21:34:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C700420212 for ; Thu, 22 Jan 2015 21:34:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA32020211 for ; Thu, 22 Jan 2015 21:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753695AbbAVVeP (ORCPT ); Thu, 22 Jan 2015 16:34:15 -0500 Received: from mga09.intel.com ([134.134.136.24]:56090 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753390AbbAVVeO (ORCPT ); Thu, 22 Jan 2015 16:34:14 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 22 Jan 2015 13:31:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,451,1418112000"; d="scan'208";a="641246917" Received: from lkhoffma-mobl.ger.corp.intel.com (HELO egrumbacBox.ger.corp.intel.com) ([10.255.196.175]) by orsmga001.jf.intel.com with ESMTP; 22 Jan 2015 13:34:12 -0800 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Luciano Coelho Subject: [PATCH] mac80211: complete scan work immediately if quiesced or suspended Date: Thu, 22 Jan 2015 23:34:10 +0200 Message-Id: <1421962450-7096-1-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Luciano Coelho It is possible that a deferred scan is queued after the queues are flushed in __ieee80211_suspend(). The deferred scan work may be scheduled by ROC or ieee80211_stop_poll(). To make sure don't start a new scan while suspending, check whether we're quiescing or suspended and complete the scan immediately if that's the case. Change-Id: I8ec2c8fb4d969833d45c77045b0f5594cc097086 Signed-off-by: Luciano Coelho Reviewed-on: https://gerrit.rds.intel.com/r/51405 Tested-by: IWL Jenkins Reviewed-by: Johannes Berg --- net/mac80211/scan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 7807fa4..05f0d71 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -828,6 +828,11 @@ void ieee80211_scan_work(struct work_struct *work) mutex_lock(&local->mtx); + if (!ieee80211_can_run_worker(local)) { + aborted = true; + goto out_complete; + } + sdata = rcu_dereference_protected(local->scan_sdata, lockdep_is_held(&local->mtx)); scan_req = rcu_dereference_protected(local->scan_req,