Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4309026ybl; Tue, 20 Aug 2019 09:58:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8Yt2T8Y32v6s4P+oaksSzoDQuHVQLLR7Q1DWp5PKgbwPwI2Hryznm5+tA/KjUw0moKjn6 X-Received: by 2002:a65:5043:: with SMTP id k3mr26409084pgo.406.1566320293787; Tue, 20 Aug 2019 09:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566320293; cv=none; d=google.com; s=arc-20160816; b=NUvHZmXhUKADU+h6CchtD4+aZNaHOlyXDbuqlFoif7HLYWijrj6pfkZ/3wzTgg4DQs eA8NlhwtIB85AzKnemCSbgUlmn/m87MFRHijDuH6oKvrolt7hbLdkD3w40lzaw5O6WWw RWBiXCdfJK4VWNpiJ1yreScrdlqiFqrso3sEIOg5nKMdqO5Kmm+cWbewvrSUlhW65COE Gbz//fij6wIVXQaNahR1IyFQqKuYswV1af3MF307fq3VgAwaBekwc5oLyzc9zaMeysff l5Wz6GLoLLY5T8+vs0Cgb7SODEsCrKWsmuB5WUssABIzSwj45mZVZJeShYUGsXKkXAY9 EnZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JAtJPN5LPz1NP7Kvc+Pi0qxaQWdr//qiRCcQt5w3p7Q=; b=hK0vEY16uHPyyuZGy449b8P1cvz9qhlS5izG2eOCIDaUh+4Avqlvtulv2yiSmolOZ1 OH8DWWSqPWhvlyGRtNLkIRS17kDzp+kc+EzwlwmJIS9Jm3P1h5AKyiNLHmCDnw4lqXvn 7ljjr9m2Z3WTT0avXLrJcMtbCH9zGQXb3KumX+echVYdv6zQDVK0J0meRbdSeNi/bLbU hxWAmIHGHuEByPXUXb/unvBXE2dpsBrrWR4UYMjXopoXBrH6V5uQLn7CJ5zTN+tpThcX bSsC1j1AZoYvrTZtwtPW77Vgxt3ITbSP/Y2uynN5T/Ym+Ajb603NMRt1pwH4rhpmZGr4 x1KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L3hLxwYu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si12800295plk.172.2019.08.20.09.57.58; Tue, 20 Aug 2019 09:58:13 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L3hLxwYu; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730088AbfHTQ5K (ORCPT + 99 others); Tue, 20 Aug 2019 12:57:10 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38129 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbfHTQ5J (ORCPT ); Tue, 20 Aug 2019 12:57:09 -0400 Received: by mail-lj1-f194.google.com with SMTP id x3so5786340lji.5; Tue, 20 Aug 2019 09:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JAtJPN5LPz1NP7Kvc+Pi0qxaQWdr//qiRCcQt5w3p7Q=; b=L3hLxwYuiq8sL0sadcDvCKGQgKYHCZ+Rza6UC0Qub5NfC8iP4zdNqmxT9/veutW/xy Q4lBuqsovJEgtb1udxomRnVQhzWGi7WqTJ26GOd6+P+191qMuve/E2+AnozyA+UL5VHQ DeJQ569LLDji4yZKjMd5ydDJnjXXjeDBBf7e0Fcd4BHxsDu7aNHfbL1tG+/n/opWcVvH /o/ltiCHc1/FB48PdAayH0Uwq7g7ohT8QpX2yTLy5nWZpb2srwmXbMUnhq2/sGxen4/D +06/+fXKPLI6w4DtYQvpCYscN60ob7wK+4zgx4O4chACnUZk3rm7d+PQLMKf0K8CUWYr 0s3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JAtJPN5LPz1NP7Kvc+Pi0qxaQWdr//qiRCcQt5w3p7Q=; b=dhmlZIFR2op7+5gO09u62M4+DSwm8cPi+J68zOgkHQS0asPjNHT0kNWps5ANecWQ1M N04isb1oLxz+ksToeDEMMrhgXZTOywznKe9jdxHPeJbr1WvrCAgp7bPkNiRL+Q9b6q/S QFtvrkDGvLCYmVdaAbmZqIfkqn6fstZLYW6BUi3VPvmY026uicBldIMT2jAY/G6AhNjE Py7hh+trCDm5V1mEVaFaSQMvA5+eJcGnGI1l2lrXh1EdgEISJjUC6rzGGDo7QfsbK/Dg 3c9SjDiByjhdTnx5hSQhJvAZQv73N0tOPF4Me6+ZCcK/kwi4/07dOvEY1IVJKnG1J4YU rM4A== X-Gm-Message-State: APjAAAXKA1MeLPtBF5imM4cvGTcUdW9yyjHyIADn58Qxa7O7y4hcrRFI 54mlF5Ev4o5pt77NTLInB9QfcBrbHxJ4nWXaDG7trs8UZ88= X-Received: by 2002:a2e:8004:: with SMTP id j4mr16032792ljg.231.1566320227639; Tue, 20 Aug 2019 09:57:07 -0700 (PDT) MIME-Version: 1.0 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> <20190820154005.GM891@localhost> In-Reply-To: <20190820154005.GM891@localhost> From: Hubert Feurstein Date: Tue, 20 Aug 2019 18:56:56 +0200 Message-ID: Subject: Re: [PATCH net-next v3 2/4] net: mdio: add PTP offset compensation to mdiobus_write_sts To: Miroslav Lichvar Cc: Andrew Lunn , netdev , lkml , Richard Cochran , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , "David S. Miller" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Di., 20. Aug. 2019 um 17:40 Uhr schrieb Miroslav Lichvar : > > 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. > Currently I do not see the benefit from this. The original intention was to compensate for the remaining offset as good as possible. The current code of phc2sys uses the delay only for the filtering of the measurement record with the shortest delay and for reporting and statistics. Why not simple shift the timestamps with the offset to the point where we expect the PHC timestamp to be captured, and we have a very good result compared to where we came from. Hubert