From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6C905C433F5 for ; Thu, 3 Feb 2022 16:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RgL7Hqvr1jT/IY10YUI372VwIZrC9JHiCD9foDSxhY8=; b=2k5IXbOOmrS7Dq 3D82dO+6QmGisSkx0fsE4HTK9C0WkGDD8X5lTTZ5saFkkL1KTAVQgskONHikRsWjkOcAffe9M+6R/ VHYm+E0fz7/dSzwyG0akLmPGGTfjhzThztt6uczfM76L97KMly0HQ5WLYkDapixkn97Tnx/+0wKqz GtMb5bufdwwz5KslCUt4WHD3HDuXly1gYGymgLixLIQ8epSgNe0Sb3PI++bi9aPfT9rsjYZs2rD5e Oqchn/T2XQR0Msc44DnE8/DYbUobtpZoyeK48YkCAFGtwnV7QZZ+/HvBgL9/A6n/NapZCxgd9i2c4 WPulqnNodUVqAxYXeb/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFfDq-0021wJ-UA; Thu, 03 Feb 2022 16:44:39 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFfDn-0021v1-Nz for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 16:44:37 +0000 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=jThIhFNBrb3xj2YQLkczkGqkTy9wIvQP7gVhgnzkrew=; b=zGqOR7+LqSrG510WGhf1Ch1m+Q zInXDUP+4zUsUrFPitgFSW+BwbHex8XmIlJT7thj0wp4BGrUyfHA+/mkPSu8CAYR2a8B7LsJpIVbA N5gpuO+O7H3tPq8CUi8kGBhgqdRTkcgxmXICWE+dL+up2T1R+KeuuXYuzT7Gp4Cuf1mw3+s6E46yj lg6bKHZlj4VFjSRnTYgs2sGXT/CoQbquXe3QK9Wwygp0lxg2M8kzhI/PcsZALiYg8Eqq511/Xxd+m yInasAcEDOvhjUF3etd1bOFnYK37Zl3SlsnaKMYrH5FZyOWqqY69AUQdLoYSsrGcGv+5TW1HIoyo+ JgXhnVbQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57016) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nFfDf-0002s5-AV; Thu, 03 Feb 2022 16:44:27 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nFfDc-00049q-6H; Thu, 03 Feb 2022 16:44:24 +0000 Date: Thu, 3 Feb 2022 16:44:24 +0000 From: "Russell King (Oracle)" To: Yannick Vignon Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin , Rayagond Kokatanur , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sebastien.laveze@oss.nxp.com, Vladimir Oltean , Xiaoliang Yang , mingkai.hu@nxp.com, Joakim Zhang , Yannick Vignon Subject: Re: [PATCH net] net: stmmac: ensure PTP time register reads are consistent Message-ID: References: <20220203160025.750632-1-yannick.vignon@oss.nxp.com> <13dc6f72-8ef4-6990-1c67-2b92c6894e87@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <13dc6f72-8ef4-6990-1c67-2b92c6894e87@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_084435_802119_49AEE160 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 03, 2022 at 05:38:10PM +0100, Yannick Vignon wrote: > On 2/3/2022 5:28 PM, Russell King (Oracle) wrote: > > On Thu, Feb 03, 2022 at 05:00:25PM +0100, Yannick Vignon wrote: > > > From: Yannick Vignon > > > > > > Even if protected from preemption and interrupts, a small time window > > > remains when the 2 register reads could return inconsistent values, > > > each time the "seconds" register changes. This could lead to an about > > > 1-second error in the reported time. > > > > Have you checked whether the hardware protects against this (i.o.w. the > > hardware latches the PTP_STSR value when PTP_STNSR is read, or vice > > versa? Several PTP devices I've looked at do this to allow consistent > > reading. > > > > It doesn't. I was able to observe inconsistent values doing reads in either > order, and we had already observed the issue with that same IP on another > device (Cortex-M based, not running Linux). It's not easy to reproduce, the > time window is small, but it's there. Okay, thanks. Reviewed-by: Russell King (Oracle) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel