From patchwork Wed Mar 8 12:33:32 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: 9610979 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 661C76016C for ; Wed, 8 Mar 2017 12:32:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD5328334 for ; Wed, 8 Mar 2017 12:32:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EFE928576; Wed, 8 Mar 2017 12:32:37 +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=unavailable 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 CE6EA28334 for ; Wed, 8 Mar 2017 12:32:36 +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=A1P6B9o+Fbgmu3dfGvkk+w2iQ4sfzjm/h3R8h9xIxaA=; b=FfZIGb4N83ZuE2 4XCCzbNiKurBflRstUH0wLlkXAyNgoxTUzPmOPCP1QJMXQeX6EwL/aTYuVdLhe7QvLDawfgDLB0kW +GGMvn//npj+lCxPourba26FNe6SKQlmCy0syZ7wjAEFcOqXZhWEFD1eXXUOkczrQ2UsBz2mIkCEy 5ZNcTh0GqXJHhWQbtm4KTg1i4hgxKtQUL53VR2Fxwrf2IkoalkzWcjSL4nam0evTj0ojkf3NZCrft RFBbDIGUbRvP2t/oDkQIshllHbQTBeg3njqGszsFVVIAFyQ79bwmW5QJ81lXS/da5Qecz8WjIOPKX bBOcZTSQckTZyUV6yg4Q==; 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 1clalS-0005wv-7E; Wed, 08 Mar 2017 12:32:22 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1clalL-0005eM-BT for ath10k@lists.infradead.org; Wed, 08 Mar 2017 12:32:19 +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=1488976335; x=1520512335; h=from:to:cc:subject:date:message-id:mime-version; bh=3kowQK01rczWlKEm88HJKIX+ymofGZ+gmFwf0weDHM8=; b=VC6KCg6/EIl4OKoowjCVe6TWpHuS22ViLxBRvXBTfYT5xdLuKFsnEdi4 FU/quPeD+gMq2f6WunF+CNeP4z01o8za+b45826zZW+FAdVbSMQwEGq/c 2Ab5VvvMywcG+33xQhuroUyI6fbMY/g/hNidsg0iMq4lFkQtnacgpSlQH 4=; X-IronPort-AV: E=Sophos;i="5.36,262,1486454400"; d="scan'208";a="364466402" Received: from unknown (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by wolverine02.qualcomm.com with ESMTP; 08 Mar 2017 04:31:50 -0800 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5800,7501,8460"; a="1304690321" X-MGA-submission: =?us-ascii?q?MDG2lx7YVpP7umNS0a4rkqnKjewGJYGJ9HcvfV?= =?us-ascii?q?6RedEtQ2Ubg+X3HMeN7dwsQy/G9ln3RMnC1CCmYpyG3dJWmbZorLDdd5?= =?us-ascii?q?9lSEGETFOjZZ7H4mL1Y19+YIxZe+Zzde2Qa5bT4edQW4YZLHgQGf42B2?= =?us-ascii?q?Ex?= Received: from nasanexm01a.na.qualcomm.com ([10.85.0.81]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 08 Mar 2017 04:31:49 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm01a.na.qualcomm.com (10.85.0.81) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 8 Mar 2017 04:31:48 -0800 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; Wed, 8 Mar 2017 18:01:41 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 08 Mar 2017 18:03:33 +0530 To: Subject: [PATCH] ath10k: Fix fetching channel during potential radar detection Date: Wed, 8 Mar 2017 18:03:32 +0530 Message-ID: <1488976412-8970-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: NASANEXM01F.na.qualcomm.com (10.85.0.32) 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-20170308_043215_536691_ED465790 X-CRM114-Status: UNSURE ( 9.49 ) 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 Fetch target operating channel during potential radar detection when the interface is just brought up, but no channel is assigned from userspace. In this scenario rx_channel may not be having a valid pointer hence fetch the target operating channel to avoid warnings as below which can be triggered by the commands with DFS testing over longer run comamnds: iw wlan1 set type mesh ifconfig wlan1 up (valid tgt_oper_chan only) iw wlan1 cac trigger freq 5260 HT20 (valid rx_channel, tgt_oper_chan) iw wlan1 cac trigger freq 5280 HT20 iw wlan1 cac trigger freq 5300 HT20 Once the CAC expires, current channel context will be removed and we are only left with the fallback option of using 'target operating channel' Firmware and driver log: ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5, count_false=4 ath: phy1: DFS: radar found on freq=5260: id=5, pri=3151, count=6, count_false=11 ath: phy1: DFS: radar found on freq=5280: id=1, pri=1351, count=6, count_false=4 ath: phy1: DFS: radar found on freq=5300: id=1, pri=1125, count=5, count_false=4 ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse, treating as radar ath10k_pci 0001:01:00.0: failed to derive channel for radar pulse, treating as radar Call trace: WARNING: CPU: 1 PID: 2145 at backports-20161201-3.14.77-9ab3068/net/wireless/chan.c:265 cfg80211_set_dfs_state+0x3c/0x88 [cfg80211]() Workqueue: phy1 ieee80211_dfs_radar_detected_work [mac80211] [] (warn_slowpath_null) from [] (cfg80211_set_dfs_state+0x3c/0x88 [cfg80211]) [] (cfg80211_set_dfs_state [cfg80211]) from [] (cfg80211_radar_event+0xc4/0x140 [cfg80211]) [] (cfg80211_radar_event [cfg80211]) from [] (ieee80211_dfs_radar_detected_work+0xa8/0xb4 [mac80211]) [] (ieee80211_dfs_radar_detected_work [mac80211]) from [] (process_one_work+0x298/0x4a4) Signed-off-by: Mohammed Shafi Shajakhan --- drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 2f1743e..1f83276 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3643,6 +3643,11 @@ static void ath10k_dfs_radar_report(struct ath10k *ar, spin_lock_bh(&ar->data_lock); ch = ar->rx_channel; + + /* fetch target operating channel during channel change */ + if (!ch) + ch = ar->tgt_oper_chan; + spin_unlock_bh(&ar->data_lock); if (!ch) {