Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp936053rwi; Wed, 19 Oct 2022 04:59:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7aGcNazEumcLcjDpkf/jn0/AtD1/e856nff/CVEGDwQPSEeL5sZ68U4E6vmmEMxDxXeaze X-Received: by 2002:a17:907:1c9b:b0:78d:af10:1a80 with SMTP id nb27-20020a1709071c9b00b0078daf101a80mr6355066ejc.582.1666180785597; Wed, 19 Oct 2022 04:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180785; cv=none; d=google.com; s=arc-20160816; b=gD3Hu38hxFAOyICrosr+Fi6av7pdMdplzIJXomsykNkmKkqiNAzEfEjmyHeR8xuqrl Oq872diwGItKcmEXoBlF3R8EcqTlyCfDKC3DPWRPN0o2gmyYlaJzRXj/NTRI620aRAGr RZQf1nlRy77dPkOlUo17NACeVUlq4Yx6USMwed2AfNTVeVM9lMBsxaOLiSPsSDq9VAjd balkqfifYi3PprWquNPBouNRz5FqFkd9JxOwHEB3wUfTByfFt99hJfM49jZ+tDeLIjmT magBtQiHyHThFrxFgO2MyTihIuWWKTxKy5XRy+TKanBAniJK5JOjM9qozWlr/X+tzVkv uIVQ== 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=c3RbG7qa4nQ5MH7NC/284ld2Lhr8MU00QkcaiX4DYxI=; b=okPzjGnGTwAhqEgWYs5MdUXxMmjemdE/62kbSl5hmX0dlffUzEWZBDdqRi77KWB7SX 8xkkxJ8DDijCEECVQ4QQsGTbHmlw2hkNUYz/A3nAhTgbzfs5JHzqwSf5DIPNaJ+Pb46R KgFOYCTgOPoHGxpz32V20dpWOVlDI4ZBDCAViU8y9UqgAKBs3rX7vVyFrh1ZIlVP3WPT V7NAN7E4Lo1FdcuAeGSwJcdtGX8f4xnZ2+gXU7AYGp2w0RuRfzCtD6secgDYO3EW7ofb UcTJeIh2ai9q5I6uzcHmABWoSFDN2qLpq9YTzKk1P8ZdKr+9QGS70RPks9u6U8WY5mln nyjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SHoYWs0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw14-20020a170906478e00b0078e1d1d6005si12028296ejc.23.2022.10.19.04.59.17; Wed, 19 Oct 2022 04:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SHoYWs0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231476AbiJSLJi (ORCPT + 99 others); Wed, 19 Oct 2022 07:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233658AbiJSLIn (ORCPT ); Wed, 19 Oct 2022 07:08:43 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C363317C55F; Wed, 19 Oct 2022 03:37:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 5D6C0CE2199; Wed, 19 Oct 2022 09:09:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 406FAC433D7; Wed, 19 Oct 2022 09:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170574; bh=kYbcxYIw+yCUgffkCbhQJb60wyUnI1h9lAGAtY8xe0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SHoYWs0HspIzeQ0+BWK7DUmvq4U36dXGWnOQeIO2MwSAPGY8xBL1Pem5Lrv0Y9l1U e/fGOgmjSvtMXX4xk4AY2azmuukwaDYGbsZZcn+gNlZony0lBAUdG4wy2S39ugICFK EWpILNQKRVsOgTwEA8H3wC057OxVVMgrijmDQSeQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YN Chen , Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 6.0 705/862] wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value Date: Wed, 19 Oct 2022 10:33:12 +0200 Message-Id: <20221019083321.139598633@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 1bf66dc31032ff5292f4d5b76436653f269fcfbd ] We should reset mstat->airtime_ac along with clear up the entries in the hardware WLAN table for the Rx and Rx accumulative airtime. Otherwsie, the value msta->airtime_ac - [tx, rx]_last may be a negative and that is not the actual airtime the device took in the last run. Reported-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7921/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 7214735011d0..c9e9a533289f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -752,6 +752,7 @@ void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, mt7921_mac_wtbl_update(dev, msta->wcid.idx, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); + memset(msta->airtime_ac, 0, sizeof(msta->airtime_ac)); mt7921_mcu_sta_update(dev, sta, vif, true, MT76_STA_INFO_STATE_ASSOC); -- 2.35.1