Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2011638rwb; Thu, 27 Jul 2023 00:08:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEvp7GezIgqLkYyrdiz1I7/SfckKCy8QHuMhY95aSzf64+RUp3tZKb7Yvv4BlQwEMI3J9S4 X-Received: by 2002:a05:6512:b86:b0:4f8:586a:8af6 with SMTP id b6-20020a0565120b8600b004f8586a8af6mr1330076lfv.4.1690441733643; Thu, 27 Jul 2023 00:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690441733; cv=none; d=google.com; s=arc-20160816; b=LgYfwINKF3muFHRf3r+ajBWiXAP6oUeXlindd4pIqLyArGG2eugILrGIfkIUQC98zN 8/RQE+7Ay/ZRZ/OFVcJCnDlBQiNpzT8tq0lVdZUe2K1GxzoDOK+gvAuY140tTUdMEbQT bXRSEo9MRFvH9lAu4NHdSlii4W/n2i9/I9OYcfJFhyAHcYQqtBeAe6A4sM3h/noaLTb4 OKtAsq19GEuxLnnRSHgxXJ5l8tUWbH0PXyGjEMC6H132979j4AkI4x54woj3CZh2AHVs 1p0Md5Niodd2rJwFBdyqYPVtp6VNaLx1gdMq+PcipYjvWV7/WYJTYH+gS/7oLY4swAO2 wcQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=iwet1iRJfVE5r44rfugA5RzlWC8yPMj2qmBq45XqFfw=; fh=dVpisoX67vxEtjBzDqkkoR24M0F9apQD47oeNCg5h2A=; b=hb/K4KPMJkep7KeK8PkPh+iC4EoSWMepi4tOriWSLmXLMfOosLjdZ69O8rob7msy7c pRbkMyfAHY3e2JG6uwX3ZEB2D75nGN4iI0v0rErCbcB0XGWhzCzGfHQ09LDWT7vz5hef LtmsUH41lEDCEF2iZfIjxHakCSgNdRLb7pc0WwEbp20SLWkBEnAV4tid0iSWAkA/g8ut 6QtAgtQ9dVwBHVF7puKYHJFnMHz9VoJ7sS2M/FUY/4xB1zl5BxyGjRuEFdjIldEIqJ9S GRWQtN2sWELT8wMB4JRfWOsUQPM9IuqH9/q2ZVvsICeyaEPQgiUIqagZ0NmBOsqynN8Y bZpA== 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 x3-20020aa7dac3000000b005222d54d570si494574eds.406.2023.07.27.00.08.27; Thu, 27 Jul 2023 00:08:53 -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 S232582AbjG0GkL (ORCPT + 99 others); Thu, 27 Jul 2023 02:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbjG0Gjy (ORCPT ); Thu, 27 Jul 2023 02:39:54 -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 543732D73 for ; Wed, 26 Jul 2023 23:39:48 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qOuf3-0001oC-9Q; Thu, 27 Jul 2023 08:39:45 +0200 Message-ID: <8742d597-e8b1-705f-6616-dca4ead529f4@pengutronix.de> Date: Thu, 27 Jul 2023 08:39:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2] net: stmmac: correct MAC propagation delay Content-Language: en-US, de-DE To: Richard Cochran Cc: 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 , Jakub Kicinski , Paolo Abeni , "David S. Miller" , linux-arm-kernel@lists.infradead.org, patchwork-jzi@pengutronix.de References: <20230719-stmmac_correct_mac_delay-v2-1-3366f38ee9a6@pengutronix.de> <20230725200606.5264b59c@kernel.org> <09a2d767-d781-eba2-028f-a949f1128fbd@pengutronix.de> From: Johannes Zink In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: j.zink@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.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,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 Hi Richard, On 7/26/23 17:43, Richard Cochran wrote: > On Wed, Jul 26, 2023 at 08:10:35AM +0200, Johannes Zink wrote: > >> Also on a side-note, "driver nonsense" sounds a bit harsh from someone >> always insisting that one should not compensate for bad drivers in the >> userspace stack and instead fixing driver and hardware issues in the kernel, >> don't you think? > > Everything has its place. > > The proper place to account for delay asymmetries is in the user space > configuration, for example in linuxptp you have This is not about Delay Asymmetry, but about Additional Errors in Path Delay, namely MAC Ingress and Egress Delay. > > delayAsymmetry > The time difference in nanoseconds of the transmit and receive > paths. This value should be positive when the server-to-client > propagation time is longer and negative when the client-to- > server time is longer. The default is 0 nanoseconds. > > egressLatency > Specifies the difference in nanoseconds between the actual > transmission time at the reference plane and the reported trans‐ > mit time stamp. This value will be added to egress time stamps > obtained from the hardware. The default is 0. > > ingressLatency > Specifies the difference in nanoseconds between the reported re‐ > ceive time stamp and the actual reception time at reference > plane. This value will be subtracted from ingress time stamps > obtained from the hardware. The default is 0. For the PTP stack you could probably configure these in the stack, but fixing the delay in the driver also has the advantage of reducing phase offset error when doing clock revovery from the PHC. > > Trying to hard code those into the driver? Good luck getting that > right for everyone. That's why we don't hardcode the values but read them from the registers provided by the IP core. > > BTW this driver is actually for an IP core used in many, many SoCs. > > How many _other_ SoCs did you test your patch on? > I don't have many available, thus as stated in the description: on the i.MX8MP only. That's why I am implementing my stuff in the imx glue code, you're welcome to help testing on other hardware if you have any at hand. Best regards Johannes > Thanks, > Richard > > > -- Pengutronix e.K. | Johannes Zink | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |