Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2868639pxb; Mon, 4 Apr 2022 00:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgEl3uvKHygOiM3T2ahg2V5ubHDdFiIpqMaHW4VICB8vx5RRS5z2fKxy/PaqVLhNyB5AoC X-Received: by 2002:a63:b24c:0:b0:398:9594:a140 with SMTP id t12-20020a63b24c000000b003989594a140mr24034595pgo.292.1649058487163; Mon, 04 Apr 2022 00:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649058487; cv=none; d=google.com; s=arc-20160816; b=Je+f2PmuPmNk+gHuKKGsbW0ITlptugSZuZ5pgxEPJrO9oC+H0wVHhkEfKMDmaUu2s5 O6W9MPXSHUCpl2/IZwyErndEBAlHalUbE9iFzWQUYRNdfcJ8MRq+l/6wbqFTeSFm34bP z4cR9ylUbO4wk8SsfF1MNErduJRrpacywsDEomhb/v1NF6hhdzQlloDNZlYSRgZD2Wzc ymZYti0W5KZ6t6cQsB0hfXiNpbAvyhQv5zZgUFJ2xh9yzSZMW2J5Rqhn8WQ03aVs6QTt 1ccqOIdmj1gi+1+i/0P4meIWOTXrNYiwBBKO8L3/PfIdfWofIfAr2yzLot1etdlTpkDe WXKQ== 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=G5qMjCe4z3bEfBal1XdVkrll0up+2huRFDPmKjNNvZM=; b=Cthi388398nMDRN4eKe5pFiMQe8RITR4s1/TxJgQe/fDuzmfk8tH/FwtmXIHYoULP8 nhnxUm7bXjDleYW1PdH//Vy99LWzqavJgTDXynVgV592unaIROiXHhHTQMW0hYrtADT/ rhg2ZU5kIU10/b7vIQs6DsWdZgWdxiJp4XBLSJqt0Fgs4abPWq/PaQ19accIusfbsMG1 ivSCi9F4f6ox4swUnDHxNYxaj/OLPLrRF/NNq0Epj+I1qaY8Xol2wK7I0ImnYJweDY7S zWBGVbcZlQ1RitZU+jl/HOu+P4HYtP/3LutCoY7YbAp0Fm0+laibfj5koqVnPGMJSPzj KXJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=TgneTeH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a631c03000000b003993a5ec893si653453pgc.241.2022.04.04.00.47.54; Mon, 04 Apr 2022 00:48:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=TgneTeH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352055AbiDAPtY (ORCPT + 99 others); Fri, 1 Apr 2022 11:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350607AbiDAPoX (ORCPT ); Fri, 1 Apr 2022 11:44:23 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5EB62B9A0C; Fri, 1 Apr 2022 08:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=G5qMjCe4z3bEfBal1XdVkrll0up+2huRFDPmKjNNvZM=; b=TgneTeH3lNOFIHdWtZMCCTWIAX yEqFi3B5jt3eClafhbCGoxz40Vf6IYzwlNxwCodpuo0rGpCumzaq8CM8yiSasOFyA26K/jKnaKW6O pubylpzYuzb9VELrBAQisOclpTofg6t4grXTgSgj+VbtMyVBjkrHRwfpO13KW8ciEf9U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1naIQg-00DgwX-L0; Fri, 01 Apr 2022 16:39:10 +0200 Date: Fri, 1 Apr 2022 16:39:10 +0200 From: Andrew Lunn To: "Allan W. Nielsen" Cc: Horatiu Vultur , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, Divya.Koppera@microchip.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net v2 0/3] net: phy: micrel: Remove latencies support lan8814 Message-ID: References: <20220401110522.3418258-1-horatiu.vultur@microchip.com> <20220401141120.imsolvsl2xpnnf4q@lx-anielsen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220401141120.imsolvsl2xpnnf4q@lx-anielsen> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 01, 2022 at 04:11:20PM +0200, Allan W. Nielsen wrote: > On 01.04.2022 14:57, Andrew Lunn wrote: > > On Fri, Apr 01, 2022 at 01:05:19PM +0200, Horatiu Vultur wrote: > > > Remove the latencies support both from the PHY driver and from the DT. > > > The IP already has some default latencies values which can be used to get > > > decent results. It has the following values(defined in ns): > > > rx-1000mbit: 429 > > > tx-1000mbit: 201 > > > rx-100mbit: 2346 > > > tx-100mbit: 705 > > > > So one alternative option here is that ptp4l looks at > > > > /sys/class/net//phydev/phy_id > > > > to identify the PHY, listens to netlink messages to determine the link > > speed and then applies the correction itself in user space. That gives > > you a pretty generic solution, works for any existing PHY and pretty > > much any existing kernel version. And if you want board specific > > values you can override them in the ptp4l configuration file. > > I think it is good to have both options. If you want PTP4L to compensate > in user-space, do not call the tunable, if you want to HW to compensate, > call the tunable (this is useful both for users using ptp4l and other > ptpimplementations). > > If system behaves strange, it is easy to see what delays has been > applied. I don't actually think that is true. How wound i know that > > > rx-1000mbit: 429 > > > tx-1000mbit: 201 > > > rx-100mbit: 2346 > > > tx-100mbit: 705 are the default values? I cannot just look at them and obviously see they are not the default values. I would need to learn what the default values are of every PHY in linux which allows the PHY to perform a correction. Are you also saying that ptp4l needs to read the values from the driver, calculate the differ from the defaults, and then apply that difference to the correction specified in the configuration file it will apply in userspace? Does the PTP API enforce mutual exclusion for a device? Can there be multiple applications running on an interface, some which assume the hardware is configured to perform corrections and some which will apply the correction in user space? Richard? Andrew