Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3630631pxb; Mon, 24 Jan 2022 13:57:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsEJbYWkVpcFXDVSLGCQx4MIlcKNyDu8mgC7x04nR96dM2LNSLcC2gDB6imjoYnfCscMUV X-Received: by 2002:a17:902:b949:b0:14a:b3e8:6a25 with SMTP id h9-20020a170902b94900b0014ab3e86a25mr16181716pls.29.1643061478949; Mon, 24 Jan 2022 13:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061478; cv=none; d=google.com; s=arc-20160816; b=y9CJaIfR27HREeGz5zMG7FJJaEUkxY5BJRFQV20Lm+y7FcsZTyViv1g7f4QAQ99C0c eR9WhXsHBRyjTGYMTaPgTdVGULRamcnI0iyhGsq8DKCjdO8TD1CKyaqHTUGtexFhfoMh RUUwv52P44gj7qql0HjkC/ap5IVrMNopaI2s3meMIpFNzURSNfV9vfrwi2byr2Kk04Dh vgsbSh6AldjXTgq7YeCUS0GmvHIN+ad6c/08Ae0YMsw6kFOehYxfXiHGvthJabnHaRSU pPS8lAaIWi6xSfO9cG5WTJR7UuSPsgLDWxHJDvuannZoMZ+LEoDStZoLtRYKdb9vqw61 AIlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=515l+Ng/vccIcHmQzZBqF8MPJlTWrT9rLe1aj8lAaNo=; b=W8zxre9w5HVrST2xqkQBy+JD91JnY02VFgWAy6asI8XZRwluyMUg/E2EWyiwz/+H2f ystk4haozk9JWWq7sAOyjp0RRqRHIgq6AvrdSx34xa9+ppWrlHkQ8pxrmbhWux7xHG1P 9T2lHyUZ+wByaVsF8ongNM0XJdAqlzng0I9+8euHiFLvjnCLXz29Tmaf2j9j76Cclhys hAim8yxguuDQJkpNWI8RGOXCJBagbi1ulsBLzUq1R/XPvfqLs7q5iDWyfS3xmkDYZZua 8VQtMA4jXrhxiWkQQ9FGgxFtv4KJv9MBfWvBKJON6ZwH7dTlDl1INu7mWhjrw2j7at0V J8Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jL0f3rTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si12853160pfa.66.2022.01.24.13.57.46; Mon, 24 Jan 2022 13:57:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jL0f3rTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573601AbiAXVpW (ORCPT + 99 others); Mon, 24 Jan 2022 16:45:22 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:60210 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446607AbiAXVIs (ORCPT ); Mon, 24 Jan 2022 16:08:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B66ADB80CCF; Mon, 24 Jan 2022 21:08:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9A2C340E5; Mon, 24 Jan 2022 21:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058525; bh=AONqG5bMtL6kUVRHWb9GpOeyQRbkloKcPD/OKYlC4ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jL0f3rTxZfy8f3kmECkdglqwRrdQBdN8rD97pUf8mAq48RtIbRxcNMu0bUVOSg0Wo AyxazxgG8y48Sza2X2cAErPiAc6MXmW3ei7K+HdwiQw1v/oNv5gee2CE+ZN4IVrIo8 kr+i80in2bGNCB6ht6vvpiJDCVUd4wAR2Ngbbi40= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.16 0317/1039] mt76: connac: fix last_chan configuration in mt76_connac_mcu_rate_txpower_band Date: Mon, 24 Jan 2022 19:35:06 +0100 Message-Id: <20220124184135.951734676@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit 73c7c0443685d8d152c3451e7305a2c2bc47b32e ] last_ch configuration must not be dependent on the current configured band but it is defined by hw capabilities since the fw always expects the following order: - 2GHz - 5GHz - 6GHz Fixes: 9b2ea8eee42a1 ("mt76: connac: set 6G phymode in single-sku support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 61c4c86e79c88..b15bbd650a90c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -2008,12 +2008,12 @@ mt76_connac_mcu_rate_txpower_band(struct mt76_phy *phy, } batch_size = DIV_ROUND_UP(n_chan, batch_len); - if (!phy->cap.has_5ghz) - last_ch = chan_list_2ghz[n_chan - 1]; - else if (phy->cap.has_6ghz) - last_ch = chan_list_6ghz[n_chan - 1]; + if (phy->cap.has_6ghz) + last_ch = chan_list_6ghz[ARRAY_SIZE(chan_list_6ghz) - 1]; + else if (phy->cap.has_5ghz) + last_ch = chan_list_5ghz[ARRAY_SIZE(chan_list_5ghz) - 1]; else - last_ch = chan_list_5ghz[n_chan - 1]; + last_ch = chan_list_2ghz[ARRAY_SIZE(chan_list_2ghz) - 1]; for (i = 0; i < batch_size; i++) { struct mt76_connac_tx_power_limit_tlv tx_power_tlv = {}; -- 2.34.1