Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5474544pxb; Wed, 26 Jan 2022 12:53:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzws4bV3F4zvtu3I9/fmUHTVrRqWm3zSvPFdGkiz35itibZVXnK9kvrYRDZmuOQHJLvaULW X-Received: by 2002:a17:903:32c3:: with SMTP id i3mr269259plr.136.1643230428926; Wed, 26 Jan 2022 12:53:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643230428; cv=none; d=google.com; s=arc-20160816; b=auD0OZvE70bHVpHM6Dr2UfgfxVVEy9eJsbJDUvm0DRfRjstffNSu33C74TNGOw2038 0BPov+4rrUTMMOhjMmr3cjhIPf2S23F0X4JfN7xtwjlj2lEVuoRu0jP4GMPGhASHA9Px PiiNFDakYkLRjZSJR82msaaBLHjc+ODHFw0p05FJ3T6aVrKsm/cz29MIrgbF7oGlUZqf Dx6hf+Q6HJSkiZyivs2fbmy/R2XdIlg/pKYN2pbNUJjK4lcXWStKqAgHikA4soMQh86x 06W+dbhUFcWYsZQq14DOrcjoGLIVqWduGYiU6TUBxD6VxFOfqbE1j2ht3PK6DK8Sla3y jEIA== 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=aItBGz5phGpdiLNMDJ5j7wwg7il5Pk0jx9tEJlK/JQx/YcOsfsHMByg9hWFdmhfanP +KIoBo+apDY4PfvL+a5NnS+HLiaI1WE8cHggPVgFPYWE9XtGsGWWqG/qhLY4+2d8hIIf GSdFWKkUAfscdQ3sgfh4l0i19JeL4W7R8rBvxXBesC4osujPKXoF6NPK53AGFkwneK5i SX/qaQe7QeHVJcxHc/De+MLQ4gG49o99fJdU1VkRKEUyTifW/n4ItR4pnwGWLV3HmEsv 70hQoFerv+MH5GcCS/KXWGxXOvRpPYWJBrBlhBoUi2AgU/ui/vWtzX6T6GtuKCtrIFsY n5oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WBEa+8om; 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 v8si287836pgi.789.2022.01.26.12.53.37; Wed, 26 Jan 2022 12:53:48 -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=WBEa+8om; 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 S239317AbiAZJsT (ORCPT + 99 others); Wed, 26 Jan 2022 04:48:19 -0500 Received: from mga18.intel.com ([134.134.136.126]:4595 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbiAZJsS (ORCPT ); Wed, 26 Jan 2022 04:48:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643190498; x=1674726498; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Tz1WJ/YY3EwQM6gWrJzFBZDFZsZ1MNsURDEDEz1XInA=; b=WBEa+8omPpTivL9sBoMue+P1McTO04pO3D693a5LvZeyh7gZToUykHPm c6xFEwNsq8Qg2KVWUYC12wCyvn52rdSwTF7NCf8IgBELvHEs8uJJEtS34 xs9XWN9auQjqFssM0MOAN3OeE6QV/iTHMestsZKwu0PES3flCfijTC7b0 Lprathf/7aczM8iRI3udZ0eq6fRxsCqx9RPQq/y1XFP860shhXXuIGrd5 MrlwVyRWd5Uyl/XkIRQXmb37AQ6KihopGjr+mdmaQUmpft0YE0n0LOTBq 1A/msI8mgf+99uEJJGyvaohqIA7nzw/L10LZr8Vhueosw2V5Xij2Gv8Xt g==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="230090782" X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="230090782" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 01:48:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,317,1635231600"; d="scan'208";a="617918587" Received: from mismail5-ilbpg0.png.intel.com ([10.88.229.13]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jan 2022 01:48:13 -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: Wed, 26 Jan 2022 17:47:22 +0800 Message-Id: <20220126094723.11849-2-mohammad.athari.ismail@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220126094723.11849-1-mohammad.athari.ismail@intel.com> References: <20220126094723.11849-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