Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4222031ybl; Tue, 20 Aug 2019 08:41:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWrfA8Ad3vQzKWkmJtqYa0JZpD8yl9u8RZ/jGwSd1jtLQ37FpMO4SVqTPMZ2xxSBs+dZFV X-Received: by 2002:aa7:8144:: with SMTP id d4mr31709940pfn.6.1566315697729; Tue, 20 Aug 2019 08:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566315697; cv=none; d=google.com; s=arc-20160816; b=E5+0HAvFlOYMNuPRLLPyrF4lhyBysJEpkMbLHpaMm9L5Azo21OfnJeUPlpOSoY3Wvx yIOplm04E1vzs+Vpa2bkLtjc/16z078/qMcaWmlD3dBenzSe9stHlGgA40JbSuEzhzzU 0tGK3lfZGGdWmDwh7e1oBgaXESYLcqPjUDtW1EqAzESnMHbMkWWfIhdGtdlIim1GS5HM 4eVinAEKkigyAglrJOdLJ1pcbhpjFeZFJM1qsV8FGZyHHU7jA0tOr+9DN9RPHpD1V4Cw D8IOZg7zfkO5ZrtDEkRcRN+EcHkeqxyjI2ow4mTn76dBSZMrOXe62SAzCCdDsn4zYklJ VCwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zKbkV3hqU7IR38o4VM5CbUBLc+MaOCfs8T6WwO+3aEA=; b=nnMI9X4v/ex9dE82EpjpQjNkiPd+74/du/hY5GMIAOpSXc1dTUeZeLxmqSS0iKVskU cICC47BNIb7jJeWiMrrA2K5jpMUa2ywHNb+YAHb8BgcEiz5Ncu3sdTlyyJ+s/ssvcxhl ibNqcf0kpkrKjVHKG3c+sNCp7ffBhRJ/NwuD2tIzQu12wHnvRC0B5sNrTnkCdFjiLuJh h8YUyKyT8P5f9WYkiRRXDx9fvLWG9k6klWPeCkbsjl4aqBHjdgqLEEfoxpUOsLb6WgUw +Ac0sWmdL9k4V7LlVe8sGJv0wNrIX2h9Bm0YDCHTa7M0h+sDJTcLOeYDP99GRgDrRHGi qlfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si4778516plz.135.2019.08.20.08.41.22; Tue, 20 Aug 2019 08:41:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730399AbfHTPkK (ORCPT + 99 others); Tue, 20 Aug 2019 11:40:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729351AbfHTPkK (ORCPT ); Tue, 20 Aug 2019 11:40:10 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2399A10576D3; Tue, 20 Aug 2019 15:40:10 +0000 (UTC) Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DF9A1000324; Tue, 20 Aug 2019 15:40:08 +0000 (UTC) Date: Tue, 20 Aug 2019 17:40:05 +0200 From: Miroslav Lichvar To: Andrew Lunn Cc: Hubert Feurstein , netdev , lkml , Richard Cochran , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , "David S. Miller" Subject: Re: [PATCH net-next v3 2/4] net: mdio: add PTP offset compensation to mdiobus_write_sts Message-ID: <20190820154005.GM891@localhost> References: <20190820084833.6019-1-hubert.feurstein@vahle.at> <20190820084833.6019-3-hubert.feurstein@vahle.at> <20190820094903.GI891@localhost> <20190820142537.GL891@localhost> <20190820152306.GJ29991@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820152306.GJ29991@lunn.ch> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Tue, 20 Aug 2019 15:40:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 05:23:06PM +0200, Andrew Lunn wrote: > > - take a second "post" system timestamp after the completion > > For this hardware, completion is an interrupt, which has a lot of > jitter on it. But this hardware is odd, in that it uses an > interrupt. Every other MDIO bus controller uses polled IO, with an > mdelay(10) or similar between each poll. So the jitter is going to be > much larger. I think a large jitter is ok in this case. We just need to timestamp something that we know for sure happened after the PHC timestamp. It should have no impact on the offset and its stability, just the reported delay. A test with phc2sys should be able to confirm that. phc2sys selects the measurement with the shortest delay, which has least uncertainty. I'd say that applies to both interrupt and polling. If it is difficult to specify the minimum interrupt delay, I'd still prefer an overly pessimistic interval assuming a zero delay. -- Miroslav Lichvar