From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 7419FEB64D9 for ; Tue, 27 Jun 2023 15:05:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 077D182640; Tue, 27 Jun 2023 15:05:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 077D182640 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1687878346; bh=vL8YsQNoCN0AoUXa47AdFMrfvGYRpM1BS7iEreKcjvY=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=tRe5XErZrEThTEhWMpbob9L6gcCGSH8hkeis9MPeu2HN3IdsKkS0siIo3XS6uNCe6 dGO5ztF8/aAp7X1/ylFzzYXUZMv6Ejpm89FiNzoUvHQj+Lrg3GHXUvjf7Upi4g8DXp elABIWJ1fX9bvjldnf1+K4QIdKfJIjsFcyRSfGTwV+btf8uTsPMBqPougZryh8I1fH sre6KJO9UWmn8lGwwVVjD3Tje0ZAMpcWGQMb9dHvOzVUDH8LL8Rv21AbD8hFHka+QX 7u5Y5Y0FfkaqY0TkxZANBZ7RShM6Wc7u+ti3MTAnKKuD0A1a6vvb3ohqlV+TlXj4Mg f2so9P5qISf3g== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XR-BUX3OZYmL; Tue, 27 Jun 2023 15:05:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id BD5A583183; Tue, 27 Jun 2023 15:05:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BD5A583183 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 077BB1BF36A for ; Tue, 27 Jun 2023 02:27:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D3E1340407 for ; Tue, 27 Jun 2023 02:27:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D3E1340407 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U1JA5ow-oOo4 for ; Tue, 27 Jun 2023 02:27:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B0FF5403A2 Received: from out-22.mta1.migadu.com (out-22.mta1.migadu.com [95.215.58.22]) by smtp2.osuosl.org (Postfix) with ESMTPS id B0FF5403A2 for ; Tue, 27 Jun 2023 02:27:18 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, jacob.e.keller@intel.com Date: Tue, 27 Jun 2023 10:26:58 +0800 Message-Id: <20230627022658.1876747-1-yajun.deng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Mailman-Approved-At: Tue, 27 Jun 2023 15:05:42 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687832833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=NiLCSG+J8TFDNfzSLNUB+HE+7XY7CA+7w0Zb1WNocDM=; b=IhqNKXxGVHAbv02ycD8gt4pXO7ev48kyVUIt/6qCLWeiBDI1Puem2akmTJkVtW85kXxD2v Dz6OdsIobdamjjipKw3k7iAt5SY9kitKkaE3qJdHabDP9eT8QLHB2BoUz6V9Y0QM8kwTDq qXggTMDRHehcW7QeX0CEM/ecZlOf+Kw= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=IhqNKXxG Subject: [Intel-wired-lan] [PATCH] i40e: fix the wrong PTP frequency calculation X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Yajun Deng , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" The new adjustment should be based on the base frequency, not the I40E_PTP_40GB_INCVAL in i40e_ptp_adjfine(). This issue was introduced in commit 3626a690b717 ("i40e: use mul_u64_u64_div_u64 for PTP frequency calculation"), and was fixed in commit 1060707e3809 ("ptp: introduce helpers to adjust by scaled parts per million"). However the latter is a new feature and hasn't been backported to the stable releases. This issue affects both v6.0 and v6.1 versions, and the v6.1 version is an LTS version. Fixes: 3626a690b717 ("i40e: use mul_u64_u64_div_u64 for PTP frequency calculation") Cc: # 6.1 Signed-off-by: Yajun Deng --- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c index ffea0c9c82f1..97a9efe7b713 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c @@ -361,9 +361,9 @@ static int i40e_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) 1000000ULL << 16); if (neg_adj) - adj = I40E_PTP_40GB_INCVAL - diff; + adj = freq - diff; else - adj = I40E_PTP_40GB_INCVAL + diff; + adj = freq + diff; wr32(hw, I40E_PRTTSYN_INC_L, adj & 0xFFFFFFFF); wr32(hw, I40E_PRTTSYN_INC_H, adj >> 32); -- 2.25.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan