Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1813041rwl; Thu, 30 Mar 2023 01:42:29 -0700 (PDT) X-Google-Smtp-Source: AKy350bzAnYE2BcPZG27TNJmgcwFpqQgXPBrp736hJCdc/9JPg4vrOx9xLD4AtDWahx73sxxTDS6 X-Received: by 2002:a17:90a:ba04:b0:240:cf04:c997 with SMTP id s4-20020a17090aba0400b00240cf04c997mr573945pjr.2.1680165748804; Thu, 30 Mar 2023 01:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680165748; cv=none; d=google.com; s=arc-20160816; b=fYv/UppZ508TpybG/Xrj+avRVpOLgp+5DxNrgKFGdWSJmpTLxj0tOsu5CaxcwyTUYO LaUugj9253KrE2ebbLLiiUD4YRPYmMasaYpjGH3aGQwYh5M290XM/wTJY6d3qhvf7aiS RM8lHySdxmV4mIDIYjUfIIhkyCOvNxikcX5i8LiwbpOgusVG4xtQpbTNns9R4u0X17iP q+H+8SFuoQ0rEG4LsXeZo7HbeKn2+DQWKNCtE7Jpv+CWau91pmE41kbyQioO6VMeBr+A OtBPACbTWIczSk36X6hHYf0NGWD5I94IfdHWH/JoPhGVBqBASbFvXuuMbhR15nZmLDhT ww5Q== 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=lgsCo9VUqwFRbMU9jM3JoKq+w9/g1sTMyMvcKI3NXfbNnSC1M2I7ruxM6xsRmmY4NA 0pt31g/yTbFmHcXBzLx73Xqil2BAxJBDCoVmGzpXl1/KqkMWM/DDjvnkBjHKkRfuO6k4 ej0aYrAu6IR90jDT6kZAuU4JbhXP5JmmPFXWxDwO3TL0WWqutTsorbgfb+1Qvc40FeSE pgLi80tF1Y5fi1S9KvQ9qZhx1OgtDuC5nrLvm2b6PyQSfxbpYq8LWErx6ehw5EGWkwei +ffg+9ubtrXXrnEKmdkVlo3DvH+tQLSaJfQjucUPjdh7qHULkx/MvDUGrNYJjzmsCTwb zt3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="VAWJm/ZL"; 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 bt6-20020a17090af00600b0023f89642a5asi3394384pjb.180.2023.03.30.01.42.16; Thu, 30 Mar 2023 01:42:28 -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="VAWJm/ZL"; 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 S230033AbjC3IlQ (ORCPT + 99 others); Thu, 30 Mar 2023 04:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbjC3IlE (ORCPT ); Thu, 30 Mar 2023 04:41:04 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515895B8E; Thu, 30 Mar 2023 01:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680165661; x=1711701661; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h7HA31Ype249VhePLWHGaLt81vSRMT92v7O/eTwjq3g=; b=VAWJm/ZL8ZPWgg5xkolKEarQn99rpgzVtU2agtiEfdlnRGbU0jgfGXDL bMZAWs9HUc933/CaZueJDssflpNEvogifOHwKz0kIzrqO15Lfkdewb6hs yK27b3k5auieHuiediUxR7flBkLSo7sWwNvKrTKhRy8rcxyUtjxXjL+aO y0MVQXOrTFtP/2OCI6QkAS8bzscQ1G0Psv9q3GuFGlawy5IY3uqKCqKYf Rkos5F+8uLDXPC+UBlvpW6TdL7oxvUXxwZgfNn/6shJ/YcasovMMwscJI CO5mvnfp3RRE6J0VXYz2u4d41qzmV+f8kdTI562G9NPr4tlNq3k/MbnMk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="343559450" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="343559450" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 01:41:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="684618839" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="684618839" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by orsmga002.jf.intel.com with ESMTP; 30 Mar 2023 01:40: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 v4 2/3] net: stmmac: check if MAC needs to attach to a PHY Date: Thu, 30 Mar 2023 16:39:59 +0800 Message-Id: <20230330084000.3292487-3-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230330084000.3292487-1-michael.wei.hong.sit@intel.com> References: <20230330084000.3292487-1-michael.wei.hong.sit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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