Received: by 2002:a05:6a10:87d6:0:0:0:0 with SMTP id g22csp801553pxr; Mon, 11 Apr 2022 07:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz85UMjExAUr7NsfR112tD1xxdiLKtDod0uAG9ByDgG1X+HqyMg+RUovv88ZndLTDBU5NT+ X-Received: by 2002:a17:902:d5c3:b0:154:c472:de80 with SMTP id g3-20020a170902d5c300b00154c472de80mr32894084plh.87.1649687666980; Mon, 11 Apr 2022 07:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649687666; cv=none; d=google.com; s=arc-20160816; b=c41UqzjHWsuQ9Gq5WbvrF9chCYzHJPoc6UVToZZg/rcpRNHbps6gqlIdxs4YYBUg1y q4Y9mtoRE3EMDPLmq7ZwzxcUrVBLc5WkGKesQl4WDk+OOkd0qSX7O6whLWRbYbC0p/bL Gej2Dy1OHr0gre6K90WU+lQpdfSPVZSWrDOV9oaiLbunQBW1LDAbtg2e4nm824i4uy3D dkPCLoMsTqBOvOtB9DupNdsznJ4GRHMthp6yR+7GASWIp66J0Kcqdez6TrUJxH9ybVqB 0EnY1ieLQ8tql/z2y+DuohjST9dodlO0H23+UALECowLFwqDql6CKa5VqRzeIWmD4zPT 323Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wtF7jY0BwNsNrJMJShokmAPPuLBIVEhYMWChoUb5c3s=; b=aFSZuVe2EwZvzdu/iUWjdw9v9vBBNDnbRK50i7v8qLVdrZ50SuXpQFG3TM5ggA/iop NHmUacu77eSZ/MiUeJZRs1UDCHDlZr9vVo1WnzSFmOSnFVIw3HUtuMIF1DDbdZ6Hl0Hy wnKbRtpaRZjZ6nBTn/82SEdr1vaL0xWdtOwRQEiKYP6JNvAgZjCHtOtmlIO+Jl926EjF 9UbuWrqH6cxIgmtE3Krs0gD8lbJJfl7FKTVO6gePf8/8GTunsbYbhGM7NEYXD2f+vKud r8ef3LxpTvHG1pSRlP9y8CKDjf/L3vmg2+rWg+qN3dxV9wMHkpDzZ871wzd0esuwfzMU dy9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=PFuVUT0r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a635c4b000000b0039908cd5f57si8885850pgm.783.2022.04.11.07.34.10; Mon, 11 Apr 2022 07:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=PFuVUT0r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243010AbiDISlK (ORCPT + 99 others); Sat, 9 Apr 2022 14:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242998AbiDISlH (ORCPT ); Sat, 9 Apr 2022 14:41:07 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC2BF29B7C7; Sat, 9 Apr 2022 11:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649529539; x=1681065539; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dVgtckquqWlgW80YtAs9y0siWvgrgYUEyaZIjS8N8pM=; b=PFuVUT0rxI8Y7rNrA9PasmhZJzb4QMo2saoE4spnnwQBxI7ecVNQso/f DF8L/eECiygk46zew1HzGvd7y4icTThWXMZJWhgYvWhTYd3j/V7FsGXqV ZN9+1/QaWBeuyOX21HZvqkMWnmY5JPk9SgrPuvqvt+InWaR4nQIsJkJIB vUTvZNuPVPGMTfEsAm1o8OFihiYLVRq+crdOElAzmnyEOZSuBRSDLpfoS EJI9EIPOrciNp0DnqLrS3LMzl9GqU4AhbJzHAvNqRJiPpXvhsCf5p2mKd D3BWHjIcL9BeZHiv86DtD/enr33tim5hWgpZ1DJ2eTkNyOtVgJM+3RQ6O w==; X-IronPort-AV: E=Sophos;i="5.90,248,1643698800"; d="scan'208";a="169060529" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Apr 2022 11:38:59 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Sat, 9 Apr 2022 11:38:59 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Sat, 9 Apr 2022 11:38:57 -0700 From: Horatiu Vultur To: , CC: , , , , Horatiu Vultur Subject: [PATCH net 1/4] net: lan966x: Update lan966x_ptp_get_nominal_value Date: Sat, 9 Apr 2022 20:41:40 +0200 Message-ID: <20220409184143.1204786-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220409184143.1204786-1-horatiu.vultur@microchip.com> References: <20220409184143.1204786-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clk_per_cfg register represents the value added to the system clock for each clock cycle. The issue is that the default value is wrong, meaning that in case the DUT was a grandmaster then everone in the network was too slow. In case there was a grandmaster, then there is no issue because the DUT will configure clk_per_cfg register based on the master frequency. Fixes: d096459494a887 ("net: lan966x: Add support for ptp clocks") Signed-off-by: Horatiu Vultur --- drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c index ae782778d6dd..0a1041da4384 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c @@ -29,10 +29,10 @@ enum { static u64 lan966x_ptp_get_nominal_value(void) { - u64 res = 0x304d2df1; - - res <<= 32; - return res; + /* This is the default value that for each system clock, the time of day + * is increased. It has the format 5.59 nanosecond. + */ + return 0x304d4873ecade305; } int lan966x_ptp_hwtstamp_set(struct lan966x_port *port, struct ifreq *ifr) -- 2.33.0