Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5705959rwl; Tue, 4 Apr 2023 02:20:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YJVTxgJqpK6r8UMj3X8QPmb47pEggh26oNOi7DqOU/nzFjwAEjC9RcuY3zsgRx12Hc22E7 X-Received: by 2002:a62:5f46:0:b0:62a:1267:2042 with SMTP id t67-20020a625f46000000b0062a12672042mr1545967pfb.2.1680600044178; Tue, 04 Apr 2023 02:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680600044; cv=none; d=google.com; s=arc-20160816; b=kpq/rws0DmatSlWVLazEpD6UpJ2QJjyNBQVmOWwfhHsiYfdoBHNqHnRp7hu9VeN4jN EUynInmIrRtHKMAt8DDOKQ8v1AXnvzhnUcOHkVMO5nrIZLBbQlTM2WQRLx6eAXhZOa7f laHnJCijMc/jGt/lIcMcoEg4jdMe+jSN4VCkCFyoX70UUyXGMdxPSoZF9SaQYTD9SFJk sxOitE6fA3yQ2AI3e98MH+J8ric9/by+hYwEnZYadHux7ZQTk4KGkGdaXnnz8jtPEPxP rTscmCS1WjrngSxh+Cp03rZc5cIc4kBrQnc55JT+pLP8sVPpSJkJb29pTMUYhFEQ8X72 HOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=l/Bz5wQ5kpabrYOyx7ZPRtyWcWgT2YAvaEgAEyYv3Hw=; b=XS2+qxv5bDWOigCtz21yR/pmvAxK+/Z80H8JIsSSB4S2/9K0ifHMKf7mBv4D/WbTqP QOqtLp1ofp+2XXcwjmz8fcaEYsJ+TWVZyKz00n4hV51Q3/gr+pkNg5uSl1U6T3JQRwDX rt6VowxDd4lQHxqqvxuvdfGTZ6yQkx3ekgqFMpLVvij1DC1GXtnVOUJCZXtOcaC0N+Mp YgJ3BQ8bqC09jtDAB+NNfgd4/MY0WF6l7AYsxia8tpkJCwueXH/nFcSpB49exIRSLgaI yG0KCYJL9hHJayW0oUeJYczyq3USuch3o10qSYhxyGrq9YE+us2+xWr4aARme+cx8WS/ pZVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b7yuJDj6; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a63d014000000b005139547be00si9336282pgf.877.2023.04.04.02.20.32; Tue, 04 Apr 2023 02:20:44 -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=@intel.com header.s=Intel header.b=b7yuJDj6; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234042AbjDDJP5 (ORCPT + 99 others); Tue, 4 Apr 2023 05:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbjDDJP4 (ORCPT ); Tue, 4 Apr 2023 05:15:56 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1D41A7; Tue, 4 Apr 2023 02:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680599755; x=1712135755; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=c3TWM/U7ae/+krBKWKZnTGu8xrMC3rbZUK6++vwlxtY=; b=b7yuJDj6TtQ6TcoPe/S0KVJYushwCH4iX8SyI7bepbqf4yQMXCljYqVi qn9Byf2j5hcTEPZG6jCKsJ8YTW3H1NWuPyHoOd0mPdIOMi65jnnbqCApg CkNdt9LQZOhRr8nzqhFYyDf+o+NAH9AOjlPoopH8OkZfwon8tRJVCJfS2 +1631Pydg8DGa9btbzHCTu4A8e47YOYbgH/OCVns2TNtHx2EJxZ9Py8Kk l82qLfoqKLTDRJz7s5GR0NeIS3sysBWoWmyxKF1XVZU5hbVbT5IBaHYWB 1RPnzqr8REwgfnKapyxTBsD4D4exejeYZ84A49tq+Se5FpHyt4sywEp6I Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="404893346" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="404893346" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2023 02:15:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10669"; a="663513778" X-IronPort-AV: E=Sophos;i="5.98,317,1673942400"; d="scan'208";a="663513778" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga006.jf.intel.com with ESMTP; 04 Apr 2023 02:15:46 -0700 From: Michael Sit Wei Hong To: 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 Subject: [RFC net 1/1] net: stmmac: skip PHY scanning when PHY already attached in DT mode Date: Tue, 4 Apr 2023 17:14:42 +0800 Message-Id: <20230404091442.3540092-1-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.5 required=5.0 tests=AC_FROM_MANY_DOTS, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=no 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 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 --- 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; -- 2.34.1