Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5921C6FD19 for ; Mon, 13 Mar 2023 08:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230261AbjCMIGH (ORCPT ); Mon, 13 Mar 2023 04:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjCMIFi (ORCPT ); Mon, 13 Mar 2023 04:05:38 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE6B159419; Mon, 13 Mar 2023 01:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678694555; x=1710230555; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uhBtqsa1AIy5YV1rBDSt/rXxAQ/955DS3N8XQfdem04=; b=VcOTkdqBdHUvHJrIgHxUZZ8wSWBE5LbVCBBEnW9h0PmxWN7nSAwWBk7h Y4RvjrpnjYxQusQEHnEtguTo618ejs3p6lEHrMcBxdtwt3aRuCo31F/kc fuscOQn6xzopRCrICi67nRTtt8ak4okjlOD7TimV59UaKm9nbvUHxYWI1 6unt3bHev5uB101hoczS8XMm6AfzwUiMyOL/hJ4a0PlDv0IsEHRO63SFD AlJNkRyVNs0VXN2d9+U69zx2Rl3LPTeGKOgC5gL5BtzYfYjZo56C1mEt3 PlEBiWJoVKER9SJz2w6jTRs4Z2+NH6cFGnCJVGGhJc0HwoxbNce16nq6C Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="337107425" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="337107425" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 01:02:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10647"; a="747518016" X-IronPort-AV: E=Sophos;i="5.98,256,1673942400"; d="scan'208";a="747518016" Received: from mike-ilbpg1.png.intel.com ([10.88.227.76]) by fmsmga004.fm.intel.com with ESMTP; 13 Mar 2023 01:02:14 -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 Cc: Looi Hong Aun , Voon Weifeng , Lai Peter Jun Ann Subject: [PATCH net 2/2] net: stmmac: move fixed-link support fixup code Date: Mon, 13 Mar 2023 16:01:35 +0800 Message-Id: <20230313080135.2952774-3-michael.wei.hong.sit@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230313080135.2952774-1-michael.wei.hong.sit@intel.com> References: <20230313080135.2952774-1-michael.wei.hong.sit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org xpcs_an_inband value is updated in the speed_mode_2500 function which turns on the xpcs_an_inband mode. Moving the fixed-link fixup code to right before phylink setup to ensure no more fixup will affect the fixed-link mode configurations. Fixes: 72edaf39fc65 ("stmmac: intel: add phy-mode and fixed-link ACPI _DSD setting support") Signed-off-by: Michael Sit Wei Hong --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 11 ----------- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 7deb1f817dac..d02db2b529b9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -592,17 +592,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->mdio_bus_data->xpcs_an_inband = true; } - /* For fixed-link setup, we clear xpcs_an_inband */ - if (fwnode) { - struct fwnode_handle *fixed_node; - - fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); - if (fixed_node) - plat->mdio_bus_data->xpcs_an_inband = false; - - fwnode_handle_put(fixed_node); - } - /* Ensure mdio bus scan skips intel serdes and pcs-xpcs */ plat->mdio_bus_data->phy_mask = 1 << INTEL_MGBE_ADHOC_ADDR; plat->mdio_bus_data->phy_mask |= 1 << INTEL_MGBE_XPCS_ADDR; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 398adcd68ee8..5a9abafba490 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7064,6 +7064,7 @@ int stmmac_dvr_probe(struct device *device, struct stmmac_resources *res) { struct net_device *ndev = NULL; + struct fwnode_handle *fwnode; struct stmmac_priv *priv; u32 rxq; int i, ret = 0; @@ -7306,6 +7307,20 @@ int stmmac_dvr_probe(struct device *device, goto error_xpcs_setup; } + /* For fixed-link setup, we clear xpcs_an_inband */ + if (!fwnode) + fwnode = dev_fwnode(priv->device); + + if (fwnode) { + struct fwnode_handle *fixed_node; + + fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); + if (fixed_node) + priv->plat->mdio_bus_data->xpcs_an_inband = false; + + fwnode_handle_put(fixed_node); + } + ret = stmmac_phy_setup(priv); if (ret) { netdev_err(ndev, "failed to setup phy (%d)\n", ret); -- 2.34.1