Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4468029ybz; Tue, 28 Apr 2020 11:48:11 -0700 (PDT) X-Google-Smtp-Source: APiQypIEb6zxUsnEAawmX8rzLFfdSNj9fKmiaWdV/QSJptinBfcW0vKYEzYS5Ubmfk/786R1tdyU X-Received: by 2002:aa7:d783:: with SMTP id s3mr24474747edq.64.1588099691816; Tue, 28 Apr 2020 11:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588099691; cv=none; d=google.com; s=arc-20160816; b=vO2uCUYlogYfyMfZKxialQT369iRzVZ3iyWnbxp46xs4T5FI6cgkwaNOdb2OMtpEbc o6vdlGvbcDZHEGyjp1nObVc11ydqD6zQreJfPwmuy+XeL5mWpN+KihkZExYJAHNUSJqz U8JTFYhybv4BcOL/EImSbc2P+YgfIDkFEwEW1duOx21VJZ9JbKYkFzTBBHv2Pgif0lk3 z4n76QPZn+doEUTmGaVqAt6BhI9sI/p2UcqYsvMmhI2uN+qQ0FCq7HlSynJM69A/ikWf hXF2hp26ZIyvBbXShZxWLaZ3NvEU9PhUWI+et8nLuc8oBUQZvitaRhlgfXydf+koctu1 GvCw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LZw66SCrx60LC3CYo3oQ3bFVaSbcE39Ydva8iaj2hLM=; b=a1tPvFaRk4FkeuxPHeNfJNpPnlFAtgIo7D8oM5zNmIYPGtazXNWw2jiAbHXQuvnsil vQzxwFh8+BTs4OLn64ZNPClSomU7bc9UEpDAhGn3Bds502suIyUavkQdlh3g7NeP1aAB EAMohHkA3I7NZH/rOq17OiuwYTNPGqxWrKn5AFTZm92i9bhGPl0gLbWNQhzBZVgF48Oj 0YVddjRtzjSbmbFSPt1vuw02x0b0r0l/PS7580oyVUAAwpRWQtc6sI9iHLIIcws49Jr7 IF8hCUNC/Yxsg9h27p2r7sWNzSerp4FbMqM03lPxVpnzd/0++UFl3sCQNtvLfn4AF7kU BUwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eSJ7XJX0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl13si2397554ejb.43.2020.04.28.11.47.48; Tue, 28 Apr 2020 11:48:11 -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=eSJ7XJX0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731195AbgD1SnL (ORCPT + 99 others); Tue, 28 Apr 2020 14:43:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:35414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729890AbgD1SnI (ORCPT ); Tue, 28 Apr 2020 14:43:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0F28720730; Tue, 28 Apr 2020 18:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099388; bh=cT5SIXL+iVDu/hb72oYjuRoUfLvME/5P/O+c1CUUBH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eSJ7XJX0yxoFSdOIfgOhTsgCjYKeRQFG3w+fa/fiNE02XclcE6vdDjzdY4T9q/QI+ a6JbD+X1u02ig8DKQHZ0F+0hNbZtLRJMAAUqp/jEi58/LYjUef0mR8JLgH/j3dvI4X 8wX3INqmZm4NbaMezBcgYth0r+wmKMQCa56LE+Zg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mordechay Goodstein , Luca Coelho , Kalle Valo Subject: [PATCH 5.4 129/168] iwlwifi: mvm: beacon statistics shouldnt go backwards Date: Tue, 28 Apr 2020 20:25:03 +0200 Message-Id: <20200428182248.453105003@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182231.704304409@linuxfoundation.org> References: <20200428182231.704304409@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mordechay Goodstein commit 290d5e4951832e39d10f4184610dbf09038f8483 upstream. We reset statistics also in case that we didn't reassoc so in this cases keep last beacon counter. Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20200417100405.1f9142751fbc.Ifbfd0f928a0a761110b8f4f2ca5483a61fb21131@changeid Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -8,7 +8,7 @@ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -31,7 +31,7 @@ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -566,6 +566,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm * struct iwl_mvm_stat_data { struct iwl_mvm *mvm; + __le32 flags; __le32 mac_id; u8 beacon_filter_average_energy; void *general; @@ -606,6 +607,13 @@ static void iwl_mvm_stat_iterator(void * -general->beacon_average_energy[vif_id]; } + /* make sure that beacon statistics don't go backwards with TCM + * request to clear statistics + */ + if (le32_to_cpu(data->flags) & IWL_STATISTICS_REPLY_FLG_CLEAR) + mvmvif->beacon_stats.accu_num_beacons += + mvmvif->beacon_stats.num_beacons; + if (mvmvif->id != id) return; @@ -763,6 +771,7 @@ void iwl_mvm_handle_rx_statistics(struct flags = stats->flag; } + data.flags = flags; iwl_mvm_rx_stats_check_trigger(mvm, pkt);