Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp577847rwp; Wed, 12 Jul 2023 19:21:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSNKE5ds+LMySC2R3XwVpuYyWND+FcNcFO/VA74itLyvpC6vPxpFG+UWN9qbGhqU2dGl6i X-Received: by 2002:a17:902:e549:b0:1b8:a8e5:e8bc with SMTP id n9-20020a170902e54900b001b8a8e5e8bcmr494142plf.6.1689214894992; Wed, 12 Jul 2023 19:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689214894; cv=none; d=google.com; s=arc-20160816; b=ezXaH2vzi4Sx+AN5/krXNGrV7/DmmsmJHaD/60pqY/fARDOndigAR7nGco67kKMNMy IOq/9HDcCqgqUQYloti51JJocveUaZBOhyYtHFn+zFK+nIyiPihCblz1tzD4UfieLTU6 71ieQetA4jHaUZSky+sAi5D1HLkVhfRHOGP5iBCyl9996SRViAdBuqNeDg+mHkunXqD3 gtWRIs/tdBM3BYtI2ZWKAhIHs4ogMBA+OyxmXGi3uChbAZmN8rr+OsYHQAB+eoh19sAy 8pO5rrZpkZI7wT9o7lkkw9E5DJIjBA3fsiwFGB2Ns25MNupAcMxAu8Ve8A4gEhQl47nX BRNA== 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:to:from:date; bh=B15sksH76SkHgQdEWVy6xLiMIraCMaM5vx8Ai35ldxY=; fh=9pKblXLHR4b0iqJeNGezDe9eB2gLZXksRAVo2lkFWAw=; b=JjTI5pC0erqAdc4RrNiyel53dBddmb/y6uxhRzNZESZrOwlI8+lQ4OWgxF6JfchfXg 8xO37dJPw74K8iN4/4xs8gmyunwObW7LreUf6BV2hqtr1dDiRpqQCYQeNBT3DKBpsHMI 2EO6Xiy2+klOFdcIPDIke7Sya64YR2DACgyCJGlhF8AvKGTE5fPINEaeipAd/Om1+x4F Sk3bZDw+VpL5jDberKCJl5SzfBiTB1DdDxO4CKPpd92rR+BsXK31GAHCTqe/H27MgzP8 s+cqu+WdiAGON/OAR8vPrHczMh7EYmC7tj8CCzinjtrBT4NZVZp0Dhdxg8K27WUaK3eg J3Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 h5-20020a170902f54500b001b8ac52a19esi4612928plf.436.2023.07.12.19.21.23; Wed, 12 Jul 2023 19:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233506AbjGMCTP (ORCPT + 99 others); Wed, 12 Jul 2023 22:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233497AbjGMCTN (ORCPT ); Wed, 12 Jul 2023 22:19:13 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F89D2120; Wed, 12 Jul 2023 19:19:06 -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 1qJlv6-0005XJ-1Y; Thu, 13 Jul 2023 02:19:05 +0000 Date: Thu, 13 Jul 2023 03:18:52 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , =?iso-8859-1?Q?Bj=F8rn?= Mork , Florian Fainelli , Greg Ungerer Subject: [PATCH v2 net-next 4/9] net: ethernet: mtk_eth_soc: increase MAX_DEVS to 3 Message-ID: <2cc8012ec538106c6bcf22a40b647ec342e687a8.1689012506.git.daniel@makrotopia.org> 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, RCVD_IN_DNSWL_BLOCKED,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-kernel@vger.kernel.org From: Lorenzo Bianconi This is a preliminary patch to add MT7988 SoC support since it runs 3 macs instead of 2. Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Golle --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 +++++- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 7014e0d108b27..7f191e4337dd8 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -4030,8 +4030,12 @@ static void mtk_sgmii_destroy(struct mtk_eth *eth) { int i; - for (i = 0; i < MTK_MAX_DEVS; i++) + for (i = 0; i < MTK_MAX_DEVS; i++) { + if (!eth->sgmii_pcs[i]) + continue; + mtk_pcs_lynxi_destroy(eth->sgmii_pcs[i]); + } } static int mtk_cleanup(struct mtk_eth *eth) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index c74c3918113a5..b18ce4430d437 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -1049,8 +1049,8 @@ struct mtk_soc_data { #define MTK_DMA_MONITOR_TIMEOUT msecs_to_jiffies(1000) -/* currently no SoC has more than 2 macs */ -#define MTK_MAX_DEVS 2 +/* currently no SoC has more than 3 macs */ +#define MTK_MAX_DEVS 3 /* struct mtk_eth - This is the main datasructure for holding the state * of the driver -- 2.41.0