From patchwork Thu Dec 5 09:21:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 3286971 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 10EBA9F373 for ; Thu, 5 Dec 2013 09:21:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEBE92051D for ; Thu, 5 Dec 2013 09:21:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E967204EB for ; Thu, 5 Dec 2013 09:21:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753827Ab3LEJVp (ORCPT ); Thu, 5 Dec 2013 04:21:45 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:36770 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754205Ab3LEJVm (ORCPT ); Thu, 5 Dec 2013 04:21:42 -0500 Received: by mail-ee0-f41.google.com with SMTP id t10so3077329eei.14 for ; Thu, 05 Dec 2013 01:21:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qdBE+ictI3nyr7d+TcnaaeO/nmNgzIPXaR0oZQz8Ki8=; b=X9bChfLQDn0sw6U1l8YQtgpKB1qNBuF42UHgZwPRx43jPdUb11W/YRdgzqW0BF2Yjw q/4LULJR3yzYKaUDiUYDcUvTnvU4m7NXn+YCqwsRZGFxD78h3zbzNomt1N9yPFBlhJWr KvTfJjAAHn+KGS53wDjmn9iLE3Hq1Mu0opVx4lr8Z4L0OTEiUrsMaENi1ku4ccqYGNne oXf78vXdSIYlO0/fEyOn31KOZThzzc9XulNG+eqYgcaw6UZlkcwaJmbSLsSNc/uqMNdm S//9xhtR3JtH/05OkAsBxmL1NdGvRZ2TxU6QLTDwIoVjE6q449H0zPQJyvVr6ON/w3X7 jLTA== X-Gm-Message-State: ALoCoQny+KKYpsfdvRvg6tkplZESe1cqaqJRDXm2bD8bbgMNAVShoispe9d9WZam7arfEXUOYYeI X-Received: by 10.14.115.133 with SMTP id e5mr11199192eeh.91.1386235301037; Thu, 05 Dec 2013 01:21:41 -0800 (PST) Received: from localhost.localdomain (93-173-177-113.bb.netvision.net.il. [93.173.177.113]) by mx.google.com with ESMTPSA id h3sm78610986eem.15.2013.12.05.01.21.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 01:21:40 -0800 (PST) From: Eliad Peller To: Johannes Berg Cc: Subject: [PATCH 3/4] mac80211: start_next_roc only if scan was actually running Date: Thu, 5 Dec 2013 11:21:28 +0200 Message-Id: <1386235289-27278-3-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.rc1 In-Reply-To: <1386235289-27278-1-git-send-email-eliad@wizery.com> References: <1386235289-27278-1-git-send-email-eliad@wizery.com> 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, RP_MATCHES_RCVD, 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 On scan completion we try start any pending roc. However, if scan was just pending (and not actually started) there is no point in trying to start the roc, as it might have started already. This solves the following warning: WARNING: CPU: 0 PID: 3552 at net/mac80211/offchannel.c:269 ieee80211_start_next_roc+0x164/0x204 [mac80211]() [] (unwind_backtrace+0x0/0xf0) [] (show_stack+0x10/0x14) [] (dump_stack+0x78/0x94) [] (warn_slowpath_common+0x68/0x8c) [] (warn_slowpath_null+0x1c/0x24) [] (ieee80211_start_next_roc+0x164/0x204 [mac80211]) [] (ieee80211_scan_cancel+0xe8/0x190 [mac80211]) [] (ieee80211_do_stop+0x63c/0x79c [mac80211]) [] (ieee80211_stop+0x10/0x18 [mac80211]) [] (__dev_close_many+0x84/0xcc) [] (__dev_close+0x28/0x3c) [] (__dev_change_flags+0x78/0x144) [] (dev_change_flags+0x10/0x48) [] (devinet_ioctl+0x614/0x6d0) [] (sock_ioctl+0x5c/0x2a4) [] (do_vfs_ioctl+0x7c/0x5d8) [] (SyS_ioctl+0x6c/0x7c) Signed-off-by: Eliad Peller --- net/mac80211/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index e4baa53..d887b25 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -275,6 +275,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) { struct ieee80211_local *local = hw_to_local(hw); bool hw_scan = local->ops->hw_scan; + bool was_scanning = local->scanning; lockdep_assert_held(&local->mtx); @@ -327,7 +328,8 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) ieee80211_mlme_notify_scan_completed(local); ieee80211_ibss_notify_scan_completed(local); ieee80211_mesh_notify_scan_completed(local); - ieee80211_start_next_roc(local); + if (was_scanning) + ieee80211_start_next_roc(local); } void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)