From patchwork Fri Mar 31 11:58:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Shafi Shajakhan X-Patchwork-Id: 9656095 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CC4F60349 for ; Fri, 31 Mar 2017 11:56:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C99328643 for ; Fri, 31 Mar 2017 11:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F57B28684; Fri, 31 Mar 2017 11:56:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB16128643 for ; Fri, 31 Mar 2017 11:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=f7V3jt/veaApAPlARr0OmSQIhyae5P5stac3G1WGBUM=; b=LI22onmxq44yZy /lfm7cB79HgHfdZ7+cwS0vmN5jbYJfaUHCT65VRK5xVRpFzRm11JUNx5pTsRyxnhxxITh6yqz+IfG mlnefXyls2RNHr9+E9OWuvtNK01lJ/8eT1AFmhRpK8DpPazK1wteW4CfWMZsAdQneEER0xh2tWCKw Thfl5Kv+U39DVMVpxU4lOVCVqlZtb2ETn0uR3IOLUrkS4vFAdTd0i/zSSGT2wKisHxLDA+c7zxEDs n7v+em/qTN7IxHERHPAPNM605PCUwcMgOrMpQfTbro0Uh39t9wkKcg5m2OhLLzBuKBewmrbyUgUY+ nAhLJEGiuewh4p6X+IPg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ctvA0-0006Wa-8m; Fri, 31 Mar 2017 11:56:08 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctv9t-0006St-3O for ath10k@lists.infradead.org; Fri, 31 Mar 2017 11:56:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1490961361; x=1522497361; h=from:to:cc:subject:date:message-id:mime-version; bh=iyt82gblfZSoXxOxLep7cisLYlT398a8lxgFRB3Z2T8=; b=YPpZ8NxhLSR0Mio56jTEm0mmiwmRwNAFdvqtDlsYxoCV7NdvUa2ytSTj XVwfFG5jhT1l1rrFtXCYAwxJForqxGNKm1UKCSrSx8364X0ekHxHT+Reo hMjWx0FdbvQmi5wlkpMb2NKeQNACaHeGZCdoC3H+/uURhI2PXMqqGEIOc 4=; X-IronPort-AV: E=Sophos;i="5.36,251,1486454400"; d="scan'208";a="275055504" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP; 31 Mar 2017 04:55:38 -0700 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5800,7501,8483"; a="896445336" X-MGA-submission: =?us-ascii?q?MDHswsmkAcU7if6qXeQAcuh5lO0w2sXYfz+vz/?= =?us-ascii?q?PFvIaXVJc4pJj0jSvhxse9iqqzfEFPG28o8/B9f8WbuTxOkIA8pMGCt/?= =?us-ascii?q?y8hHWGjYM97dLsrXFmRXFO23wjqkMKoz2cJAvj7XgwEXOts6uPByDN54?= =?us-ascii?q?2a?= Received: from nasanexm01d.na.qualcomm.com ([10.85.0.84]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 31 Mar 2017 04:55:38 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01D.na.qualcomm.com (10.85.0.84) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 31 Mar 2017 04:55:37 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 31 Mar 2017 17:25:30 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 31 Mar 2017 17:28:42 +0530 To: Subject: [PATCH] ath10k: cancel coverage class work during stop and restart Date: Fri, 31 Mar 2017 17:28:41 +0530 Message-ID: <1490961521-32746-1-git-send-email-mohammed@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01G.na.qualcomm.com (10.85.0.33) To aphydexm01b.ap.qualcomm.com (10.252.127.11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170331_045601_264440_3445B709 X-CRM114-Status: UNSURE ( 8.11 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mohammed@codeaurora.org, linux-wireless@vger.kernel.org, Mohammed Shafi Shajakhan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mohammed Shafi Shajakhan It seems set_coverage_class_work is not cancelled anywhere, though I could not find a crash/warning with this existing design, its safer to cancel it during stop() and also before restarting the hardware. Signed-off-by: Mohammed Shafi Shajakhan --- [comments updated, thanks Kalle] drivers/net/wireless/ath/ath10k/core.c | 7 +++++++ drivers/net/wireless/ath/ath10k/mac.c | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index ba8768d..e653717 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -1610,6 +1610,13 @@ static void ath10k_core_restart(struct work_struct *work) wake_up(&ar->wmi.tx_credits_wq); wake_up(&ar->peer_mapping_wq); + /* TODO: We can have one instance of cancelling coverage_class_work by + * moving it to ath10k_halt(), so that both stop() and restart() would + * call that but it takes conf_mutex() and if we call cancel_work_sync() + * with conf_mutex it will deadlock. + */ + cancel_work_sync(&ar->set_coverage_class_work); + mutex_lock(&ar->conf_mutex); switch (ar->state) { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3029f25..6470ed3 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4684,6 +4684,7 @@ static void ath10k_stop(struct ieee80211_hw *hw) } mutex_unlock(&ar->conf_mutex); + cancel_work_sync(&ar->set_coverage_class_work); cancel_delayed_work_sync(&ar->scan.timeout); cancel_work_sync(&ar->restart_work); }