Received: by 10.223.185.116 with SMTP id b49csp1077660wrg; Sat, 3 Mar 2018 14:56:45 -0800 (PST) X-Google-Smtp-Source: AG47ELuNz7i/o7dUUY7oOun+CTqM/HNvNrgKad8Vwga8ZzhOf84Od37/6sA0syW8QL1xiDMKfWo4 X-Received: by 10.167.129.195 with SMTP id c3mr10308708pfn.14.1520117805381; Sat, 03 Mar 2018 14:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520117805; cv=none; d=google.com; s=arc-20160816; b=UCIHnPSpCkVFcS8bBtpIlOgHRKAKbpizt0Xj+fgw5c2PQ+uV4nKwJSzBrr3auFqMeQ djaAE+nkb5kWPnaL29Y8yx3etYweJmoe/LLEKrxpMhkKNUx+7Uciy4aeRJno9fpw6W3O r0SoICy4CbZaYgWEOW86ykUdlXVe9+g3VPxqFR1M2Q/qJYYMJ+0eE3T98orS+R/cBzED +BUENPaNNFUWN03VxhrgBEYgm8SqcVb0ViOgBlNMFz16LtmiuHNJkIWATRCm92rt1LHH jyfHnv4yQYyCYcNyGvZCm8QcA0WYC6znJTt1+szpVjbhWxRuzksumZQaNG6H/qeU+u4V 8rgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9WPtXCi0t8l4Q9XYo7EaTk9Ss3rIJT6XLZlRMZVwdvI=; b=CJEWurLFLRwD12giDU5ejoSanZs1utt+jyH3DjDgsO7zpEWG+0+nyc1UfocutV26EQ GCV0BjfIABAEWkVGeqlKlZ2vH+D4wxsyxOfBqzpw23Ci7prPkciaCxGYvMFepqM7nz5/ 6/pdvTcU23BbngqrE1Ky68CGGdHzXF0Q+JvdzkmgeMSc6qRr30jXKp/F1nV1SoCMwiZa utBJr7a8lOU24nL/QTml/MiIehgKNj5kMnsmqqAcMOkvCS3P4CtlZsHFQ+2tpUIntLnx +JveUUmvY/UGg9x+wd3ieLmayYgtUV082T69Yh6MwW+t8H7UT0beuNBqIYokZXla8HuE oM2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TW2omVsB; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si7348828pfj.207.2018.03.03.14.56.31; Sat, 03 Mar 2018 14:56:45 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TW2omVsB; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934975AbeCCWzR (ORCPT + 99 others); Sat, 3 Mar 2018 17:55:17 -0500 Received: from mail-by2nam01on0095.outbound.protection.outlook.com ([104.47.34.95]:48488 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935373AbeCCWlB (ORCPT ); Sat, 3 Mar 2018 17:41:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9WPtXCi0t8l4Q9XYo7EaTk9Ss3rIJT6XLZlRMZVwdvI=; b=TW2omVsBlWdjb/Zigmhkr+Nwl6j714YoEdMI5y5vKuFCpPZR6KJdBx4KdLr0Ts+4yDNsIFxekDNuiHAlQQjbxvG+f5Mv4qmYPoqLuWWC+G7uCBGjo7F2jIsEXVbe9H76kALyoeXG4i66DPddNNEfaUvGpKqfbzmvO9mkuyKMc3s= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0940.namprd21.prod.outlook.com (52.132.146.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.5; Sat, 3 Mar 2018 22:40:59 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:40:59 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Mohammed Shafi Shajakhan , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 10/63] ath10k: disallow DFS simulation if DFS channel is not enabled Thread-Topic: [PATCH AUTOSEL for 3.18 10/63] ath10k: disallow DFS simulation if DFS channel is not enabled Thread-Index: AQHTsz+eXA4gOaT+Yk23uxd0ll048g== Date: Sat, 3 Mar 2018 22:33:14 +0000 Message-ID: <20180303223228.27323-10-alexander.levin@microsoft.com> References: <20180303223228.27323-1-alexander.levin@microsoft.com> In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB0940;7:+AROyijOyn3ZIOtR8JjNJaBIg3PH/R2VX7frBOBTp3Jy2d9Y5MB4gf1EN9g96bWEhoCm7R2i1aG8ASA6Bq8HVXpJHfnSC84n6f2lbrLrgi0En5VzpSLiXpZ8dlqMYG98dRvVGLGLssfxcykUq8WshZ9rbP9k2gO975RynEP3hm5e/MHbLAVWzCpRsQuxVt5f4/EknmyJ/FMweF3EfkZviS6LPNr1fDHWqTYuXlJgjpks57YdMJqgVuJgoQq9PjrJ x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1629c902-d1b3-444b-adca-08d58157d5cf x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0940; x-ms-traffictypediagnostic: MW2PR2101MB0940: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0940;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0940; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(39380400002)(346002)(366004)(39860400002)(396003)(51234002)(199004)(189003)(106356001)(68736007)(6486002)(25786009)(22452003)(6436002)(186003)(2906002)(81156014)(81166006)(10090500001)(66066001)(8676002)(36756003)(6512007)(2900100001)(316002)(97736004)(59450400001)(102836004)(53936002)(6506007)(3280700002)(26005)(4326008)(5250100002)(305945005)(2501003)(76176011)(2950100002)(86362001)(99286004)(3846002)(72206003)(14454004)(3660700001)(478600001)(1076002)(5660300001)(10290500003)(6666003)(6116002)(7736002)(86612001)(107886003)(110136005)(54906003)(105586002)(8936002)(575784001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0940;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 2kax5gGnN1hRvpuRSs8DsP/rDbOpRoGsrWUQAAgNBZINDNCIfIaIwIDG07yvubXuI6YoSqhxFBicWF7ilXI/GoYZWM2rbv8rmfUJ0uDRBn9otupQzZxY03J2iJv30Brj5q+RrKLCeLoDMCcYlscL7mhXLF3LNv7lnmY4KZAUbdk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1629c902-d1b3-444b-adca-08d58157d5cf X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:33:14.8722 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0940 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mohammed Shafi Shajakhan [ Upstream commit ca07baab0b1e627ae1d4a55d190fb1c9d32a3445 ] If DFS is not enabled in hostapd (ieee80211h=3D0) DFS channels shall not be available for use even though the hardware may have the capability to support DFS. With this configuration (DFS disabled in hostapd) trying to bring up ath10k device in DFS channel for AP mode fails and trying to simulate DFS in ath10k debugfs results in a warning in cfg80211 complaining invalid channel and this should be avoided in the driver itself rather than false propogating RADAR detection to mac80211/cfg80211. Fix this by checking for the first vif 'is_started' state(should work for client mode as well) as all the vifs shall be configured for the same channel sys/kernel/debug/ieee80211/phy1/ath10k# echo 1 > dfs_simulate_radar WARNING: at net/wireless/chan.c:265 cfg80211_radar_event+0x24/0x60 Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211] [] (warn_slowpath_null) from [] (cfg80211_radar_event+0x24/0x60 [cfg80211]) [] (cfg80211_radar_event [cfg80211]) from [] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211]) [] (ieee80211_dfs_radar_detected_work [mac80211]) from [] (process_one_work+0x20c/0x32c) WARNING: at net/wireless/nl80211.c:2488 nl80211_get_mpath+0x13c/0x4cc Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211] [] (warn_slowpath_null) from [] (cfg80211_radar_event+0x24/0x60 [cfg80211]) [] (cfg80211_radar_event [cfg80211]) from [] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211]) [] (ieee80211_dfs_radar_detected_work [mac80211]) from [] (process_one_work+0x20c/0x32c) Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/debug.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless= /ath/ath10k/debug.c index 3756feba3223..d3ebac0d7f7a 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -1079,6 +1079,15 @@ static ssize_t ath10k_write_simulate_radar(struct fi= le *file, size_t count, loff_t *ppos) { struct ath10k *ar =3D file->private_data; + struct ath10k_vif *arvif; + + /* Just check for for the first vif alone, as all the vifs will be + * sharing the same channel and if the channel is disabled, all the + * vifs will share the same 'is_started' state. + */ + arvif =3D list_first_entry(&ar->arvifs, typeof(*arvif), list); + if (!arvif->is_started) + return -EINVAL; =20 ieee80211_radar_detected(ar->hw); =20 --=20 2.14.1