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: 9656093 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 808EB60349 for ; Fri, 31 Mar 2017 11:55:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708AF28643 for ; Fri, 31 Mar 2017 11:55:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6404328684; Fri, 31 Mar 2017 11:55:42 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD6B28643 for ; Fri, 31 Mar 2017 11:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932860AbdCaLzl (ORCPT ); Fri, 31 Mar 2017 07:55:41 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:40421 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754417AbdCaLzk (ORCPT ); Fri, 31 Mar 2017 07:55:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1490961339; x=1522497339; h=from:to:cc:subject:date:message-id:mime-version; bh=iyt82gblfZSoXxOxLep7cisLYlT398a8lxgFRB3Z2T8=; b=yfXPZxhKw62c6KI+mDghFGV7iFe8AyKYNAeEbni6KEVN35FtEQP9NM7C zQT2PM0ZBORkaFHe3BWKw2NgroWsLwaBstJaheGWaSFsXlVyp+8b4qz/1 /GszMAKbjHYS8/RFApFeSu6/1dkPc0seRKcv0I+4Wl14CKzEJTa1D5TnL 8=; X-IronPort-AV: E=Sophos;i="5.36,251,1486454400"; d="scan'208";a="275055503" 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: CC: , , "Mohammed Shafi Shajakhan" 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) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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); }