Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4015351pxb; Tue, 25 Jan 2022 01:26:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnIfkf4qCGzW1X0PicXFujzRYd0G2alj4SdedNqpLFnFab2qXYMu4m0Zm1AQr+Zk/r13YH X-Received: by 2002:a63:6906:: with SMTP id e6mr14588269pgc.170.1643102773695; Tue, 25 Jan 2022 01:26:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643102773; cv=none; d=google.com; s=arc-20160816; b=s/WtnjkVGiEVB2iX/H88UB93B1VFZYO1SzD51fRhOrhfpKBefBBvWS4oa680jc0TeL Vj0Er6n9nsZieAtKqZcEPwlj5e2hNoxZrlGF8JzlJUkUZ+2ecBGJDfYSzVsfk8RQpfQn XE56gXuY9S0vUs55tofJ76CwJvK9QgnCeDMB36vNwUagimiV3UoBItt6M/0hpd3v4dkE Z59uZ/73669m0N74wnW0MewBYoyk4EjVHaHj8mLxeopA2FWa8HpzLY7gMs8gokxQS3sW LaFNliXUFF2XqgCAl7f/y2fi5LhZ205ddIovDWscyrrdEDER+sKldw9L+43gxA6w0GJn iN3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=d+fO2pCKovWb++JVh1l+kO8DkE3sPfcCgKluNEC90oA=; b=CF0D4HoXlEalbk0jBRTh5kxcRSF1vR9fMRLA6ITXRjCN6bm7M7CEVNpyH+St85eUUM xxHhvAXQTkZgB6K2azVDVbz62Z+Z2qjeYwOf2WzxtE7uaDt4y7OetClcenmwnoWsDmUB Jb4djRPLl6gVeuP/hgCy+5NXWrSiS1LEYacRCJJJD9m5KMBXx+MEornwW9FczjtT1m7x GBdJMiEQS22ySHX9GlUDUNRXx0OUi+3tEzWAk2Oc/T2XB+ReeCfcaEPSQXT4D1eu+VAE /VecENCS2Fa3IGeE9zf9Uh2uuldC6NyfdtTrFb+0y6de1pgUHhol2sGmNnZwZJPSSSzi OS5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jZHTnO1z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si758135ply.236.2022.01.25.01.25.53; Tue, 25 Jan 2022 01:26:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jZHTnO1z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1446229AbiAYHgw (ORCPT + 99 others); Tue, 25 Jan 2022 02:36:52 -0500 Received: from mga05.intel.com ([192.55.52.43]:18809 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354037AbiAYDc6 (ORCPT ); Mon, 24 Jan 2022 22:32:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643081578; x=1674617578; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Tz1WJ/YY3EwQM6gWrJzFBZDFZsZ1MNsURDEDEz1XInA=; b=jZHTnO1zYSbJeGU+pF1OGuCYOR8iw7ugseA0MQjRLriNHJbHu2MtbjMY avO9zV/xSQL1l+uIbiY24s0iOZPmSrkTd1Ea9DeHKjbhHfV+vdphNWmHC U6fzwzJZt4054Ymb8C5H70Z/htAOdqNugDnZOZcjRs1xMRzAtuZBDyH/z fBRmgIswFhj2K9sxWtJTGlBzN4+W78xIx0rVboB0E0L730X7pIH5ILnOO Z+UfTcCy7y1ueMMKZZ3Wh2QGiO2IdP5VQNjE3fXBgb/Ltlh6oENhNnyyi aafRieScN1uK6HuvmEWJ/tvLCJqXHaWDVgflOS6JiqmZVXbWCju0GeULV g==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="332562390" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="332562390" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 19:24:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="532293067" Received: from mismail5-ilbpg0.png.intel.com ([10.88.229.13]) by fmsmga007.fm.intel.com with ESMTP; 24 Jan 2022 19:24:15 -0800 From: Mohammad Athari Bin Ismail To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin , Ong Boon Leong , Voon Weifeng , Wong Vee Khee , Huacai Chen , Alexandre Torgue Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, mohammad.athari.ismail@intel.com Subject: [PATCH net 1/2] net: stmmac: configure PTP clock source prior to PTP initialization Date: Tue, 25 Jan 2022 11:23:23 +0800 Message-Id: <20220125032324.4055-2-mohammad.athari.ismail@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220125032324.4055-1-mohammad.athari.ismail@intel.com> References: <20220125032324.4055-1-mohammad.athari.ismail@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For Intel platform, it is required to configure PTP clock source prior PTP initialization in MAC. So, need to move ptp_clk_freq_config execution from stmmac_ptp_register() to stmmac_init_ptp(). Fixes: 76da35dc99af ("stmmac: intel: Add PSE and PCH PTP clock source selection") Cc: # 5.15.x Signed-off-by: Mohammad Athari Bin Ismail --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6708ca2aa4f7..d7e261768f73 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -889,6 +889,9 @@ static int stmmac_init_ptp(struct stmmac_priv *priv) bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac; int ret; + if (priv->plat->ptp_clk_freq_config) + priv->plat->ptp_clk_freq_config(priv); + ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE); if (ret) return ret; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c index 0d24ebd37873..1c9f02f9c317 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -297,9 +297,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv) { int i; - if (priv->plat->ptp_clk_freq_config) - priv->plat->ptp_clk_freq_config(priv); - for (i = 0; i < priv->dma_cap.pps_out_num; i++) { if (i >= STMMAC_PPS_MAX) break; -- 2.17.1