Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp922117ybt; Sun, 14 Jun 2020 04:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuKqMvWIC/aHcuUbPGjDSndQnTIKjBs1dXecoihNrbyI7M72y3SiufiIo8Lrm0MnUm56gW X-Received: by 2002:a17:907:35c2:: with SMTP id ap2mr19997391ejc.530.1592134367854; Sun, 14 Jun 2020 04:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592134367; cv=none; d=google.com; s=arc-20160816; b=SPbaRQKqClFm07pwhDydrpF7lzFIOSxR7antMff5uD0+BrCI681ITNDj9niFnGYGvz hevp94Cc4bQNMzdsozSmVyVJxb9VsXKegdEc81mK2DCu2jYTd6IsjyClfQeTeV6eXF4M xz07kqFr/4V25C54bOdOGJaGgv+JBLGPzCAi9nSYd3mFgLEB6tz00ToM4MlNsmRMmbm9 iL7MSZs8SGzKFJbuesCTBPktSZrYvRZncjBCe9u234Q9D2xJ1YxigaTLzO50bQfqlZfS 3DXcN1htafT/a0QcZd+knwj5iEu+9ZMik+jkxuYQ+sCHZ1CElUsqiHrwa0TGLNWzvXbi BwaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x3kIWwfoDmasL/x0ySkxgj1UGDL9LlCfFBJO0KTrbPo=; b=uoq3j08U2JnVBaWrTB95kIU5+mWej267QNBGfqWqz01A9fyQgQMwCdstkNK5hCfa0g DgXzKM6RM1WwJG3gCIrVFzL8dmMiOncTcf/3/UchYOc9qDMYdj14P9Ydym4BPobQQeFB 6pqudfeBgZnOXyYtOZxawppH4CsUmv15mocNcasdPVpaty33yOGT5Jj4fAvvA8Sh8NbE xCHPGI2n36kuDpsUveQgzhfPEHi1a8kF8rVScBkHOBqudavjxAJtbiok4XNw8E692/jN r6K+NhOObgUo46/td+/CFYEoAGl6UU+E0QIuP5dziJ4Sry4kkYeECS1u/nvoGPgWWwB5 6Vjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=aQLFIt1R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l24si7936076ejr.561.2020.06.14.04.32.11; Sun, 14 Jun 2020 04:32:47 -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=@narfation.org header.s=20121 header.b=aQLFIt1R; 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=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgFNL10 (ORCPT + 99 others); Sun, 14 Jun 2020 07:27:26 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:38648 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgFNL1Z (ORCPT ); Sun, 14 Jun 2020 07:27:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1592134036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=x3kIWwfoDmasL/x0ySkxgj1UGDL9LlCfFBJO0KTrbPo=; b=aQLFIt1RQ9rvV25ADjA7pqeWdBu/DRerDhscB4xIJc/q8Oj4D1m2ySivivI9EDgIVcAQPA cyC3dXBhYDerQ2/5i3B9hp7QGrBOvG8LpRxJbNkp3G53UB1yAWlLbIgJLicd0YJQqvdpnO CZGL2mRjHkA1fH6cYNxPcPb0hvd/DSA= From: Sven Eckelmann To: ath10k@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Venkateswara Naralasetty , Markus Theil , John Deere <24601deerej@gmail.com>, Sven Eckelmann Subject: [PATCH v5] ath10k: provide survey info as accumulated data Date: Sun, 14 Jun 2020 13:26:44 +0200 Message-Id: <20200614112644.27284-1-sven@narfation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Venkateswara Naralasetty 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 firmware 10.4-3.5.3-00057 * QCA988X hw2.0 firmware 10.2.4-1.0-00047 * QCA9888 hw2.0 firmware 10.4-3.9.0.2-00024 * QCA4019 hw1.0 firmware 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 --- v5: * add additional tested devices * restructure commit message v4: * updated signed-off-by v3: * Rebased on TOT and added Tested-by Everything expect QCA9984 hw1.0 firmware 10.4-3.5.3-00057 was also tested by me. --- 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 919d15584d4a..77daca67a8e1 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7283,7 +7283,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.20.1