Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3632370ybv; Tue, 25 Feb 2020 04:44:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzKmo4Kikq8aBuD5f32SyukHn/LYxr80GNf8HtiA0+IozXz5mFIiYdyppreOUHUOqtLFkoM X-Received: by 2002:a05:6808:a8e:: with SMTP id q14mr3214017oij.173.1582634640782; Tue, 25 Feb 2020 04:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582634640; cv=none; d=google.com; s=arc-20160816; b=oU2pn86Qmd9jyiOaUHb0/YaZaGhDXIs4lApVQ1sBtlC8oDhcwQ6zRlHGnJdn7/rofc DwRnl/IXS3nKlDVt9JZdvmUioJGgcvKT+1knHLlZUN/yUd0OKmKECkAjcLmNtB0zeV3E lanN6an7XXlM8kfe4wEDOuBF5J5Z5NeVHWO4/2oZyBrQVtH0Vnjt+UlLmOCr0rG0qdmK HX25ZNYmpVnE6XtFIAI5MbWeo0pyckg1ohysibY+7IZtk5itnMY9/3LK6CuAyOWCeK35 4H9QWkX3L7OC3f/FxGpG3vF/mXUHqBvTWztv+w832q/LQglxdBIlpjMaS16ao/Ca2NoU lZEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=u4m8Xfv6OFxYgqJTd80I7Cl5L/XD4jwAZRRZRhkeGj0=; b=vgYCHIzn652uwlztzqEb7qTGlY098YPvmD36/HpIgjD1rVqW2yrvlihcfZ6RKKIIGL ZeXhnU85Dzqp6+qBT/b1NZfJg/txN42/U+s8qlVtGKm2IjS2yfO41dlwef7HCsl0nI5H /6sEKqi7htsNHu93oObeJunSB+BuiaZo8gGQsQ4fwgzN+CqJDdOICVp3VHnCX5xz0/8a JmHA043SS0HtBIf6AGhJRMCguYE+xClLN6+GZXuvX+Q8DIIBvyZkjbmzKoGtqre0KGgj zfgCwXrtDvIYB7ewGSM0rKaZlVRuBoOB5+PIAoCm/omTBqZoMk9DvlKNRjRNjVxv3b4K tn2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=tJQpPFct; 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 a7si7476085otp.11.2020.02.25.04.43.42; Tue, 25 Feb 2020 04:44:00 -0800 (PST) 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=tJQpPFct; 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 S1729939AbgBYM2v (ORCPT + 99 others); Tue, 25 Feb 2020 07:28:51 -0500 Received: from nbd.name ([46.4.11.11]:53756 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729922AbgBYM2v (ORCPT ); Tue, 25 Feb 2020 07:28:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: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=u4m8Xfv6OFxYgqJTd80I7Cl5L/XD4jwAZRRZRhkeGj0=; b=tJQpPFctn+V82Q0cQC7jCQZppv S0anKmFT1YevBav8lMlGeV8nljNIhTxzbgjMkXEAFYF3312AHMiXXx4ZdfbSWOEfkkYaH7O2wWqb5 DpvRGVU2XpUA+w6ktpm2mZaVkpB/aIJ6R+CqpYBGis1Q5y8Rx4Lt/uSReGxlterQ2Dgw=; Received: from [80.255.7.116] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j6ZKS-0006CM-Vp for linux-wireless@vger.kernel.org; Tue, 25 Feb 2020 13:28:49 +0100 Received: by maeck.local (Postfix, from userid 501) id EAF567E3F8B7; Tue, 25 Feb 2020 13:28:47 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 2/3] mt76: mt7603: add upper limit for dynamic sensitivity minimum receive power Date: Tue, 25 Feb 2020 13:28:46 +0100 Message-Id: <20200225122847.40846-2-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200225122847.40846-1-nbd@nbd.name> References: <20200225122847.40846-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If the minimum power is raised too much, it can make it impossible for weaker clients to connect, and there are some scenarios where the false detects will not go down no matter how much the sensitivity is adjusted. Fixes connectivity issues in some rare cases Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7603/init.c | 1 + drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c index 47c85a9fac28..a84e801d4cf0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c @@ -121,4 +121,6 @@ void mt7603_init_debugfs(struct mt7603_dev *dev) mt7603_reset_read); debugfs_create_devm_seqfile(dev->mt76.dev, "radio", dir, mt7603_radio_read); + debugfs_create_u8("sensitivity_limit", 0600, dir, + &dev->sensitivity_limit); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c index 9e40e81bcc29..97ba5ddc44bb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c @@ -540,6 +540,7 @@ int mt7603_register_device(struct mt7603_dev *dev) dev->mphy.antenna_mask = 1; dev->slottime = 9; + dev->sensitivity_limit = 28; ret = mt7603_init_hardware(dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index 8f5ca9283f7d..a3daae41f2f4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1750,7 +1750,8 @@ mt7603_false_cca_check(struct mt7603_dev *dev) min_signal -= 15; false_cca = dev->false_cca_ofdm + dev->false_cca_cck; - if (false_cca > 600) { + if (false_cca > 600 && + dev->sensitivity < -100 + dev->sensitivity_limit) { if (!dev->sensitivity) dev->sensitivity = -92; else diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h index ef374641fe80..831a269472b3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h @@ -143,6 +143,7 @@ struct mt7603_dev { u8 ed_strong_signal; s8 sensitivity; + u8 sensitivity_limit; u8 beacon_check; u8 tx_hang_check; -- 2.24.0