Received: by 10.213.65.68 with SMTP id h4csp1773765imn; Mon, 19 Mar 2018 12:54:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELvDcOWDrwMXs5nC3PXJ6mLrOsGssK6jPFrW+v+FT5ZF7Ba5EjUO9GHWOBnp6plUlJYYZQUZ X-Received: by 2002:a17:902:7885:: with SMTP id q5-v6mr13437795pll.207.1521489262933; Mon, 19 Mar 2018 12:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489262; cv=none; d=google.com; s=arc-20160816; b=s5J8JIajB0lkBI6mMyD0eusB2Dcds3D8AUu1puPz0h0e8YgIeOFGKfNF4U3CpYiuwk beeURwKYk0PFRGjItdpboVAujGUQrddHeDEt3mjlRRuLMehFow1F2Xu4SO6yaXfj4alN 6ZaBpko7n833lqHfDs11BMeMwThPIEoA/jIy/sxqa/p2WBxJ8K9hFdm9i0yX4ylv2qTU wJKz4iCOnfQ1zOAm+2HlDsY0C+MDcATko20h6gvStYx3aCwHo4pRU9i531HIPGlFTTDy 96ycNS54yhJYj+x5LBU/Wj3ooGAPsvtP+S/5GPDbLCLq2YEJQ/Pymp0ap/HBDuql4Nkp p9Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pFJWBwWgP7KRhfroXCjsl7AiPg11emHNLrVYFkkooX8=; b=QSac6gwQzsDJy4o9dh9bZGnveo+yVGNeEvZurERBIui44tiezHqKyUp4hvVwzEY4p2 aH6/3cxZvp/D8OazaUFEs4YHwVAbbO0NOzhP0UezFD4dlyws/RnUSjMb2LoCKx7kv5hv 2EfYH5Kri4IJyrHl2c/larKYdB5cBYjZkwW9O8HtzVREPmIz15IX+KDl71k/ldnSDXky xcyZoKeYXJv/UHYBos8eAVNoyfDvXLPUv78GEoqKh3c/wa5Pr3mvllHuDzM2tcZqU/jT swCPr4ZA6/otVALBQyTALsu5jImYIhUvCG+n+pjl+GL6ZckbQDTHLgKPUKi6ScEkJNvd rgCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si484098pli.557.2018.03.19.12.54.07; Mon, 19 Mar 2018 12:54:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969447AbeCSSTk (ORCPT + 99 others); Mon, 19 Mar 2018 14:19:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46996 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969381AbeCSSTU (ORCPT ); Mon, 19 Mar 2018 14:19:20 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7817D10F9; Mon, 19 Mar 2018 18:19:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohammed Shafi Shajakhan , Kalle Valo , Sasha Levin Subject: [PATCH 4.9 034/241] ath10k: fix fetching channel during potential radar detection Date: Mon, 19 Mar 2018 19:04:59 +0100 Message-Id: <20180319180752.591707462@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mohammed Shafi Shajakhan [ Upstream commit a28f6f27a88f047f03f04b9246ca260ebc91455e ] 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 Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3638,6 +3638,11 @@ static void ath10k_dfs_radar_report(stru 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) {