Received: by 10.223.185.116 with SMTP id b49csp1115907wrg; Sat, 3 Mar 2018 16:02:57 -0800 (PST) X-Google-Smtp-Source: AG47ELubUw/v1+zzZKlJYkj/6XjShnHeUb+CWSdhF54Wj7cHmjxpURQBacZJP3yrjrcoITuuwehC X-Received: by 10.98.194.219 with SMTP id w88mr10514957pfk.26.1520121777308; Sat, 03 Mar 2018 16:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520121777; cv=none; d=google.com; s=arc-20160816; b=RJtIzoz0tKV9kVyVU/cw0jxau1+rbTyrKL3lt9p8N5uIvpBLpZ4slBcrzXx2wu0Ip3 wu1DrwHMsQfMaQnQOdDLxCeBT7WS2ou1FU1Hq08I6gXxnZdhnpWyxnpAsyE/OlQLGt9F dU1/4kvrYDSvbsr/fI1S3+DGPWR4YPY91gHMh/DainOBGMFnCvbBitl1jEiMuK+Uss/V byN5nAAlLE96sKzD1LRZS24TQv0NeQmFEAKrGK2vS0WBTfhjjyJXkze681X/YOZxCgTR sQlFdtI4IOxmGwWBy0raDmE37a5rpNzbtPdPUB56fqLycBk55AdZDbZfVVJTCZr5iO08 n1gw== 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=8uxBtFzSYYut3mgdFh6xyXjOfpwQW/Yqdlv9BDcGsAM=; b=vdWGpZzSASsosZIojgsXniu0Qn2XPRgOg0femV15BiqakOBPhGxmvxiSmgqfSWgk7M q4ybqDKqHkBaTSFTCwRrSy78lmta4iTi/mhuerjfnwdN9RUxsF/0GHIX5vb/XtmfIlqZ GTUubyHT4xJLkHlVecYv4u7x/Ej5twOYwaIFcxXFsXCQ2aGXSgSPiBs+kcPsd96LYFz7 dH+rdeDgUshbDD3BcK7kPPX3N12YRhEqcWAm5wJxDpVEppa1vsi51FS7V0WgZlLaA3rw EK1jEvPrQ4s1F1oJ9LGmvJU31S6oUr0H7u/eGpaDFOSzONOZhHqBtU0t3sNQmXcKcaLv c2Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZVGd9IEt; 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 97-v6si5412100plb.23.2018.03.03.16.02.43; Sat, 03 Mar 2018 16:02:57 -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=ZVGd9IEt; 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 S1751309AbeCDACH (ORCPT + 99 others); Sat, 3 Mar 2018 19:02:07 -0500 Received: from mail-co1nam03on0109.outbound.protection.outlook.com ([104.47.40.109]:6764 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932266AbeCCWcA (ORCPT ); Sat, 3 Mar 2018 17:32:00 -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=8uxBtFzSYYut3mgdFh6xyXjOfpwQW/Yqdlv9BDcGsAM=; b=ZVGd9IEtr6etnT2vdzirLKjZFId0seAd+38N9dZJP3alJeYwvb5yMQO2D1Yf5Wil9fa0jGs/nuHCiK8B9sTucCnfN0amdMiI7bTtej8fDekN7JvPEzftEmW6vmaQ5dZW5xKXlPH9R2ugsd17laZNxjhNwr4x4s3rxs6bQtbGPY8= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1083.namprd21.prod.outlook.com (52.132.149.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.1; Sat, 3 Mar 2018 22:31:58 +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:31:58 +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 4.9 035/219] ath10k: disallow DFS simulation if DFS channel is not enabled Thread-Topic: [PATCH AUTOSEL for 4.9 035/219] ath10k: disallow DFS simulation if DFS channel is not enabled Thread-Index: AQHTsz7so3Yejx/TIkKsC/Q1+M3y0A== Date: Sat, 3 Mar 2018 22:28:16 +0000 Message-ID: <20180303222716.26640-35-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-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;MW2PR2101MB1083;7:aNAgzL19s3HEL01/b5OFq8D/EoXPNnMeBVPTnu6ZMLtFYWb+xPh6gdeZ3YnQ5vyPALFcywAcovy4zs0f8f1zTsGE1jiRqFGd5dprLNSzrDPnVPFrohJ49Uqnm5ukVIQCA5afLHZvNB7RJIh6v7ZoNt5ArdpwvmGtuegzaVOIH/4kjwWaorBYSqDaLeouDmKo5ng11wd4RVkEuDggaB+J9LNbR3bGISZp+kTyM8VeJXmJXRdG81gQ47GxWmvHtpW5 x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dbff3fe4-4126-4cb6-1e89-08d581569358 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB1083; x-ms-traffictypediagnostic: MW2PR2101MB1083: 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB1083;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1083; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(39860400002)(39380400002)(396003)(346002)(366004)(51234002)(189003)(199004)(106356001)(53936002)(316002)(305945005)(7736002)(3280700002)(107886003)(2906002)(6512007)(6436002)(97736004)(3660700001)(6486002)(99286004)(81166006)(8936002)(81156014)(76176011)(8676002)(25786009)(2950100002)(6506007)(4326008)(110136005)(5250100002)(54906003)(36756003)(575784001)(105586002)(6116002)(6666003)(22452003)(86612001)(10090500001)(186003)(68736007)(26005)(2900100001)(86362001)(66066001)(102836004)(3846002)(14454004)(478600001)(72206003)(10290500003)(5660300001)(59450400001)(1076002)(2501003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1083;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: YhseWechbAqCxOOxhiBhSaiL8ccUXNH83QsdFny8EJbigcgm1Jj3FOESP3cjRSRPcuzJITQ28a7cn/K8pMUp5g7t8uZ7s+Ns7d23+CQnfPeXIeUqgRj/+lOy1UD4tN3tA/Z9zWjHMIa92rjnsjF4Sfg9DW0nqdBPi6g+B3wPi6I= 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: dbff3fe4-4126-4cb6-1e89-08d581569358 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:28:16.0881 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1083 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 82a4c67f3672..6aa2b93497dd 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -1942,6 +1942,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