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 EE9D2C433F5 for ; Thu, 3 Feb 2022 16:32:10 +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=/iA9c9CYe4xLDPLgLOoRyr4blGk6LlKz46jtekwdbs0=; b=nbuMmqxAPWOVPm JrZK3iqA+ig8f47JMZPIW/jM5jdsdvGsbVmTDmIEDeHdaOHwefVOuogLAyjIe24umjFgr3VE4n1x9 lClmQa9LDnOSh+PLgiFMhEnKinJC4qv0Bq1j/DSKQj2WuOqPqPqEwVxc5pZwEPVDfXAWz4BgouV1a 4MDuacBMOK37ts3jgE4K99+Xd7OYe+Vq4CCIslhUQVjwqT6z2x+U6BkoGrM1mIYEnkLKCIN7ln2OE OcDhzIravjAU/88mT0u4VnYa7eVtEdu/VsMhjkco67CN9yfJuZztNGr+lnOiqHaxDp9GHaeikHlTj hcpmoZRwl10cSrzdKCPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFf0N-00206q-Jw; Thu, 03 Feb 2022 16:30:43 +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 1nFf0K-001zwD-8N for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 16:30:41 +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=i43avDuz3XN6MDj44KkNBxrK6u4IdlfhJ1/qr9Rvu44=; b=RwFuIYqzBWh4oefkUpUmAE2BlC kqQEvY+nOkk10oBkT4kEinV481nqR0Z+zdWAA6LEw7PUeCHSplvR4+feBV5SkwbANrsG6fQDPimVM XdEansvs/WOvyfdx6z4GsxJGlPkuwfwRBxcCl25wbLQl8Hm471bSIPmMeKU3WHCNtTYi+XGFUJZ/j yAJp0pOwO0dowDWoXGcU7MEUH0CaQ+VC2a/geYpH+Dn0UnlcU/Jr3Nc0V2MlHIiV7YnhvxOdJJa14 pyr+0BYpTMsKG4DnxATGFfzR5Pco1l2JPIpk4GkG50mCyqeZfWWA4FaPB7DtpETIBZxDFOQtcY5Nv i6ANGUaQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57014) 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 1nFey4-0002qb-7d; Thu, 03 Feb 2022 16:28:20 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nFexx-00048c-FZ; Thu, 03 Feb 2022 16:28:13 +0000 Date: Thu, 3 Feb 2022 16:28:13 +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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220203160025.750632-1-yannick.vignon@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_083040_444459_FB952AD8 X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. 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: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. -- 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