From mboxrd@z Thu Jan 1 00:00:00 1970 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 731CEC7EE26 for ; Sun, 14 May 2023 16:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232292AbjENQe0 (ORCPT ); Sun, 14 May 2023 12:34:26 -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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; > > } > > > > ... >