Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1844702rwi; Tue, 11 Oct 2022 00:49:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BORNMF60fwcmvk8IFQK3P4nHNINs5Mm7jzJ5QTheVowB9hdmII7l8q1qdssq6ms5cqx5r X-Received: by 2002:a05:6402:847:b0:453:944a:ba8e with SMTP id b7-20020a056402084700b00453944aba8emr21461072edz.326.1665474581921; Tue, 11 Oct 2022 00:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665474581; cv=none; d=google.com; s=arc-20160816; b=rd5SVqchAyyN40kn9WXK9Z63sD8xdEhgWGwUcIJ6VjFXNQudkVXvrD8N1gf/hpnf03 SKwoc9woIxxoC+KDfc9JPt8D+D1CuyEZnGHQFiD4OtCEWp2fBUxlnIXnB8hGlrPXBVzH A8j2Y/GGhCfWhrWgSesNw1/hiGil/W/V9THWyo7LbpH1J2t+/QVEhsLCTSs8EXl1U9eC 5CKVcawHOniSw2fYg1/cEfenYfUFKDnc7LlVtFLckloBap1A0tLepyXZ4Diuh+15P4G3 AT/i26MQ442WIozpD8xl7bLS7/NCINAK7x6dxtITOX8rCTxXapO4hhvPFCTFvFrjxmK5 Uvcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tB7wc/lANnBH8WfIu5nhkBF/YTZweySvyqAxfObUao0=; b=AfLbC3VMKlmXNtgZBseZiLc3Tdp3u5lFmHA+sug8UNjOrTWOBXY5v1dqiVAgfs9Zj7 xtwpFKziPQZwb1cUxWkkGCxxlTE9dR5SVX82WIZBeIvTqGJ4wrFDERK5o3uRVP1MLx8b zFuV2UL4i9D4dnx3q56WXhm15VkL7Rx87kRKlHpYD8UiE2sglcxk/SuXSUq4kLpieXSf tCO7J5MHxe3huxtqwQQoDD1C40ryqXZlM2BDgTNugfQ+7cpHqYLH/DjvR+6vGE3+ZOTv IMvn3MgcpN+yP1ZwYsGayByPzx9tsYjdygFapF3PsVXFiMczFyTU9N96tD7TLHR/kGFw 3cdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nURWmBIw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a05640242ce00b004595a90c510si17166494edc.3.2022.10.11.00.49.25; Tue, 11 Oct 2022 00:49:41 -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=@kernel.org header.s=k20201202 header.b=nURWmBIw; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbiJKHfr (ORCPT + 61 others); Tue, 11 Oct 2022 03:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJKHfn (ORCPT ); Tue, 11 Oct 2022 03:35:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F06220C4 for ; Tue, 11 Oct 2022 00:35:41 -0700 (PDT) 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 26106B810B2 for ; Tue, 11 Oct 2022 07:35:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E17AC433D6; Tue, 11 Oct 2022 07:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665473738; bh=61stQUncIy2Z/Nuy/+OMABu7UzdyW4hgl587LgJfF+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nURWmBIwOzR5m71vyVJwzAHaTirrermB4ZTcQENZvRYidsbPjuQfMau4VpXQC5F3Y mvES2wVRwdp5sZWEOfFb4p+ojoCRPPbKMLG8WLa5mOTJsifU2BqjXogAXXMBIKFoIu PpHlnX3XygWYI8qogUi4m8PHSH82DGy6LI7HU7/LqFbepgIOioSpmgKwh2/E7+29rf xSokH28P53ENEHdc5CQdVdnt0wcHIuCSoNFaN9HDiw3YBiSpk5ZYHbhto5372+RVDB oOTSzv+9Rnte6tZzBxfMK3h4OmokiWCrgeaDoQfgVaa5xzpM3EsyIaflPuuHmlM9Co 8kR9M0xainekw== Date: Tue, 11 Oct 2022 09:35:35 +0200 From: Lorenzo Bianconi To: Ryder Lee Cc: Felix Fietkau , linux-wireless@vger.kernel.org, Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , linux-mediatek@lists.infradead.org Subject: Re: [PATCH] wifi: mt76: mt7915: prevent unexpected nss setting from eeprom Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cDg6v/7QPvTVC2k7" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 --cDg6v/7QPvTVC2k7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Add a check to prevent unexpected nss configuration from eeprom. I am wondering why we need to add a check for this particular field. Is it a well-known problem? Regards, Lorenzo >=20 > Fixes: 4d8053df67c5 ("wifi: mt76: mt7915: rework eeprom tx paths and stre= ams init") > Signed-off-by: Ryder Lee > --- > drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers= /net/wireless/mediatek/mt76/mt7915/eeprom.c > index e2482c65d639..6c5155223087 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > @@ -191,7 +191,6 @@ void mt7915_eeprom_parse_hw_cap(struct mt7915_dev *de= v, > path =3D 4; > =20 > /* read tx/rx stream */ > - nss =3D path; > if (dev->dbdc_support) { > if (is_mt7915(&dev->mt76)) { > nss =3D FIELD_GET(MT_EE_WIFI_CONF3_TX_PATH_B0, > @@ -206,6 +205,11 @@ void mt7915_eeprom_parse_hw_cap(struct mt7915_dev *d= ev, > =20 > if (!is_mt7986(&dev->mt76)) > nss_max =3D 2; > + > + if (!nss) > + nss =3D nss_max; > + } else { > + nss =3D path; > } > =20 > nss =3D min_t(u8, min_t(u8, nss_max, nss), path); > --=20 > 2.36.1 >=20 --cDg6v/7QPvTVC2k7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY0UcxgAKCRA6cBh0uS2t rOPdAQCKrWYAct/uSUQzcbTdRqLtPFS6mew43S2Gq0GX5hn+bwEA1rgunDydicfs G582C7THc97apLzQ8h7NeUOJoNUheQE= =23rp -----END PGP SIGNATURE----- --cDg6v/7QPvTVC2k7--