Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3733874ybz; Mon, 4 May 2020 08:43:22 -0700 (PDT) X-Google-Smtp-Source: APiQypK4dYBSTUAMtCh7R/6Np8altrcvcRXDhA0bMQRgr91hK2ufeW6ybuiH/5FoP0DSYzsLgvAq X-Received: by 2002:aa7:df8d:: with SMTP id b13mr15485429edy.145.1588607002508; Mon, 04 May 2020 08:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588607002; cv=none; d=google.com; s=arc-20160816; b=WqxVKBgy3fEwCZBscNcCD3T0ggEA7G0wElh8QuDbVwNkBEzls95eIGMJzpuQcd02F2 IRBBNK494TcVrQfF0QnWI6J2c87jhyeTrrMak6S4sekPlpNfBODcyI5/RYWlBDFxmt0K 0bXTCXgkQL5sapW3e70X38IIFNQBNu8ARURT6x4fgy06t1N5U0+Ms+kI+GyqIHsrebrd 86bWNcd8kg9Z8XNsZ+dVZ5GtLHW3ciCxwSaj0uw9I76gmOdtt3gJQJwmlCMlg2wExScN pwGzEEpFNjewzCRVEP6rkidRmeFC4duYDDjroSXk4C5BDZvXdD9yrZsSeR4DIDtUiSS0 hSzA== 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; bh=gQbJeHL3SfdY6n1Ek5vtZB2v1IhMWMYVclOYzwyMU90=; b=nEL6hu9FE4RO25mQBv5xNV6vva0WEwQLnTUBmN9VFx/2IiH2bDA1IPq3bSHHH9MGZc 1uIrR/uCG49e/tackDAwudjQec1QAVM1zEHYF7+4RLxhCFq51TT3NhWPZEDWIM9yCiwy HrMd1XeGzYsMOV6yiOsFmSE564mvkxCNpu1zbK1LT3yISfki4nrObM+fPJaORKXXeo+G GHXVl5R+10vBqBMPw34ZbDFkjhkFXM2kCMT3yO08bmxZ7b5hWKXuSHJ8iuORRBL3i3Sz rls6gTYQrllGFKbnC4/MhvTmjHj3cRERMssZq4CHOTKgeojogeFjr3W1QNsrqFSskf2T pNbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn23si7061129ejb.111.2020.05.04.08.42.57; Mon, 04 May 2020 08:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728582AbgEDPl0 (ORCPT + 99 others); Mon, 4 May 2020 11:41:26 -0400 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:58262 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727929AbgEDPlZ (ORCPT ); Mon, 4 May 2020 11:41:25 -0400 Received: from legolas.fritz.box (unknown [87.147.56.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id EA08E580065; Mon, 4 May 2020 17:41:23 +0200 (CEST) From: Markus Theil To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org, ath10k@lists.infradead.org, ath11k@lists.infradead.org, Markus Theil Subject: [PATCH 1/2] ath10k: use cumulative survey statistics Date: Mon, 4 May 2020 17:41:21 +0200 Message-Id: <20200504154122.91862-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org ath10k currently reports survey results for the last interval between each invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this can lead to unexpectedly small results, e.g. when hostapd uses survey data and iw survey dump is invoked in parallel. Fix this by returning cumulative results, that don't depend on the last invocation. Other drivers, e.g. ath9k or mt76 also use this behavior. Signed-off-by: Markus Theil --- drivers/net/wireless/ath/ath10k/wmi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index a81a1ab2de19..451c8275d07b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -5802,16 +5802,16 @@ static int ath10k_wmi_event_pdev_bss_chan_info(struct ath10k *ar, survey = &ar->survey[idx]; - survey->noise = noise_floor; - survey->time = div_u64(total, cc_freq_hz); - survey->time_busy = div_u64(busy, cc_freq_hz); - survey->time_rx = div_u64(rx_bss, cc_freq_hz); - survey->time_tx = div_u64(tx, cc_freq_hz); - survey->filled |= (SURVEY_INFO_NOISE_DBM | - SURVEY_INFO_TIME | - SURVEY_INFO_TIME_BUSY | - SURVEY_INFO_TIME_RX | - SURVEY_INFO_TIME_TX); + survey->noise = noise_floor; + survey->time += div_u64(total, cc_freq_hz); + survey->time_busy += div_u64(busy, cc_freq_hz); + survey->time_rx += div_u64(rx_bss, cc_freq_hz); + survey->time_tx += div_u64(tx, cc_freq_hz); + survey->filled |= (SURVEY_INFO_NOISE_DBM | + SURVEY_INFO_TIME | + SURVEY_INFO_TIME_BUSY | + SURVEY_INFO_TIME_RX | + SURVEY_INFO_TIME_TX); exit: spin_unlock_bh(&ar->data_lock); complete(&ar->bss_survey_done); -- 2.26.2