From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 C5FDE76408; Tue, 20 Feb 2024 16:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708446040; cv=none; b=GomqaNvUapRm6vccni10ZzboKHZ2ABZXw33YY8bb2rbt2RFRLNtMjz6pDF44AMMiNKxSGsp5QYdp6LYSUSOTuoOK1JoXE7eaZQKDzrEvte8BGZbftPJKYCNoQkOTOpxb7FIirbpJWFNpfeHR6hW5GujHuZkzjnm5b5wARA0IelM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708446040; c=relaxed/simple; bh=8YQv7aLTPzzKaJ7jlQ5Sre4GQB/b020Pt6fSgtcM+TE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HGjOrXBGhdwMo5p4715CRlUoPoRVED6XpHlPnfAC2QYeVDaE6Q5G3KJ5kSJDEiqwfAYLKqm2nzdNJpFcUbaYxxQ4CwP9GVEiLhdZlvIT097MqBJWU74xuYAAhzg/qhMqxtwe9RZC3Rd5xmq+C7kgHnDEJTgrwAIM5xHITiIcGdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QIRKyTj8; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QIRKyTj8" Received: by mail.gandi.net (Postfix) with ESMTPSA id 02E04240004; Tue, 20 Feb 2024 16:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708446035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pXos02wI1NevLoKIn6UfDZ/DT2LVCxm0HsQrNIoS9qw=; b=QIRKyTj8c5fpAGiYJiASyDw9WoF4XtF3FZAOmveqKKYIkasIzidfU3JLHPT8/T0CCqli53 s5q+RtSlnAko+igLmKgeVSTe1InW/gAuXXU6osKRWw1D7zjFLjZHBCsaYtt9+iiS2RFNkc XDKrd29uZEvN5CINymsS4Zn1pCw6dvf4VEEW4od3YFhqEvnJdoY62vYj9KMssIr2j5Q0VC NLn6VW/lc6vmI0E+Q3QLLYHwztna+ZFZZ5xVZu3W6WRINwqrbiZcyt94wPc9OIGpg/Qgqk JLLZ0DGExukFlycsPkRXfSLuH+CuGkTrEhhBx0F5FwkovvFw9jfH21NzYhyOUg== Date: Tue, 20 Feb 2024 17:20:33 +0100 From: =?UTF-8?B?S8O2cnk=?= Maincent To: "Russell King (Oracle)" Cc: Rahul Rameshbabu , Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier Subject: Re: [PATCH RFC net-next v8 04/13] net: Change the API of PHY default timestamp to MAC Message-ID: <20240220172033.556f321f@kmaincent-XPS-13-7390> In-Reply-To: References: <20240216-feature_ptp_netnext-v8-0-510f42f444fb@bootlin.com> <20240216-feature_ptp_netnext-v8-4-510f42f444fb@bootlin.com> <87jzn4gtlv.fsf@nvidia.com> <20240219142936.62112d34@kmaincent-XPS-13-7390> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: kory.maincent@bootlin.com On Mon, 19 Feb 2024 16:11:16 +0000 "Russell King (Oracle)" wrote: > On Mon, Feb 19, 2024 at 02:29:36PM +0100, K=C3=B6ry Maincent wrote: > > On Fri, 16 Feb 2024 10:09:36 -0800 > > Rahul Rameshbabu wrote: > > =20 > > > On Fri, 16 Feb, 2024 16:52:22 +0100 Kory Maincent > > > wrote: =20 > > > > Change the API to select MAC default time stamping instead of the P= HY. > > > > Indeed the PHY is closer to the wire therefore theoretically it has= less > > > > delay than the MAC timestamping but the reality is different. Due to > > > > lower time stamping clock frequency, latency in the MDIO bus and no= PHC > > > > hardware synchronization between different PHY, the PHY PTP is often > > > > less precise than the MAC. The exception is for PHY designed specia= lly > > > > for PTP case but these devices are not very widespread. For not > > > > breaking the compatibility default_timestamp flag has been introduc= ed > > > > in phy_device that is set by the phy driver to know we are using the > > > > old API behavior. > > > > > > > > Signed-off-by: Kory Maincent > > > > --- =20 > > >=20 > > > Overall, I agree with the motivation and reasoning behind the patch. = It > > > takes dedicated effort to build a good phy timestamping mechanism, so > > > this approach is good. I do have a question though. In this patch if = we > > > set the phy as the default timestamp mechanism, does that mean for ev= en > > > non-PTP applications, the phy will be used for timestamping when > > > hardware timestamping is enabled? If so, I think this might need some > > > thought because there are timing applications in general when a > > > timestamp closest to the MAC layer would be best. =20 > >=20 > > This patch comes from a request from Russell due to incompatibility bet= ween > > MAC and PHY timestamping when both were supported. > > https://lore.kernel.org/netdev/Y%2F4DZIDm1d74MuFJ@shell.armlinux.org.uk/ > >=20 > > His point was adding PTP support to a PHY driver would select timestamp > > from it by default even if we had a better timestamp with the MAC which= is > > often the case. This is an unwanted behavior. > > https://lore.kernel.org/netdev/Y%2F6Cxf6EAAg22GOL@shell.armlinux.org.uk/ > >=20 > > In fact, with the new support of NDOs hwtstamp and the > > dev_get/set_hwtstamp_phylib functions, alongside this series which make > > timestamp selectable, changing the default timestamp may be not necessa= ry > > anymore. > >=20 > > Russell any thought about it? =20 >=20 > My position remains: in the case of Marvell PP2 network driver with a > Marvell PHY, when we add PTP support for the Marvell PHYs (I have > patches for it for years) then we must _not_ regress the existing > setup where the PP2 timestamps are the default. Yes, that's what I thought. About the Marvell PHYs PTP support I have a few fixes on it, but we will talk about it when this series gets merged. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com