Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp603040pxx; Wed, 28 Oct 2020 12:09:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweI5eu1/IU5K9HpaNQIBdqS75xSk8XzKZH2MAH/zFgcBAp7cP7hbYyI9MdHY9oXVHgAyXg X-Received: by 2002:a50:d517:: with SMTP id u23mr396510edi.338.1603912198508; Wed, 28 Oct 2020 12:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603912198; cv=none; d=google.com; s=arc-20160816; b=NQPNmEEMkn7Bz2oxy8PFPY/A81dIhs/5o3IiGvN87RFOveImHjMFwSBzC4r9DGlH8U qIGCBwQ6O46cDQO56rNWP9tfgRQKQKbwfBsaKC4iF3WhxPE5m7QRh0meKI613M1clqIh Cy4fX7UPwFYBlZdhcoiCoBSTlf8MQFvx9sJ21ihshDZ61Lidb7CHZIv1NYsGfgVbagrk 2VvVqrld2obxEAbF3EMOaOiuYJzIrjokra+13bs1w84IChuLdEAZB7ziqU7ZzAgaFfb6 U94TqDG33x/LTKTMMOyhAqLRI4GRqZcSvXr92K0H8oYviIKv/48BTW2PfruEmpNgg7J5 czQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iIITnNOHhLBUQX1tYJJrku778bFEmDRs9tsQ4casRB4=; b=pWOdHx+ds5kPuxW7bcItd93wM+7aU1r9tD2sj06LXK39lVp8x2St16ASBk5qBpBM9+ TgGLvq6I+Ch4W6QYDb6fNSzmJc5Gy6jn+tXLAuZ/oHaLg6Co8vOCkTIV3789F5IHtFV4 DPSbFPWodsmNxDqAOsKPLUBFcg6IGi3/LPmGlatLpbOsRG/qcXCyegQBQZkQVyMexzHW 6m08QHLAe2tgWGfbu9Wm5eNqzGbJhYWb+6aUrSTsEFhSIKxO1pYLIpzHsAoicgchTDyQ DuDTB1pj5TK8ZJl6M+HblfrMjBfdBo2UVHB1A0BVSrmBADpmBT/oR2NQ47Pk2UMJI+lh yoaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6r+lzuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay1si32292edb.3.2020.10.28.12.09.35; Wed, 28 Oct 2020 12:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6r+lzuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1826282AbgJ0SSY (ORCPT + 99 others); Tue, 27 Oct 2020 14:18:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:60302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2507353AbgJ0OLO (ORCPT ); Tue, 27 Oct 2020 10:11:14 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6673922284; Tue, 27 Oct 2020 14:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807873; bh=isIZVoKOxKXWE6sSxI1avpyfCm9wqvraJw1QI7nSX0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6r+lzuPuMr+kWOS8TZDB0wyDtvZyrPoCGfZq2iOJxkf2Tgy67/K0XCk5ngvZnztF hAy0MY1hKWYmVUEMpSpwNNi0CldhmJIxRh65eIM+A5XLWEF/T1c6EDRqvM5+O5IRe3 ukzuE5SQmts6u7zbQs9PXj4tEmkNCucYLBO4nvPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Venkateswara Naralasetty , Markus Theil , John Deere <24601deerej@gmail.com>, Sven Eckelmann , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 041/191] ath10k: provide survey info as accumulated data Date: Tue, 27 Oct 2020 14:48:16 +0100 Message-Id: <20201027134911.720450590@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Venkateswara Naralasetty [ Upstream commit 720e5c03e5cb26d33d97f55192b791bb48478aa5 ] It is expected that the returned counters by .get_survey are monotonic increasing. But the data from ath10k gets reset to zero regularly. Channel active/busy time are then showing incorrect values (less than previous or sometimes zero) for the currently active channel during successive survey dump commands. example: $ iw dev wlan0 survey dump Survey data from wlan0 frequency: 5180 MHz [in use] channel active time: 54995 ms channel busy time: 432 ms channel receive time: 0 ms channel transmit time: 59 ms ... $ iw dev wlan0 survey dump Survey data from wlan0 frequency: 5180 MHz [in use] channel active time: 32592 ms channel busy time: 254 ms channel receive time: 0 ms channel transmit time: 0 ms ... The correct way to handle this is to use the non-clearing WMI_BSS_SURVEY_REQ_TYPE_READ wmi_bss_survey_req_type. The firmware will then accumulate the survey data and handle wrap arounds. Tested-on: QCA9984 hw1.0 10.4-3.5.3-00057 Tested-on: QCA988X hw2.0 10.2.4-1.0-00047 Tested-on: QCA9888 hw2.0 10.4-3.9.0.2-00024 Tested-on: QCA4019 hw1.0 10.4-3.6-00140 Fixes: fa7937e3d5c2 ("ath10k: update bss channel survey information") Signed-off-by: Venkateswara Naralasetty Tested-by: Markus Theil Tested-by: John Deere <24601deerej@gmail.com> [sven@narfation.org: adjust commit message] Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1592232686-28712-1-git-send-email-kvalo@codeaurora.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index ea47ad4b2343b..be4420ff52b8a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -6718,7 +6718,7 @@ ath10k_mac_update_bss_chan_survey(struct ath10k *ar, struct ieee80211_channel *channel) { int ret; - enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR; + enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ; lockdep_assert_held(&ar->conf_mutex); -- 2.25.1