Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1223196pxx; Tue, 27 Oct 2020 11:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKrJh88uSfXk6gwfFM4/RVH1MnIquBUVl38Lw1HhYoGQFAzJPK+GBuBI1zW7dremQ25Vtf X-Received: by 2002:a17:906:280a:: with SMTP id r10mr3588802ejc.45.1603822018095; Tue, 27 Oct 2020 11:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603822018; cv=none; d=google.com; s=arc-20160816; b=s+SiXSp+unJ1TO4kjAX8KIMhf9dAXg+XS5jaUsmuKUakEDPVKlmmlJK+vv++hI5tgx /n09adLXTeKhinyoGEBfrZYeNGMNRYMYKPjH9nyE3Ekfr9D3Im8WPyhVbmYBaU6/xFA9 QLSHQmD8wLhbDDZS/WrJJbJf4Vla8hPE9NGeahtCQh9JSMxsnVoNw6olfmr3qcqjwdVV JXQKUFeiIZ+HqUBmn956NZLQgJlaPebOzjvszxx3fcaam+mZ2H0t46ETR/ND1Z0Etf6z 6qKPLh4pHcKTMRawEgig6whcopGe/mJn0XFkNBQhUiSXSgxcIEFs0MnwxCLkYvgiWUXc VXkw== 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=jeMNAvpeF2315/v1aEKp+BEhcLG5W+eMpZzcBBDS1Ao=; b=PQzOlfhueqIfRXgw1bQjgMZXcMXDArr1TYfxngLIoY2UMX8EKt2VXgYCyQXmdaTaoe etLeL2XEJkunhL0ZZdpuYFqlSo37/d2RALVHhM+Vgj4Hf8mAczPOSB9qGAcniXHYufAt T3HU26/OYULq5+nybqh1vBjpKbSgRx/R2bGOsgoppX7dB8cHi34nSN1L+0I3MWNiAnal RktBJKGU1Po6Xg9YSwQiGhJkz7So48cFjEOM8XsgpQbxp8xRRJjZ3v+qGj0VGjsRhSi8 S7lEUiV7286/VDAj+RoxNJFQuKgkZJOHGJNvVC2OMb+vzKv/B7Md8PKhonhoqkqL6O+m pueg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gvera7Vc; 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 d5si1504858ejj.231.2020.10.27.11.06.33; Tue, 27 Oct 2020 11:06: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=Gvera7Vc; 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 S1760275AbgJ0OeX (ORCPT + 99 others); Tue, 27 Oct 2020 10:34:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902372AbgJ0Oc6 (ORCPT ); Tue, 27 Oct 2020 10:32:58 -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 8420720709; Tue, 27 Oct 2020 14:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809177; bh=YqtLuZQZPmRkC5QNozAQcF6nEFU1MFaMOGR/B2pblzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gvera7Vc3qmu/lWG3CtnptsMAjCu2V4XzQ4BRkV6hxqwrAZ991gaV0y6Moh8WPr6k KxpUzG4Uo0hX+1yyp6xORfajcCizISkoMCbvNnWh2a2T6kOYw75ArSnAKhLq/Zc/CD tAiSiGQ3frZKxTSA6I4wlhwcKoceKqR4NjO8Ut6U= 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 5.4 103/408] ath10k: provide survey info as accumulated data Date: Tue, 27 Oct 2020 14:50:41 +0100 Message-Id: <20201027135459.879588055@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 d373602a80145..915ba2a7f7448 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7131,7 +7131,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