Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp68524pxt; Wed, 11 Aug 2021 14:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyupgnuca/YJZfMr7IDV/VR8azDBzs4449K1jLI9xru0XFnz5haLizs3Sy1SCH1dRiiZMIX X-Received: by 2002:a17:907:16a1:: with SMTP id hc33mr590600ejc.536.1628718417181; Wed, 11 Aug 2021 14:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628718417; cv=none; d=google.com; s=arc-20160816; b=TcSme89v27lozbtqeH897oHDkgEQAVwK/hS3wMov7tJyaSPNTxP3PV7YEseEng++Bk RsJTXMxFwEkIL51O2GImWLVs+QYe+uD6s6CkCGjA3x1BkfbPkbRtKrAi2f2SgXNAdjDj nAFQOghBiOy08K/q8XN1OYDzYG5sAT9HPqi/yI0Qcq0q9XnldHu+RAOMTST3UkAaWD1r EuMDWwLtWUtJElcBtyZhS1OnIL42MmeFpsyxPr1ggRlSJ/22JT2Q4xxMFaGIMI5lMz48 7k1BT5WJ07bcScajAyJ3V/zAnTw4Z2t8pnwkPniJxFBxSsw6dTBnDu473RKiRb/V/bv+ dEng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=eh578SVEw0fkOJWmiUXtf5ugv6oi884AwZq3BWt93fE=; b=Yduc8ZFx0Z/kUVBnDBAP3/OxB7Gk1FFs1DzFkrg1VyYj8hz16CruBcCdy51iksM1YS u7Ls7z05HtPELcnLgGWbnIyHJmWBEtakZYfqQbHRCT6rdZqhKc+66dGfrUY2qZ+7z/bD pwBJYX+/si2LizRfAnziWdlpwXOjTf9F3vipHva3iFWUvvnQzkblJ1QqAYZr84v7NVRY obqQJTJR/8roqE9Gr3tPpQgF4H4nqs1oJDXuNiPALTuoRvNAlEJGWMzt6EMUdmAgjLm4 t3jGp3ijgpiuFk2sLbCr+ZwuYR+1vpFczxC3m2utSL4K/mOH4ZbX5qneJUU2Du8Smbq2 /WIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=pmo1z4L1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si556934edt.13.2021.08.11.14.46.31; Wed, 11 Aug 2021 14:46:57 -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; dkim=pass header.i=@candelatech.com header.s=default header.b=pmo1z4L1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232457AbhHKVqK (ORCPT + 99 others); Wed, 11 Aug 2021 17:46:10 -0400 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.49]:41006 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232251AbhHKVpb (ORCPT ); Wed, 11 Aug 2021 17:45:31 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.67.133]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2E5DB2006C for ; Wed, 11 Aug 2021 21:44:53 +0000 (UTC) Received: from mail3.candelatech.com (mail2.candelatech.com [208.74.158.173]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 0D470B0001A for ; Wed, 11 Aug 2021 21:44:53 +0000 (UTC) Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id B71AC13C35A; Wed, 11 Aug 2021 14:44:52 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com B71AC13C35A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1628718292; bh=gUPiTybpfYVVAaa4aO4DhSlMYPp2lnOkKNBbDZU5id4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmo1z4L1/g2sDos3kVaWIjEY4G4JQEHkhSaABvFCBnT3sxHK8+XfiFAa9r3EPoFxW MLO3fqKgbliV0hVvI8Lx0WibI2/O47jb87B305PLhj1sORRJqqC6hEH4Pi2gRVUnph TDnbFeKuxxugDMivTOieOaDPh/n4XUElrx4jWDew= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH 15/15] mt76: mt7915: poll mib counters every 200ms Date: Wed, 11 Aug 2021 14:44:39 -0700 Message-Id: <20210811214439.17458-16-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210811214439.17458-1-greearb@candelatech.com> References: <20210811214439.17458-1-greearb@candelatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MDID: 1628718293-cqEXlPYjl6Td Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Instead of every 500ms, this will do better job of catching wraps of 16-bit pkt counters. Signed-off-by: Ben Greear --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index ba1c71bee149..77d7477f8667 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -2362,7 +2362,11 @@ void mt7915_mac_work(struct work_struct *work) mutex_lock(&mphy->dev->mutex); mt76_update_survey(mphy); - if (++mphy->mac_work_count == 5) { + + /* this method is called about every 100ms. Some pkt counters are 16-bit, + * so poll every 200ms to keep overflows at a minimum. + */ + if (++mphy->mac_work_count == 2) { mphy->mac_work_count = 0; mt7915_mac_update_stats(phy); -- 2.20.1