Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6262768rwl; Tue, 4 Apr 2023 09:56:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Ys6KqVERzlMDiVrCs732DKNGnv+2HmFG6fSStaHnCcAzo2/A/fETxQc3jVVb6MN8q/dqMg X-Received: by 2002:a50:ff13:0:b0:502:9289:4728 with SMTP id a19-20020a50ff13000000b0050292894728mr123753edu.28.1680627400031; Tue, 04 Apr 2023 09:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680627400; cv=none; d=google.com; s=arc-20160816; b=NyY+gfD+0ikXWlEp7nKYEatATLlxnfOLCBNsIOTEY+qyvaJkWBK4+NSAx2gytrWI8h r/aTSGXjkxXWq2f7BY/BBCipfSyIJQ5EhHkDYO4jtz+V9le69TWfGPtvzBvt0e6uiDWk mRHPk5CyvFpxXojXzTNfef3ELzf7wa2CazEym0z9goNcB+bEcPTJ7YxMUXyS+z7g5qlZ 9txPYSyIjANmnmhl4wY4iwsJkGCFt3ZnLUijQXYYK0aA5aJkh+kTYcMLxIfoFg+iYvZR P4pikd6WS7lHTJ8VBu8QbyEWA4QIWs0PHhRj+wBm9pxpPQ235pGklE8nTaoKCw1N06kA WpmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=9iMtrK6fAZfZzrbdyofBDo6C2P9YnJ8/Q5xMXgSr0IE=; b=QBMyN+Sf0TtECNaEVp1DSukxnxZmW1XOcLDifCYtgATGn8apnb+bC7NXowT4NJzXGm tUUReLtKHeQ94k2K+wpkMcGTyPwHtSGJIUa3Tynmy9Lv3dA2fcIKIbOZyQcsbJlB4f3+ 0tIkJZwnHK6IR8KXy7ldcK/Tpgl7x3Y28nJ6gwHs088qGhyMbYS6ZECqFTrrhpImZHsL LaUIZz/xe6TB139sGn7sCRZ5PhRvssEP1KOIk/4bu6T7XmcS6oh78O24Os6wogarHMxL LV7GNzSUG4/Jf12j2cythHWNhENLZna+GfvbBdcZnDNurmtzx2TdAiKlUpwe5bDrXMb4 SkRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=bbNimj9z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p22-20020aa7d316000000b005021f0d0ce1si7868798edq.241.2023.04.04.09.56.15; Tue, 04 Apr 2023 09:56:40 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=bbNimj9z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234267AbjDDQzT (ORCPT + 99 others); Tue, 4 Apr 2023 12:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjDDQzQ (ORCPT ); Tue, 4 Apr 2023 12:55:16 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4BC5593 for ; Tue, 4 Apr 2023 09:54:52 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230404165448euoutp02458dd6ec108b0a2e31f046f56cc6912f~SyZ1aPViR0099000990euoutp02D for ; Tue, 4 Apr 2023 16:54:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230404165448euoutp02458dd6ec108b0a2e31f046f56cc6912f~SyZ1aPViR0099000990euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1680627288; bh=9iMtrK6fAZfZzrbdyofBDo6C2P9YnJ8/Q5xMXgSr0IE=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=bbNimj9zsebe7WLvAoeAcalNN/eCswdTY2cQZs2dKIZI8RHhE0roVuCyrtDvPyeyr OxH7HNaIk0wOQEV40q2J7LOO/FJ48C3N0GNEaXhFvfdB7RcXL42fGJlUbzqLdgU9eu +fxvakQ9HTG56+SfZ50COmR3/vi8Zd76Bvt1hKdk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20230404165448eucas1p1080a3deead7dd60858a31b5de3e1ddcf~SyZ09kW9r0653906539eucas1p1X; Tue, 4 Apr 2023 16:54:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2F.02.09503.7565C246; Tue, 4 Apr 2023 17:54:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230404165447eucas1p114076509978a487acfe8312e2e58ecca~SyZ0lHlJv0397903979eucas1p1j; Tue, 4 Apr 2023 16:54:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230404165447eusmtrp1c8b2a2e46e8627a0c524a720e35045ca~SyZ0kS5EI2480424804eusmtrp1h; Tue, 4 Apr 2023 16:54:47 +0000 (GMT) X-AuditID: cbfec7f2-ea5ff7000000251f-ab-642c565720ee Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BD.21.08862.7565C246; Tue, 4 Apr 2023 17:54:47 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230404165446eusmtip1b38a853bf083a308106b4b63a94bb7d2~SyZzdMr450566905669eusmtip1L; Tue, 4 Apr 2023 16:54:46 +0000 (GMT) Message-ID: Date: Tue, 4 Apr 2023 18:54:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [RFC net 1/1] net: stmmac: skip PHY scanning when PHY already attached in DT mode Content-Language: en-US To: Michael Sit Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Ong Boon Leong , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, hkallweit1@gmail.com, andrew@lunn.ch, Martin Blumenstingl Cc: Looi Hong Aun , Voon Weifeng , Lai Peter Jun Ann , Zulkifli Muhammad Husaini , Tan Tee Min , hock.leong.kweh@intel.com From: Marek Szyprowski In-Reply-To: <20230404091442.3540092-1-michael.wei.hong.sit@intel.com> Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SfVDTZRy/5/ey/VgOf0yK57AX22V3YKJcej0dizIFf/2hWb5xeAY79ouZ A7xNCuHMnRCMNV4OW8F4WzgCFLGbOB0oiwWDSeJggG+AYhvgHHFEdSFZMYbFf5/v5/P9fD/f 53sPhQtOc0KpQ6lHWXmqWCbk8AiTba53fdy+1yQbz3oAmnv4NUA3Rqw4cp2v4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HXnZsT1k29Lvio8zCut+2EbuuPbgQBjsz6FD3dN5+tFs/7mjJXLuNfL sd8n5di0BTr8WzYGzswtz5Q4uuXLcoXsxz07515ee+ayf9Q2eY45Hy6EOzi7+b+2cxSf1r/9 1RW/lJV3V8/VCr3Xfzpr4s4Ic2fWINH9KWoifarOV29dnvL5vxJLcUaioRZzUXEiABZe+xLG AwAA X-CMS-MailID: 20230404165447eucas1p114076509978a487acfe8312e2e58ecca X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20230404165447eucas1p114076509978a487acfe8312e2e58ecca X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230404165447eucas1p114076509978a487acfe8312e2e58ecca References: <20230404091442.3540092-1-michael.wei.hong.sit@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Hi, On 04.04.2023 11:14, Michael Sit Wei Hong wrote: > If PHY is successfully attached during phylink_fwnode_phy_connect() > in DT mode. MAC should not need to scan for PHY again. > > Adding a logic to check if ovr_an_inband is set before scanning for > a PHY, since phylink_fwnode_phy_connect() returns 0 when > > phy_fwnode = fwnode_get_phy_node(fwnode); > if (IS_ERR(phy_fwnode)) { > if (pl->cfg_link_an_mode == MLO_AN_PHY) > return -ENODEV; > return 0; > } > > Fixes: fe2cfbc96803 ("net: stmmac: check if MAC needs to attach to a PHY") > Signed-off-by: Michael Sit Wei Hong This fixes broken ethernet observed recently on various Amlogic Meson based boards (like Khadas VIM3 or Odroid-C4). Thanks! Tested-by: Marek Szyprowski > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index d41a5f92aee7..4b8d3d975678 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -1149,7 +1149,7 @@ static int stmmac_init_phy(struct net_device *dev) > /* Some DT bindings do not set-up the PHY handle. Let's try to > * manually parse it > */ > - if (!fwnode || phy_needed || ret) { > + if (!fwnode || (phy_needed && priv->phylink_config.ovr_an_inband) || ret) { > int addr = priv->plat->phy_addr; > struct phy_device *phydev; > Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland