From patchwork Sat Oct 22 07:27:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106278wrr; Sat, 22 Oct 2022 01:37:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4G13oL1SyKNTGOnpkJ2sPBC3L/374Wud7hy6OYxvz2b+9RTFUHzNBbGLkh2cJo2XYdJRxL X-Received: by 2002:a17:907:971e:b0:78d:e7ed:7585 with SMTP id jg30-20020a170907971e00b0078de7ed7585mr18497018ejc.258.1666427844332; Sat, 22 Oct 2022 01:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427844; cv=none; d=google.com; s=arc-20160816; b=S3cwpVmM4t8r1kYS1bxucSxBHgUFJhpJFE9lw3FtF9UmKqDSlKdMDtOJ7RfpDKjIVc vnGOivTakW1IWLywZzLntnwXE2ldyvjekBN+W3e3PchgCMhIUtyLNYBi4wNm8Ta/xd8v UEItj9wHfNfECJnnhcxlc82uOTpg1ABh/gcrUSmVvUzFrWO/F8Yplhi2Bk5/I2njiHOg CMqCcAg1hXuIRrVxlbQy4zsIVdg5BTKh9i1xEwXnHwkqgIJTI0lZf/pqVBCF5qhazYsM LUzDXUKzj4PZbSxkH78xVegblw775I3ART9X1FbwPYzsx6kiGBsyk570aK+2j9oZ/GUC 7JHw== 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=Kq/uWDtcplivhEjxnUibz83T5GU1afLSxHpEe6Nm1+w=; b=A0B9yNX/iQKALUWWsrd6eX21DDf4iXiJHE6gWehlGJ5TkQ+WuM99IMFwMznZZAbNt9 UtzyMdw15epB64iwDCQP3Fr+eAqSFSAjBlUxAlqXeyDtfMRS/Ul7YPlGgzBr91f84K2V fs48UrJy7s6YHYrTuEP0lO2p1S+mPoLrBZhzytsq7P0LWzkYGxGOVSsHAcMEAUVrRqYZ tzDD4JFBg1suH+srQuKA/AZl5j21y2bfJNetRPdVR+1M157+Jr7vwOZJQk4wiKvEaUUV KczVdwgqLip/1wWgmCzPk2K9JEtSOlfN1OrY8KkAP6ZVc62gxUNMOX/+4D8qrFmGLiBV PP2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fZ3hTFOH; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170906441400b0078a00ad1e31si20553319ejo.687.2022.10.22.01.36.55; Sat, 22 Oct 2022 01:37:24 -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=fZ3hTFOH; 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 S233962AbiJVIcb (ORCPT + 99 others); Sat, 22 Oct 2022 04:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234033AbiJVI3Q (ORCPT ); Sat, 22 Oct 2022 04:29:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA192E2B98; Sat, 22 Oct 2022 01:01:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B879960BA2; Sat, 22 Oct 2022 08:01:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B28DEC433D6; Sat, 22 Oct 2022 08:01:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425674; bh=WwmcjNzmw5OLFkIa+ZtNeTsYil3huvRGUhYuS9Nf6HE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fZ3hTFOHeyDGaxxu5ZkG4I3e20FzwQyS9UPuFp4OoqNLfg5d8LA6OsjTpCwpjH1pe YsdBpnRraBORJ/8qbJPqx7hXVRD27yLbCaB7820Eb3kE47b05I/gXMnnPk1lcJFYhs SwuqFOAogElEzE8FgE93V9E+idyVLOauhJUwiU5s= 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 5.19 578/717] wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value Date: Sat, 22 Oct 2022 09:27:37 +0200 Message-Id: <20221022072523.988714336@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376243438779608?= X-GMAIL-MSGID: =?utf-8?q?1747376243438779608?= 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 0316d226e38d..94dd0c1d4cb8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -738,6 +738,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);