Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5671760pxu; Thu, 22 Oct 2020 08:15:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP8jG1QVxEJmiB47XXWe4WamQjybCBlRimdClWBJ7ZzFVix1wYzzpK3viQAV3xd+vepcWB X-Received: by 2002:a05:6402:1bd9:: with SMTP id ch25mr2551922edb.365.1603379715786; Thu, 22 Oct 2020 08:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603379715; cv=none; d=google.com; s=arc-20160816; b=bi6f+CeV4c//seb64BtgSs7sbIYyJNNVsD2+kWMSayRhz71Gr1TEj7kHHOisLLPrBs mOYGMAjuQtu0BumZz4hjvfDZDvhHRnD9plC2R00MrmWuSspt4CDpx2vKIB6pNZaDGhXG koh2UOImigHwj/4Uj6nEKanhfj7lZ+Xp1yygbG3rabqY2lHImSPK2MSxwdYHWuDH6Wwv bg87pB+Jf9fTGkX7wORmfKaWh9VyolJm5Gah3bALU7fyIdNXyTm8Uoenr/4IzfITUB8p D9mAQ2Ooy1pg/eDx/PzWu1fQEIVKvh/WU57uGOq+FbJHC+V34v5GFLaskWyGI+5MQiPo RQww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=biKYzJ6rw5v7zotuxQlwelGlaL61xs7Y0POZsNN6hQ0=; b=uVjQ5GPgeo87JlqGeZuhf/ZjHkKvaXdzqh7vPGjXaDXQF4+4QlrElTDPsldJwHmpQJ vswO+VVgKbXhboKXbYRH8BGQBIZh1L4sc8hVIGTGe8MAlN3Kel/pi83pldF0RewiXSn0 JsDLFeTyB2t863EOjSbuRL4egVQ5cVs673e0g7FwNS7+it0Z3b0Fb1sZuRw1hwkFOeBt Z+aRe74lplYmxZcSkI9n4cufzuvuOaYP+qcSgBYJlHOf58duWz3EasLOGist/TiE0kN6 O0mvxfm8jaBoL848pyaSQ1cemMiMkpAKoP6NOkAIMBYIUOGqHb7ZjtLfzYHccyWeIeoH M0Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G0lOaK/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w20si1050290ejc.568.2020.10.22.08.14.52; Thu, 22 Oct 2020 08:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G0lOaK/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2509933AbgJVJBc (ORCPT + 99 others); Thu, 22 Oct 2020 05:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509188AbgJVJBc (ORCPT ); Thu, 22 Oct 2020 05:01:32 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC3EC0613CE; Thu, 22 Oct 2020 02:01:30 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id z5so1157994ejw.7; Thu, 22 Oct 2020 02:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=biKYzJ6rw5v7zotuxQlwelGlaL61xs7Y0POZsNN6hQ0=; b=G0lOaK/oWzaiYS1X4nfuWV2b9kpCSeHlywHLk4cWIaxwxW8oHkY4+VPazQDpqLbNHs xKzSmZHqodXCuFS4okFcUq7clRYkdnp7pr/dzSTeuXm2kzveGdU9KqYURkWu3Wnkum0O xJZntcnyb1wh6U4SHVkW2Px4ySD5TgNc7juOUxpprAcV4MvB1BYlpminey55jc9ehSWz IchM2mQK4+MKYEC+GZ5g4VY5ohooABNX1mWtg+JLUPmaRpqDUnvf4qAF8ANZ7OeE0Ju1 JRsvKU9VG5AnzeAL3LCjlInbIv6/3LpaZqdhKce32p5ctplC7glIhz1/svnMWS3T+y3V PpcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=biKYzJ6rw5v7zotuxQlwelGlaL61xs7Y0POZsNN6hQ0=; b=XlqKZo2IkarFwFEhotu/Zvc6+7qiUylgCRo7xx83aaBnsnCG5IbXrjvlDjnd5Y0PJw KoOahQYnQZwLtRjWId32XwfflwD+EKl+8T+q25YzhaxOrKGgonWSRlpctNGndHDfPh+S GoKRQ4THSVk20QbjWX8cA1Z42cqbbgQVxSlhH/yg2Jr6hKQ4o5gLwzl1+BTkgoFGeKK9 8TUhRSOTuU/N8BqB40lMSMOYjpRVpV6MKiVWZ/F0N2T3axFuRx7kvnkWZag46D35aF2g +UGTdelkze75R1vGE2lvFM1ExgiSIyuM+SZel6QRshOSQPCTWMCSBJyUpOFB0LSUDybG PSRg== X-Gm-Message-State: AOAM532Ovhx+ty7R4q7uHzKou7uA6aaDYvGjzS4IVN53bSfRi6glpeL2 NW4dsTq8P618Tq06BYcxN7M= X-Received: by 2002:a17:906:444:: with SMTP id e4mr1409273eja.218.1603357288909; Thu, 22 Oct 2020 02:01:28 -0700 (PDT) Received: from skbuf ([188.26.174.215]) by smtp.gmail.com with ESMTPSA id j3sm388785edh.25.2020.10.22.02.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 02:01:28 -0700 (PDT) Date: Thu, 22 Oct 2020 12:01:26 +0300 From: Vladimir Oltean To: Richard Cochran Cc: Christian Eggers , Florian Fainelli , Andrew Lunn , Vivien Didelot , Jakub Kicinski , Rob Herring , Helmut Grohne , Paul Barker , Codrin Ciubotariu , George McCollister , Marek Vasut , Tristram Ha , "David S . Miller" , Woojung Huh , Microchip Linux Driver Support , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next 7/9] net: dsa: microchip: ksz9477: add hardware time stamping support Message-ID: <20201022090126.h64hfnlajqelveku@skbuf> References: <20201019172435.4416-1-ceggers@arri.de> <20201019172435.4416-8-ceggers@arri.de> <20201021233935.ocj5dnbdz7t7hleu@skbuf> <20201022030217.GA2105@hoboy.vegasvil.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201022030217.GA2105@hoboy.vegasvil.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2020 at 08:02:17PM -0700, Richard Cochran wrote: > On Thu, Oct 22, 2020 at 02:39:35AM +0300, Vladimir Oltean wrote: > > So how _does_ that work for TI PHYTER? > > > > As far as we understand, the PHYTER appears to autonomously mangle PTP packets > > in the following way: > > - subtracting t2 on RX from the correctionField of the Pdelay_Req > > - adding t3 on TX to the correctionField of the Pdelay_Resp > > The Phyter does not support peer-to-peer one step. Ok, that's my mistake for not double-checking, sorry. > The only driver that implements it is ptp_ines.c. > > And *that* driver/HW implements it correctly. Is there documentation available for this timestamping block? I might be missing some data, as the kernel driver is fairly pass-through for the TX timestamping of the Pdelay_Resp, so the hardware might just 'do the right thing'. I believe the answer lies within the timestamper's per-port RX FIFO. Just guessing here, but I suspect that the RX FIFO doesn't get cleared immediately after the host queries it, and the hardware caches the last 100 events from the pool and uses the RX timestamps of Pdelay_Req as t2 in the process of updating the correctionField of Pdelay_Resp on TX. Would that be correct?