Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1851360rwl; Thu, 30 Mar 2023 02:19:37 -0700 (PDT) X-Google-Smtp-Source: AKy350Yvv2+K20xxMldPmhLskgIV1cpfaM0DigtChY74agw8ZFMNwjxD7gHGN964b9Vxo+IbBZe0 X-Received: by 2002:a05:6402:1e8e:b0:502:465:28e1 with SMTP id f14-20020a0564021e8e00b00502046528e1mr1999914edf.0.1680167976964; Thu, 30 Mar 2023 02:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680167976; cv=none; d=google.com; s=arc-20160816; b=tlobrf5/I9MGvnwfx/lJwhy+N45dG9MU04Zh5mtr10xZWniV9y/W0B7hGTiWmtvj6a ymBcbjkVkN/+LdBrdWKMYgl8J06zNCN85I7sn2UZWAmP18bflFNtG5vBkTCaRFxy6brg Owx0Z00Re5STqLnVDhUsCPn00YrASl/cMWx8SCkEWKdf93b/pGa8bH4Cl1LxYK0soTXY OMhur1pcFOvoUVNN8qcy4kVhoRopcwxHeNvmKnuEBBMW7lKyr/7IoSqBViZ2q6WsCxVV Jtw7oPvid9r3ptf9wQUsJ2V55L13myQgCzTUk5E52e6gf3bqkVqwvvrAkwSg/l2brU7C E2xA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XhG+QY03aph/EtJ/DGwDMKQnpUE78yOrQ3THTyFaJjs=; b=yWH8A7oIePSbqm/zuAiMHPFrTJ37tliqIjnVez4c16KFqMoC9IxzDb5NYa9Tc2CH8E tdXD4UYWWXicHAiujkT9+sBKJ9Kj1MmGlG0ULsZ3U+EjoT3W8Q4/OdX35qKGx5KgMt5n iigkgrw5ykTezJieZTq4jIbqLE7hGfNHgZGQZIsz7v91++hVC22qUau/gywtQiqp3Nhh gIFVkkXDvcVbGTsonpMayNCA7FX2oJ6b3W2TapJmChbua1/M7xLh7J6CyTUFEYH8qGAh HGD3iyeNZ2O3AEVN+OjutlJ6Vi4s932Gd5DEIE1TruaK+AZgDpmN9519v2WJ3LxpRZqB NvfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JuIE2QXD; 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 v13-20020aa7d80d000000b005024a8dc728si8185077edq.243.2023.03.30.02.19.11; Thu, 30 Mar 2023 02:19:36 -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=JuIE2QXD; 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 S230034AbjC3JPW (ORCPT + 99 others); Thu, 30 Mar 2023 05:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjC3JPI (ORCPT ); Thu, 30 Mar 2023 05:15:08 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3CDF4680; Thu, 30 Mar 2023 02:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680167706; x=1711703706; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h7HA31Ype249VhePLWHGaLt81vSRMT92v7O/eTwjq3g=; b=JuIE2QXD6Wm59qjDoFr4Z+PiaJZo6vRF0R3ll/hnC7qjtAblu9wqfGOu 5Db5f+cQ6RTX//VmgtQ3zRcA+qfT8HItcxtxcaCHwAgaykKoua0QlhEHS hNWz3f4mUpi8UEzEKVThg/Kr3m0r0Kd+AGCWG35WuTYiG+LxP6dpxJFKM F/ivrGoD5iz018EHvYXSE3phkBNHasxl+4XC/k+LpFilr140MBEbHQVmM EzpjetgwQsZPtT3L6/Z8ZZVo8LM5YBLXHHAtMDRbHDXgVkkaj3W5qbs84 noCyGd3y9+mpAE+3slwgSG4XGkQexvrV7PVvMHZWd/XVIUcT93IribXpE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="325038889" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="325038889" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 02:15:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="678125420" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="678125420" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga007.jf.intel.com with ESMTP; 30 Mar 2023 02:14:57 -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 Cc: Looi Hong Aun , Voon Weifeng , Lai Peter Jun Ann Subject: [PATCH net v5 2/3] net: stmmac: check if MAC needs to attach to a PHY Date: Thu, 30 Mar 2023 17:14:03 +0800 Message-Id: <20230330091404.3293431-3-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230330091404.3293431-1-michael.wei.hong.sit@intel.com> References: <20230330091404.3293431-1-michael.wei.hong.sit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 After the introduction of the fixed-link support, the MAC driver no longer attempt to scan for a PHY to attach to. This causes the non fixed-link setups to stop working. Using the phylink_expects_phy() to check and determine if the MAC should expect and attach a PHY. Fixes: ab21cf920928 ("net: stmmac: make mdio register skips PHY scanning for fixed-link") Signed-off-by: Michael Sit Wei Hong Signed-off-by: Lai Peter Jun Ann --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8f543c3ab5c5..41f0f3b74933 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1135,6 +1135,7 @@ static int stmmac_init_phy(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); struct fwnode_handle *fwnode; + bool phy_needed; int ret; fwnode = of_fwnode_handle(priv->plat->phylink_node); @@ -1144,10 +1145,11 @@ static int stmmac_init_phy(struct net_device *dev) if (fwnode) ret = phylink_fwnode_phy_connect(priv->phylink, fwnode, 0); + phy_needed = phylink_expects_phy(priv->phylink); /* Some DT bindings do not set-up the PHY handle. Let's try to * manually parse it */ - if (!fwnode || ret) { + if (!fwnode || phy_needed || ret) { int addr = priv->plat->phy_addr; struct phy_device *phydev; -- 2.34.1