From patchwork Thu Nov 10 15:39:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 623660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67D3AC4332F for ; Thu, 10 Nov 2022 15:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbiKJPr2 (ORCPT ); Thu, 10 Nov 2022 10:47:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231668AbiKJPr0 (ORCPT ); Thu, 10 Nov 2022 10:47:26 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF19E3E097 for ; Thu, 10 Nov 2022 07:47:25 -0800 (PST) Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.119]) with ESMTPSA (Nemesis) id 1MzhWp-1pF4A43W5p-00vdVc; Thu, 10 Nov 2022 16:42:01 +0100 From: Nicolas Cavallari To: linux-wireless@vger.kernel.org Cc: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang Subject: [PATCH 1/4] wifi: mt76: mt7915: fix antenna selection with bad eeprom. Date: Thu, 10 Nov 2022 16:39:50 +0100 Message-Id: <20221110153953.22562-2-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221110153953.22562-1-nicolas.cavallari@green-communications.fr> References: <20221110153953.22562-1-nicolas.cavallari@green-communications.fr> MIME-Version: 1.0 X-Provags-ID: V03:K1:an+zU4zPZRczEKtChIwamW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zrdVsSNHuKKQu/Lcho8/0sI7Xp02GjWOADMytCSL+9vcg= Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If the nss value is zero in the eeprom, set it to the max. This eeprom fragment from a mt7915 DBDC shows the problem: 00000190: 24 24 08 00 28 00 00 15 00 00 00 00 00 00 00 00 Fixes: 51a87540232c ("wifi: mt76: mt7915: rework eeprom tx paths and streams init") Signed-off-by: Nicolas Cavallari --- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c index e2482c65d639..83bced0c0785 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c @@ -208,6 +208,8 @@ void mt7915_eeprom_parse_hw_cap(struct mt7915_dev *dev, nss_max = 2; } + if (!nss) + nss = nss_max; nss = min_t(u8, min_t(u8, nss_max, nss), path); mphy->chainmask = BIT(path) - 1;