Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp963456rwd; Sun, 14 May 2023 09:37:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YYSgF9mUvufb5F0C/AsK0cy0G6JSj09Mew6DFhg3CrSdCY2Ksk1tPNAfWK9Wu2aFiLlvP X-Received: by 2002:a17:903:110f:b0:1a2:8c7e:f310 with SMTP id n15-20020a170903110f00b001a28c7ef310mr37982722plh.35.1684082234281; Sun, 14 May 2023 09:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684082234; cv=none; d=google.com; s=arc-20160816; b=LxtrQrRARh0El/kkYY+ukDn8Cu1eHTbf6turrTo64eMaIu7R+weqRbAdNxbp7F7iP3 v1nIdrgCJxxg1QWcZglSiSgyhOZiffHO2B27tuiWy4m4k7V8yDk9z2e6HWRdrLBrW4UF DA7ZZszszfs7757V/wvq7sK8OdOTU5Lq6L6scPZH5/aJtfj0sjqdSSSWDodKaRqTK8e1 YATVmv508utPcGSiW4QAeAdEyWSmh5UCVCPcX1BtBKG7MUoSN0bOuFiEcvEItAyxZUJR 4OIDqH7e5FqHACf0FG3uSPxpUG9o6+O3Pozv3yTPi5ZfrFT7ZJvAH2blaMrLZc3ERL2Z 6h0A== 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; bh=sP1s3TyTNR2xaheXB5ulgxT8TwPE9wVNHMHH4x9e/js=; b=wlC8A6/Jm3zQhNiXf0H49wCS6NK/99j9dOSh0XmXMi0Eciobf8QhWPhhAkOfmnwjiw Fn6AYeQhq5V+DBB+fiEg6u1eLcbD88iTi1kVrooKk3/e4yAbn3Epl9a0xiy16LWQeI/l xWzR8+L46iN5slvH2jqYjfgekhq8pRiug3aY3K1CmySWKbAP6dX8t97Nm7uLQ6znzqvP efNt3tRHiTx3qdCMiiSnxwDXS725c+Y9FhvXZKQj3dvggWS8UgQ96ARjhB9tJ/2P1XvX s4FmuWCNvZYEKxZ4cXUzHSumDMP+GXyYHg4imAzT7HOvIKrBb5I+aWd1hb9J9WWKwA99 uh2g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a170902684f00b001a20c983d21si13760906pln.51.2023.05.14.09.37.01; Sun, 14 May 2023 09:37:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbjENQeZ (ORCPT + 62 others); Sun, 14 May 2023 12:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjENQeY (ORCPT ); Sun, 14 May 2023 12:34:24 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5309A3AA0; Sun, 14 May 2023 09:34:22 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pyEfh-00070J-22; Sun, 14 May 2023 16:34:09 +0000 Date: Sun, 14 May 2023 18:32:15 +0200 From: Daniel Golle To: Simon Horman Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Alexander Couzens , Sujuan Chen , Bo Jiao , Nicolas Cavallari , Howard Hsu , MeiChia Chiu , Peter Chiu , Johannes Berg , Wang Yufen , Lorenz Brun Subject: Re: [PATCH] wifi: mt76: mt7915: add support for MT7981 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Simon, thank you for reviewing! On Sun, May 14, 2023 at 04:53:43PM +0200, Simon Horman wrote: > On Sat, May 13, 2023 at 03:35:51PM +0200, Daniel Golle wrote: > > From: Alexander Couzens > > > > Add support for the MediaTek MT7981 SoC which is similar to the MT7986 > > but with a newer IP cores and only 2x ARM Cortex-A53 instead of 4x. > > Unlike MT7986 the MT7981 can only connect a single wireless frontend, > > usually MT7976 is used for DBDC. > > > > Signed-off-by: Alexander Couzens > > Signed-off-by: Daniel Golle > > ... > > > @@ -489,7 +516,10 @@ static int mt7986_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie) > > rg_xo_01 = 0x1d59080f; > > rg_xo_03 = 0x34c00fe0; > > } else { > > - rg_xo_01 = 0x1959f80f; > > + if (is_mt7981(&dev->mt76)) > > + rg_xo_01 = 0x1959c80f; > > + else if (is_mt7986(&dev->mt76)) > > + rg_xo_01 = 0x1959f80f; > > Hi Daniel, > > rg_xo_01 will be used uninitialised below if we get here > and neither of the conditions above are true. > > Can this occur? No, it cannot occur. Either of is_mt7981() or is_mt7986() will return true, as the driver is bound via one of the two compatibles 'mediatek,mt7986-wmac' or newly added 'mediatek,mt7981-wmac'. Based on that the match_data is either 0x7986 or 0x7981, which is then used as chip_id, which is used by the is_mt7981() and is_mt7986() functions. > > > rg_xo_03 = 0x34d00fe0; > > } > > > > ... >