Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp45311pxu; Tue, 5 Jan 2021 04:54:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzusuZEkwQ2QLjMAsoMicyNkk8YGuJPnaAE0YNA32Ukju3hPN39utOmLU7THJ8NSl3xRtDm X-Received: by 2002:a50:d646:: with SMTP id c6mr75003887edj.177.1609851270492; Tue, 05 Jan 2021 04:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609851270; cv=none; d=google.com; s=arc-20160816; b=o+rR4KfCrZaNPVagipeY69VPvqXDdSgg81ET+XCXE4MCke/SJB39CouVMl/3xOI7r0 gXiw22E6u5FgnAn+snFDMw3HgxhfXidYSApsK1nVbsa71S4TwZlqL7M5+87SH2F18mD4 UfGNAS7wenMlERRbJnSEOEGsZWQNGPLEhuJFrvK8x9SQPv5aJ+/bFTBpe0fCvnZ9vlMu JKvVEq+TtGnuFssh7wvmuo7AgdNbMlm7U5+aryiDUTdzoimeB97koMTeixMxrPE5FHVh 53mTSi5KiNglHJx34Zdct76Qc88DGpcfwwVdgzfEE3ukqBqwrdtoCUXpMdDfMJeRUZXT /pYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kjvThu8sp0sujC1QmdjlyJJeTERe7TJHxec4TFt18lI=; b=YYmqvGJNW8/u2TpgFrmsEm4IVFxDEQWMF8WvHtoe3aROirJdVJkt/GmVSVTtr3uOlh scp/9CvZ7ZhxIt3LheSwvepDi7RrpQ/g4OSe7Fdi/yD/tet+L7mBQxuIy8dTFkWAOqgg TfHv00wygYbr/9osgPTT0IFq2+a5AGixIEKZQT86SduiJJ2wN8XoCKchnt3P8mkaPuFc qnpnwYgipazDUpQV3crvUiLjaZpLuQ4LaanDpD7aHyCjH/a2Rmn2e7X+VDLTZfagLet5 MnaAyCLbjIdH3OlEHT1CiX76Afh/CSARk+xPAVP9yfXPs1Ez43Pq2ik/oINuqHB4uNqB GatA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si33895431edj.409.2021.01.05.04.54.08; Tue, 05 Jan 2021 04:54:30 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726097AbhAELbs (ORCPT + 99 others); Tue, 5 Jan 2021 06:31:48 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:48070 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbhAELbs (ORCPT ); Tue, 5 Jan 2021 06:31:48 -0500 X-UUID: d8253c123a34410a888c57090733751c-20210105 X-UUID: d8253c123a34410a888c57090733751c-20210105 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 548956862; Tue, 05 Jan 2021 19:31:00 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 Jan 2021 19:30:59 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 5 Jan 2021 19:30:59 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 4/4] mt76: mt7615: mt7915: disable txpower sku when testmode enabled Date: Tue, 5 Jan 2021 19:30:45 +0800 Message-ID: <20210105113045.17815-4-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210105113045.17815-1-shayne.chen@mediatek.com> References: <20210105113045.17815-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When testmode can be enabled, the start() callback would already be called, causing that txpower sku feature isn't really disabled after testmode is enabled. This patch fix the issue. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/testmode.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 3fc48aaa3b36..18e6c5aac786 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -321,7 +321,7 @@ int mt7615_set_channel(struct mt7615_phy *phy) mt7615_mac_set_timing(phy); ret = mt7615_dfs_init_radar_detector(phy); mt7615_mac_cca_stats_reset(phy); - mt7615_mcu_set_sku_en(phy, !mt76_testmode_enabled(phy->mt76)); + mt7615_mcu_set_sku_en(phy, true); mt7615_mac_reset_counters(dev); phy->noise = 0; diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7615/testmode.c index b82915445d0d..6c602b086a49 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/testmode.c @@ -138,6 +138,8 @@ mt7615_tm_init(struct mt7615_phy *phy) if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) return; + mt7615_mcu_set_sku_en(phy, phy->mt76->test.state == MT76_TM_STATE_OFF); + mutex_unlock(&dev->mt76.mutex); mt7615_set_channel(phy); mt7615_ops.configure_filter(phy->mt76->hw, 0, &total_flags, 0); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 3e0458fee937..d8f7e8b7bbb1 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -44,7 +44,7 @@ static int mt7915_start(struct ieee80211_hw *hw) mt7915_mac_enable_nf(dev, 1); } - mt7915_mcu_set_sku_en(phy, !mt76_testmode_enabled(phy->mt76)); + mt7915_mcu_set_sku_en(phy, true); mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD_SET_RX_PATH); set_bit(MT76_STATE_RUNNING, &phy->mt76->state); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c index 68b170308c4a..da9ec7930cef 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c @@ -402,6 +402,8 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en) if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) return; + mt7915_mcu_set_sku_en(phy, !en); + mt7915_tm_mode_ctrl(dev, en); mt7915_tm_reg_backup_restore(phy); mt7915_tm_set_trx(phy, TM_MAC_TXRX, !en); -- 2.29.2