From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 59C413148BD; Fri, 24 Oct 2025 12:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761309906; cv=none; b=V0wyPtdlnV/gEPTbT7/woSKrgcLMYGp4C1wWuRIHOGLJWO9pdmvvBRh0hpm5Epn3no1xv5O2z7yHlSMerePsPnzbJyn4w3y8GkOdplizbXmbZREZCiAm9q5vE+6FMblze7Kpoa3mpLAKIBO6BsFZXJ8tpWXs9jiPsPug4KpvauY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761309906; c=relaxed/simple; bh=ulAkUrhtk23W1v7Muw/r2tC0o1r3natHGepQFpVkoEY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G0j9RTjkBtOtBY4aCVfU45lTyEYojIlAdf3+xHPtZqbNvKeRwAVim59jwZXzxiQ5Mq/GDuHTy1UL223iNxmDfq6mszRdPCQ0AMfTV79wILdXNOOLwabqIIw60eZVGgkdpHJSn8LZZZWLaEZ/G5bPGVa2+y/12so3rZ8wYlwkOcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=Jn76Cteh; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Jn76Cteh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fHLFk8P7vx3fkmMAD0Z+yzWnvmAZmlIEgYDTY3u8mmw=; b=Jn76CtehcFg/oN1IzztvatWZPh P3S/YEByWcAAh/kueIpYfffc4kv18iK0tvFMSMR3cqsG9kyuzexr4uLiZutXMgdnfoerSNGgaGVxX LrrhOKq2YL8yiEXiNPPa0rbqISLOWlLHK0U75KAZAK/zgzZV9r3qjNf8dDKjrweDgAOoRg+3PNuJ2 oatiT/E08t+H7dr/kSj1YQVNrQEx58OI7/N+489J+E8T68qu7UFYZbGUt8ElKzN1mp3gnQ1st9GYI mB1VaitqQl16cESVOfv2gHEiljpFmMC0rGGhb5KBcwb+Z7ZazicRoeJiwDfFprulozfvGohwxuPZv 3GI2wXBA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:53056) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vCHA7-000000007Yw-2tBo; Fri, 24 Oct 2025 13:44:55 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vCHA5-000000002iF-1zR7; Fri, 24 Oct 2025 13:44:53 +0100 Date: Fri, 24 Oct 2025 13:44:53 +0100 From: "Russell King (Oracle)" To: Maxime Chevallier Cc: Alexandre Torgue , Jose Abreu , Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , =?iso-8859-1?Q?K=F6ry?= Maincent , Vadim Fedorenko , Alexis =?iso-8859-1?Q?Lothor=E9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 2/2] net: stmmac: Add a devlink attribute to control timestamping mode Message-ID: References: <20251024070720.71174-1-maxime.chevallier@bootlin.com> <20251024070720.71174-3-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: netdev@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: <20251024070720.71174-3-maxime.chevallier@bootlin.com> Sender: Russell King (Oracle) On Fri, Oct 24, 2025 at 09:07:18AM +0200, Maxime Chevallier wrote: > The DWMAC1000 supports 2 timestamping configurations to configure how > frequency adjustments are made to the ptp_clock, as well as the reported > timestamp values. > > There was a previous attempt at upstreaming support for configuring this > mode by Olivier Dautricourt and Julien Beraud a few years back [1] > > In a nutshell, the timestamping can be either set in fine mode or in > coarse mode. > > In fine mode, which is the default, we use the overflow of an accumulator to > trigger frequency adjustments, but by doing so we lose precision on the > timetamps that are produced by the timestamping unit. The main drawback > is that the sub-second increment value, used to generate timestamps, can't be > set to lower than (2 / ptp_clock_freq). > > The "fine" qualification comes from the frequent frequency adjustments we are > able to do, which is perfect for a PTP follower usecase. > > In Coarse mode, we don't do frequency adjustments based on an > accumulator overflow. We can therefore have very fine subsecond > increment values, allowing for better timestamping precision. However > this mode works best when the ptp clock frequency is adjusted based on > an external signal, such as a PPS input produced by a GPS clock. This > mode is therefore perfect for a Grand-master usecase. > > Introduce a driver-specific devlink parameter "ts_coarse" to enable or > disable coarse mode, keeping the "fine" mode as a default. > > This can then be changed with: > > devlink dev param set name ts_coarse value true cmode runtime > > The associated documentation is also added. > > [1] : https://lore.kernel.org/netdev/20200514102808.31163-1-olivier.dautricourt@orolia.com/ > > Signed-off-by: Maxime Chevallier Reviewed-by: Russell King (Oracle) Thanks! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!