Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1398113rwb; Wed, 26 Jul 2023 11:51:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDjV5i6CAzKadqKyhPKmzca6s/sdRTkVCaI6lgGSNmM31E91NiX5SnhMJFjpPsxlWslyJT X-Received: by 2002:a05:6a20:3a85:b0:12f:a373:ba95 with SMTP id d5-20020a056a203a8500b0012fa373ba95mr2138613pzh.19.1690397495539; Wed, 26 Jul 2023 11:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690397495; cv=none; d=google.com; s=arc-20160816; b=Os9lom48BGpQ++vbkHGIjLNcxUGXD/BDhc1q5LcJiBGue1E2cAmD9/mA/ktuHALV6v YLj/Q0pi8IAao85rLGQy7Sh8G7145YNNt/scAOCx+fu873CVgjhWeAaFk4L3zL6aBe98 9bQ+jQl0F8uBc2moDqDVqTNcFk6YlrHhb33FrTR+LXrAeIlTMrjHiiWDdArfSmjnFscW zMUzGV0+GB84md/d0LkTCLCVf0btxwhzPQ39Qs3o/7ScPJcvVw2rI1Xy6vFmVU7iPknE eFaafDnGWLPmlpAfgDONUwge4kXwX1+JimAxx90lveXaQDs0YChBYNnTnL1bNkSgMpkX 1vQQ== 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:dkim-signature; bh=dO+r8hlmOrg2/rtj38EIr873Odkj7bMG57ndJFMX2oU=; fh=7DHE/kVEvyxVaxnjrdFTNM3Sd7eTVW12uvq9FJjQG5w=; b=LYH/Z0m2tFD3N5E8Db+CcZN2IgZ0WALUXqw/f7LKDpSqVaoJpjWf48TVxJDyAR2G5+ /mqdE0vemGpFrGkhDULtjIy9MdobwCFRuYOyeAHZc4jAd9Ujo9obJFLjygEUKEL2gWrI 3WTtXOs7x9Z8WxBwl+PLHUDMZJr3VQu0uwsthNMnkDvDHpIIItoeusc1JYH9+AZOkzBj x7R6Y+yr++oAXCO59v81aaST3h84RrIja0xoM/ReR3v8AuHJLtHL6nI0JaJGNNbRrH9o sMJteqgm8lk5UwupMI3W2Wr6E4oV5IdUj33BP7v5JhKX3fgOsLkcGZG70s1soXuI2v5r E1QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rXCK0NJr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v24-20020a63f218000000b0055c786fbccesi13298297pgh.157.2023.07.26.11.51.27; Wed, 26 Jul 2023 11:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rXCK0NJr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231986AbjGZSf0 (ORCPT + 58 others); Wed, 26 Jul 2023 14:35:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjGZSfY (ORCPT ); Wed, 26 Jul 2023 14:35:24 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F6526AE for ; Wed, 26 Jul 2023 11:35:16 -0700 (PDT) X-UUID: 26d1fd602be311ee9cb5633481061a41-20230727 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=dO+r8hlmOrg2/rtj38EIr873Odkj7bMG57ndJFMX2oU=; b=rXCK0NJrcLfvb4S10fkSU+qnD8nsSqEMKTnKzFt5xS53EeSZDp0M16pFLn0UOVgzIQewDMyPcb1ZTBRmtdyy68cn82q9Sk8JuQU0zJ/PMMBPEfXG2hPmpb3LUEYGMTyLc0iRtSua1mmkEnFtFTzgvGvF0p686q84VNSuYQ1r8cI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.29,REQID:4beeeacb-3e52-4c20-ac96-ab873c65ac62,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.29,REQID:4beeeacb-3e52-4c20-ac96-ab873c65ac62,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:e7562a7,CLOUDID:671d7d42-d291-4e62-b539-43d7d78362ba,B ulkID:23072702351292FJJ2YI,BulkQuantity:0,Recheck:0,SF:17|19|48|38|29|28,T C:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SDM,TF_CID_SPAM_ASC,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD, TF_CID_SPAM_ULN,TF_CID_SPAM_SNR X-UUID: 26d1fd602be311ee9cb5633481061a41-20230727 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 873096743; Thu, 27 Jul 2023 02:35:10 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 27 Jul 2023 02:35:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 27 Jul 2023 02:35:09 +0800 From: Ryder Lee To: Felix Fietkau , CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , Ryder Lee , Allen Ye Subject: [PATCH 2/2] wifi: mt76: mt7915: fix power-limits while chan_switch Date: Thu, 27 Jul 2023 02:35:06 +0800 Message-ID: <92b3a4989462b0270dd52ce739cff6aaced21c7e.1690396305.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <6fa87074b9cce5037af35d870d8670bb29481a53.1690396305.git.ryder.lee@mediatek.com> References: <6fa87074b9cce5037af35d870d8670bb29481a53.1690396305.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If user changes the channel without completely disabling the interface the txpower_sku values reported track the old channel the device was operating on. If user bounces the interface the correct power tables are applied. mt7915_sku_group_len array gets updated before the channel switch happens so it uses data from the old channel. Fixes: ecb187a74e18 ("mt76: mt7915: rework the flow of txpower setting") Fixes: f1d962369d56 ("mt76: mt7915: implement HE per-rate tx power support") Reported-By: Chad Monroe Tested-by: Chad Monroe Signed-off-by: Allen Ye Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index db3fc74f0f49..f8d6323bd42d 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -470,7 +470,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed) ieee80211_wake_queues(hw); } - if (changed & IEEE80211_CONF_CHANGE_POWER) { + if (changed & (IEEE80211_CONF_CHANGE_POWER | + IEEE80211_CONF_CHANGE_CHANNEL)) { ret = mt7915_mcu_set_txpower_sku(phy); if (ret) return ret; -- 2.18.0