Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp822398lqb; Wed, 17 Apr 2024 11:41:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlUaJBxhnpC1ekyYJbH3qiGJNvdBkjZybzQr/dqNDub6/NEGQ9Jso085ByrbgTq/Ps87axg9Ig95H+ibX2M/yZyzF4QBJLOF0UzMqlVg== X-Google-Smtp-Source: AGHT+IH4ePDY9eL5aqkYX2UAcSmrWMLAszzWU6NHVnKaHDNCSyS+W78y55GZmecEHteFz6fxv7XR X-Received: by 2002:a05:6870:f14d:b0:232:fa72:bdd0 with SMTP id l13-20020a056870f14d00b00232fa72bdd0mr537240oac.5.1713379307637; Wed, 17 Apr 2024 11:41:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713379307; cv=pass; d=google.com; s=arc-20160816; b=iZnX4lW+tM+Gwz/w3mxN2BYkv+6wA26Niv9Ra8tqSqf2k8q04dPEOeh5QOqRJz5KB2 MQRmq11EQPgpmRcB1V54bHZ+xYuKIeexrHs8VXZYPQJblAhiyHEDLIGA44GGVe/YT8SM l1u1d5SmYaNWZBJ8QQyeAGjT5SwQP7D1ijOrxUC/iQya0K9y/lST0pTvhOFJl3xugeoo Rvbb1lrv3DOJ4/JWUXYV2WY5yB09At8XzPurhkl5mRWzllgdsV/cyKIpt0Fve2Z0yXUd rLwduKvqPCgPbQUus0tT9AMLW62X9WUHY8ZqQKC4ONgZX6+fW6J0B1qvRoV8KCz7eIZ4 gPzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8Chgr1XzB7VSgqVHEHSg5NAelbYbuWSYpJpFWHYQKww=; fh=ncjpuIWmB2ZTo3yYcl0ur4KKVFqsiXJpgHR0Njh9MJQ=; b=qaFcwHR1qyt1824cxYagXG0YNCpFmMTwfZuErM/Ri7WMOtoCfGdGo4nd4dh8mnqhHy w4jzrkd5Bzcy5NS1Mxie1KpYpJLaUg7n9us8Nv7/JxPO6pJQ8L6ggJ6dQgyl74ld1SzP CeKmWjDGbpD4vVArwfA75v/Vq84UfyErEwgrztBuKRoexzJOHORhULajhhlixBFaOnPM HnwZPnhdphzTX+JVKayILGidYHNog04EskNhTGj87qW6uvhQlGxa6vzTejDR9Sz+5tXw viovlJwUOz3PbGFjwvrgvkt+SycX72qyVqkHxEFQ8D80+jHxvL3nuYmks0yX31yO9PNl xlqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=xA9iEd9u; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-149062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k64-20020a633d43000000b005d4cd6a0aaesi12000786pga.398.2024.04.17.11.41.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 11:41:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=xA9iEd9u; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-149062-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5D761B25287 for ; Wed, 17 Apr 2024 18:40:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79A64200D1; Wed, 17 Apr 2024 18:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="xA9iEd9u" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B0F318C1F; Wed, 17 Apr 2024 18:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713379210; cv=none; b=p99M5lnOAD+iM+/roTFFxmlpuB4vjWiK2/ch9bXqqwnWZcJkaEYVC9Pif53l3pPQcNXHT5dKPzuaitrc2QerbXdqvJCDiSlMJ1tC/1G1GQaL+e9/VRe6chvC1PClG10leh+RcCNFbFtPXKoYGNMTJ9IOInJNsgPNjm2GLxLBBk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713379210; c=relaxed/simple; bh=spypHHCZDVm88N7JJvyzZpQKqPPwL6mqb4fe7v+1d/8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bgJDcewCO6COoNosfLbKOddm2sk/KohZsj0koeeo5AOsNO+u3i7xOB2FrXwMKa1jFzgmXEgTBgC7JoqDJZcABzA3FBZaYO7iDcB7JSAu0Uq1Gjej8ni8UzPhl/YOMVoaXF2W6M6I12JTX0H+fLK4yN/jNyC2bCykMefrHInuVSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=xA9iEd9u; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=8Chgr1XzB7VSgqVHEHSg5NAelbYbuWSYpJpFWHYQKww=; b=xA9iEd9uSK1xlIdb5ceWhSY5LG 6QyuyfGuXcUbPN6jWwUfai1cPpUETVoaxAQSAP4aLzeWyZ+LY+GTA5zHGziz29ZwNcfLOal5gYllU XnXYMEx7kq5w8oDMDrMS9DN2srLrGKB2ToOQQSk23DPI1dD7QCP+DmK/159KopQ/xjE4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rxACI-00DH19-19; Wed, 17 Apr 2024 20:39:54 +0200 Date: Wed, 17 Apr 2024 20:39:54 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Heiner Kallweit , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Woojung Huh , Arun Ramadoss , Richard Cochran , Russell King , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH net-next v1 2/4] net: phy: micrel: lan8841: set default PTP latency values Message-ID: References: <20240417164316.1755299-1-o.rempel@pengutronix.de> <20240417164316.1755299-3-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240417164316.1755299-3-o.rempel@pengutronix.de> On Wed, Apr 17, 2024 at 06:43:14PM +0200, Oleksij Rempel wrote: > Set default PTP latency values to provide realistic path delay > measurements and reflecting internal PHY latency asymetry. > > This values are based on ptp4l measurements for the path delay against > identical PHY as link partner and latency asymmetry extracted from > documented SOF Latency values of this PHY. > > Documented SOF Latency values are: > TX 138ns/RX 430ns @ 1000Mbps > TX 140ns/RX 615ns @ 100Mbps (fixed latency mode) > TX 140ns/RX 488-524ns @ 100Mbps (variable latency mode) > TX 654ns/227-2577ns @ 10Mbps Does Half Duplex vs Full Duplex make a difference here? > +static int lan8841_ptp_latency_init(struct phy_device *phydev) > +{ > + int ret; > + > + ret = phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_RX_LATENCY_10M, > + LAN8841_PTP_RX_LATENCY_10M_VAL); > + if (ret) > + return ret; > + > + ret = phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_TX_LATENCY_10M, > + LAN8841_PTP_TX_LATENCY_10M_VAL); > + if (ret) > + return ret; > + > + ret = phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_RX_LATENCY_100M, > + LAN8841_PTP_RX_LATENCY_100M_VAL); > + if (ret) > + return ret; > + > + ret = phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_TX_LATENCY_100M, > + LAN8841_PTP_TX_LATENCY_100M_VAL); > + if (ret) > + return ret; > + > + ret = phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_RX_LATENCY_1000M, > + LAN8841_PTP_RX_LATENCY_1000M_VAL); > + if (ret) > + return ret; > + > + return phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG, > + LAN8841_PTP_TX_LATENCY_1000M, > + LAN8841_PTP_TX_LATENCY_1000M_VAL); > +} What affect does this have on systems which have already applied adjustments in user space to correct for this? Will this cause regressions for such systems? I know Richard has rejected changes like this in the past. Andrew