diff mbox series

[15/15] mt76: mt7915: poll mib counters every 200ms

Message ID 20210811214439.17458-16-greearb@candelatech.com
State New
Headers show
Series [01/15] mt76: mt7915: add comments about rx descriptor parsing | expand

Commit Message

Ben Greear Aug. 11, 2021, 9:44 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Instead of every 500ms, this will do better job of catching wraps
of 16-bit pkt counters.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

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);