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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C001FC43613 for ; Sat, 22 Jun 2019 23:18:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DC16206B7 for ; Sat, 22 Jun 2019 23:18:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbfFVXSb (ORCPT ); Sat, 22 Jun 2019 19:18:31 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:60762 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726468AbfFVXSa (ORCPT ); Sat, 22 Jun 2019 19:18:30 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 04821153A9D77; Sat, 22 Jun 2019 16:18:29 -0700 (PDT) Date: Sat, 22 Jun 2019 16:18:29 -0700 (PDT) Message-Id: <20190622.161829.532888207521796213.davem@davemloft.net> To: weifeng.voon@intel.com Cc: mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, joabreu@synopsys.com, peppe.cavallaro@st.com, andrew@lunn.ch, f.fainelli@gmail.com, alexandre.torgue@st.com, boon.leong.ong@intel.com Subject: Re: [net v1] net: stmmac: fixed new system time seconds value calculation From: David Miller In-Reply-To: <1560953628-3248-1-git-send-email-weifeng.voon@intel.com> References: <1560953628-3248-1-git-send-email-weifeng.voon@intel.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 22 Jun 2019 16:18:30 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Voon Weifeng Date: Wed, 19 Jun 2019 22:13:48 +0800 > From: Roland Hii > > When ADDSUB bit is set, the system time seconds field is calculated as > the complement of the seconds part of the update value. > > For example, if 3.000000001 seconds need to be subtracted from the > system time, this field is calculated as > 2^32 - 3 = 4294967296 - 3 = 0x100000000 - 3 = 0xFFFFFFFD > > Previously, the 0x100000000 is mistakenly written as 100000000. > > This is further simplified from > sec = (0x100000000ULL - sec); > to > sec = -sec; > > Fixes: ba1ffd74df74 ("stmmac: fix PTP support for GMAC4") > Signed-off-by: Roland Hii > Signed-off-by: Ong Boon Leong > Signed-off-by: Voon Weifeng Applied and queued up for -stable.