Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2325044ybi; Thu, 4 Jul 2019 08:54:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBx/fZpuh6htcI//IsCBDxe2e1akrSH6bVYSPaP109gy/tio31AUTezCKYFhOpBCZrIb+e X-Received: by 2002:a17:902:9346:: with SMTP id g6mr6058041plp.61.1562255651580; Thu, 04 Jul 2019 08:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562255651; cv=none; d=google.com; s=arc-20160816; b=o2pAFOMH0YgqT/zEgQKZJel/5i0RERqgq4WpeO0I0+21O7EWUiJEzsqhmYWYBd9q55 qMnGWQM5M+qLM+jpI7HnBZRm+LyiIoEMhZE4Uh+UmRepqu9bMdvVOS5goUsmY5ZGZpWC UHqfrpDNRGo/Ksm/rLv3+Azx70hBOozx/04NmoOCKCdE+rLv1lXSbRFHX1BptNfBqDQU Jpoh62++wFDSubOYLIBUTpaRcnSY77UzFnLFWJrps5C7zlrHCPQ5Ualv6+wmwyED864L JwfSeaYX4z2c4Id0M/jtb/CANMa1ATxI5yXYnuXpPFDYjFh4zaxnI6uq900d0tHzr2KI z84w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature; bh=4YLVhgwT8S8gqJ2TZbogUgOznElffznmymz/GCnelgo=; b=D5HkYeFasWJNQ/24L15aZVNDMI988CCpRmKKYu3N0TT4ADn+wAy5Wbg8BFXfiM+Ykl eVEyRihd6FMCvB23yv1DdXqwZwnM4qM5aa6/DhcNhGttNZsOY6kMTT+K5AeNgaWmt9mR HAQnA3I4qwnlCV3S61/inWzV6bQ1RriaX8IHJxbWpRvx/HmmgcqNc+01xcHrVwOWiXc/ jj6py2YJXeMdv8dFMdWiCHy6OLn4BWFdbIv4v55wLU49/G9wIaXO/y1JLX/4ZDkADQQr C5lddDL9kukn2gBi1FFC/A0ABReIUCZN3ArOEAr7XhgZrS9hnvGXYj2EFp1tvD2YNK/t xLUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=SKSBgrD4; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si6016870pgo.310.2019.07.04.08.53.44; Thu, 04 Jul 2019 08:54:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=SKSBgrD4; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727887AbfGDPx0 (ORCPT + 99 others); Thu, 4 Jul 2019 11:53:26 -0400 Received: from nbd.name ([46.4.11.11]:38246 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727815AbfGDPx0 (ORCPT ); Thu, 4 Jul 2019 11:53:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4YLVhgwT8S8gqJ2TZbogUgOznElffznmymz/GCnelgo=; b=SKSBgrD4S2IEy654ivYOEu4MZD 8WWxgF7ty8s+BsG75tMv+MiX26uoGhxzglMzYxcqMa1GkPGlV8GKXXXjJHogcAwfvTACPctJVgr2g UH/Lqd4jnWRMzqgyri6g4FvjSFNiNYb1ogvIxRYGCREZ7zmu63fas1jxXMAMLwOo1MUg=; Received: from p54ae9425.dip0.t-ipconnect.de ([84.174.148.37] helo=maeck-3.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hj432-0004qT-Uk for linux-wireless@vger.kernel.org; Thu, 04 Jul 2019 17:53:25 +0200 Received: by maeck-3.local (Postfix, from userid 501) id 5CDF06165C10; Thu, 4 Jul 2019 17:53:24 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 3/4] mt76: mt7615: reset rate index/counters on rate table update Date: Thu, 4 Jul 2019 17:53:23 +0200 Message-Id: <20190704155324.56693-3-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190704155324.56693-1-nbd@nbd.name> References: <20190704155324.56693-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org These values must be initialized to zero, otherwise the hardware could reuse previous values, especially the rate index Reviewed-by: Ryder Lee Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 5 ++++- drivers/net/wireless/mediatek/mt76/mt7615/regs.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 49c14eb008d7..b896d8ce9e72 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -501,7 +501,10 @@ void mt7615_mac_set_rates(struct mt7615_dev *dev, struct mt7615_sta *sta, w27 |= FIELD_PREP(MT_WTBL_W27_CC_BW_SEL, bw); w5 = mt76_rr(dev, addr + 5 * 4); - w5 &= ~(MT_WTBL_W5_BW_CAP | MT_WTBL_W5_CHANGE_BW_RATE); + w5 &= ~(MT_WTBL_W5_BW_CAP | MT_WTBL_W5_CHANGE_BW_RATE | + MT_WTBL_W5_MPDU_OK_COUNT | + MT_WTBL_W5_MPDU_FAIL_COUNT | + MT_WTBL_W5_RATE_IDX); w5 |= FIELD_PREP(MT_WTBL_W5_BW_CAP, bw) | FIELD_PREP(MT_WTBL_W5_CHANGE_BW_RATE, bw_idx ? bw_idx - 1 : 7); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h index 70e5ace33cc3..ea40581dc870 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h @@ -181,6 +181,10 @@ #define MT_WTBL_W5_SHORT_GI_80 BIT(10) #define MT_WTBL_W5_SHORT_GI_160 BIT(11) #define MT_WTBL_W5_BW_CAP GENMASK(13, 12) +#define MT_WTBL_W5_MPDU_FAIL_COUNT GENMASK(25, 23) +#define MT_WTBL_W5_MPDU_OK_COUNT GENMASK(28, 26) +#define MT_WTBL_W5_RATE_IDX GENMASK(31, 29) + #define MT_WTBL_W27_CC_BW_SEL GENMASK(6, 5) #define MT_EFUSE_BASE 0x81070000 -- 2.17.0