From patchwork Tue Jan 25 03:23:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Athari Bin Ismail X-Patchwork-Id: 12723225 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE60EC433F5 for ; Tue, 25 Jan 2022 03:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3BivVhkC7mOasfpy3zfXhklriF4YMIHPZ7ERVD8DDpg=; b=rVj8uI6IZgQxEs pS0YPUwlujqVgWU3CzupUb614Eiejpd7uPZGA6fqh7zklXofoGsyCk8oIRJuBvwMrvKcsEuGo3WEK F7G75v6l99gymhFxC1Vv4jzOxzluC5DonLBlYoBsuXWTlqzoOlyEtbl/TcuIscwo/VIv+x3WvTBHa 4gq5mOSRG0je/5brBc2GJkRdjS1FKUlp5U1XRXj/qzdFzRzv9YcQCC94+aV0bxLmbcH+Gmd2bpAkO 6hzuZyLhK0+2IKjxCXJCB9yLAXEsoI0OlbhIgCkIXt57LEWzZ+Mq0ZfhBzVKlM+SWdzatM0z3zgNw O5EJJkNfZxK90geXg/vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCCRc-006J1L-5l; Tue, 25 Jan 2022 03:24:32 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCCRQ-006Ilk-5j for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 03:24:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643081060; x=1674617060; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Tz1WJ/YY3EwQM6gWrJzFBZDFZsZ1MNsURDEDEz1XInA=; b=c531Rr2MJwsbEeUVcqsim179NlMV/kjZGyz42fZlTWxJwkVfQKQiPm1G 154UkgspCjgBAHWnZQy37rocyujzaLFtak6e8a8EN/VZSmeaauIGa8oS/ Cr2M7KX2Nfkwm3A6+vl0ojQauCc/0aUen4xWxq8FO5fvF5lzmq20CEtnM m4cJfGg/NHGqa9zmbs5Lgpz7F5iY4u0vMD4Ndz/2DFGCYS2oGcqHs2IXr Gud3s+4B87L/nDh4+omMnJWNeQrUdwAfZlgu1hj3k6AYJUYnXvSQs+owQ dJALzci/gOrZKIedzK7DjJCAEyizcxg8Egh+N28wDGnFq+B41cM6r0ycp A==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="309527391" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="309527391" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220124_192420_327052_72863C06 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;