Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp651356rwb; Wed, 26 Jul 2023 00:03:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlHLAzLx8t9c+dA2LL8i8gnCygyVfnGD//rcbchuxntM2Dwi8ogzUPyHZRuWn+btVBP4174S X-Received: by 2002:a17:906:7686:b0:999:26d3:b815 with SMTP id o6-20020a170906768600b0099926d3b815mr927089ejm.64.1690354985059; Wed, 26 Jul 2023 00:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690354985; cv=none; d=google.com; s=arc-20160816; b=mqbGc9wHj/dEHd9KqRuZ/d/edrHABF5Ch4GuqZ6PcLWWJD8W3qFJ4/wtbsv8YCIVVc oJFoh4CKcnthIXuI/9Inpubt9dD9CdTVTsfcGTStF8NI8D38TmIrrjTALDpPl5xwq9YF lSQ3Oa0j8j55QCPH8hhMi1qnabUa+xCqtJFSaRvTPKBPvAw5m+UNSUIEcyQFro94zw0T uLQ+s6nUdU6avj0sR7ueMTIREDEC3dRLJ6fPe3CHrXBMK+hWMVr9b5JPk5ROeMosS0TM zJH82HAqx1L3IccV7E70ocOy0E5E3ZChGtlYE6BH1yDCmoNXz/Ymh7sibvQZ941+fK5y 33yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jj2Jyud8JmQD7wqFbv8ZLutgBnwxMJSSVVAVEayiVb4=; fh=s6N0ILki5AVttGj0c7IOh1oRFcQEfBAD8mYxjsGswQ8=; b=w92KewzO9HR+5LpxLJYjhh2wqhb1BWlUHV2hapdxmGs+XWiHDaYC2q8XlbV4grB6hl IFTjgLXi2RDWo8Rdoshu8GutwCps0SxRjOX86L4bwiaHtmrZB6DTK9Z8SlR0Nzx3l8tG Okx2WeIrgGWI5qki3noofYHnHrc/elY9fnz0Ec3CaIavNRFferOOQpBesRdklU0uhRFZ teWuuzVQm7Fh1ajQAx74MVeFZ6wblsTEflpco6WK/Xv8McW5IXs6m2weE0g9lTnGTvJ2 ssLae+q38Wd2XXiOk3Rdl9nPVYQz0EZW73u/LIHHhZfNsjZHD3ovDM0Ve7NATmKlddNS CJzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lo18-20020a170906fa1200b0098884f86e43si8730950ejb.1053.2023.07.26.00.02.39; Wed, 26 Jul 2023 00:03:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbjGZFuo (ORCPT + 99 others); Wed, 26 Jul 2023 01:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjGZFum (ORCPT ); Wed, 26 Jul 2023 01:50:42 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B64E173F for ; Tue, 25 Jul 2023 22:50:40 -0700 (PDT) Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qOXPd-00042j-DG; Wed, 26 Jul 2023 07:50:17 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id A5F631FAD5F; Wed, 26 Jul 2023 05:50:11 +0000 (UTC) Date: Wed, 26 Jul 2023 07:50:11 +0200 From: Marc Kleine-Budde To: Jakub Kicinski Cc: Richard Cochran , Johannes Zink , linux-kernel@vger.kernel.org, kernel@pengutronix.de, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Alexandre Torgue , Russell King , kernel test robot , Eric Dumazet , Jose Abreu , Maxime Coquelin , Giuseppe Cavallaro , Paolo Abeni , "David S. Miller" , linux-arm-kernel@lists.infradead.org, patchwork-jzi@pengutronix.de Subject: Re: [PATCH v2] net: stmmac: correct MAC propagation delay Message-ID: <20230726-subsector-unguided-8f1fc1edb037-mkl@pengutronix.de> References: <20230719-stmmac_correct_mac_delay-v2-1-3366f38ee9a6@pengutronix.de> <20230725200606.5264b59c@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n73y6rsllricxc2b" Content-Disposition: inline In-Reply-To: <20230725200606.5264b59c@kernel.org> X-SA-Exim-Connect-IP: 2a0a:edc0:0:b01:1d::7b X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --n73y6rsllricxc2b Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 25.07.2023 20:06:06, Jakub Kicinski wrote: > On Mon, 24 Jul 2023 12:01:31 +0200 Johannes Zink wrote: > > The IEEE1588 Standard specifies that the timestamps of Packets must be > > captured when the PTP message timestamp point (leading edge of first > > octet after the start of frame delimiter) crosses the boundary between > > the node and the network. As the MAC latches the timestamp at an > > internal point, the captured timestamp must be corrected for the > > additional path latency, as described in the publicly available > > datasheet [1]. > >=20 > > This patch only corrects for the MAC-Internal delay, which can be read > > out from the MAC_Ingress_Timestamp_Latency register, since the Phy > > framework currently does not support querying the Phy ingress and egress > > latency. The Closs Domain Crossing Circuits errors as indicated in [1] > > are already being accounted in the stmmac_get_tx_hwtstamp() function and > > are not corrected here. > >=20 > > As the Latency varies for different link speeds and MII > > modes of operation, the correction value needs to be updated on each > > link state change. > >=20 > > As the delay also causes a phase shift in the timestamp counter compared > > to the rest of the network, this correction will also reduce phase error > > when generating PPS outputs from the timestamp counter. > >=20 > > [1] i.MX8MP Reference Manual, rev.1 Section 11.7.2.5.3 "Timestamp > > correction" >=20 > Hi Richard, >=20 > any opinion on this one? >=20 > The subject read to me like it's about *MII clocking delays, I figured > you may have missed it, too. The patch description clarifies what is being corrected, namely the "MAC-internal delay, which can be read out from the MAC_Ingress_Timestamp_Latency register". The next step would be to correct PHY latency, but there is no support for querying PHY latency yet. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --n73y6rsllricxc2b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmTAtA0ACgkQvlAcSiqK BOj+xAf9HnUMaNIWiFRIZoj3nuV0Sm7RBhk/exT6G18NMZPSk82FtzDgOsBQmJba Jg1SR+1P8sQl41S08+MUGp8la2aafbin8uKx59u9Cc2awqTCm8LKkH0Dy6VbIs+0 kzwv9OnjeUW59XCtw14bf6A98IzSF7EjUQbYHohSzu3rpPcP8FUFHn80E3Mx7eMf lCUbHVKVSwk0UX/SEic4hBowFTIn5IOLhpvSShLGBTkG+Cwl2t7xQikqtlrrzoBd cFA14fvDpoeN/zSkP/L+5RPheqpAsNMxfz/W1+c84+6k06yMZrg+0nlkD0u18MNg nsLo15Uu8pW06snGCiGSny4ZBzEUQQ== =o4NS -----END PGP SIGNATURE----- --n73y6rsllricxc2b--