linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Tristram.Ha@microchip.com, ceggers@arri.de, kuba@kernel.org,
	andrew@lunn.ch, robh+dt@kernel.org, vivien.didelot@gmail.com,
	davem@davemloft.net, kurt.kanzenbach@linutronix.de,
	george.mccollister@gmail.com, marex@denx.de,
	helmut.grohne@intenta.de, pbarker@konsulko.com,
	Codrin.Ciubotariu@microchip.com, Woojung.Huh@microchip.com,
	UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x
Date: Sat, 21 Nov 2020 17:36:40 -0800	[thread overview]
Message-ID: <20201122013640.GA997@hoboy.vegasvil.org> (raw)
In-Reply-To: <20201121012611.r6h5zpd32pypczg3@skbuf>

On Sat, Nov 21, 2020 at 03:26:11AM +0200, Vladimir Oltean wrote:
> On Thu, Nov 19, 2020 at 06:51:15PM +0000, Tristram.Ha@microchip.com wrote:
> > The receive and transmit latencies are different for different connected speed.  So the
> > driver needs to change them when the link changes.  For that reason the PTP stack
> > should not use its own latency values as generally the application does not care about
> > the linked speed.
> 
> The thing is, ptp4l already has ingressLatency and egressLatency
> settings, and I would not be surprised if those config options would get
> extended to cover values at multiple link speeds.
> 
> In the general case, the ksz9477 MAC could be attached to any external
> PHY, having its own propagation delay characteristics, or any number of
> other things that cause clock domain crossings. I'm not sure how feasible
> it is for the kernel to abstract this away completely, and adjust
> timestamps automatically based on any and all combinations of MAC and
> PHY. Maybe this is just wishful thinking.

The idea that the driver will correctly adjust time stamps according
to link speed sounds nice in theory, but in practice it fails.  There
is a at least one other driver that attempted this, but, surprise,
surprise, the hard coded correction values turned out to be wrong.

I think the best way would be to let user space monitor the link speed
and apply the matching correction value.  That way, we avoid bogus,
hard coded values in kernel space.  (This isn't implemented in
linuxptp, but it certainly could be.)

Thanks,
Richard

  reply	other threads:[~2020-11-22  1:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 20:30 [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 01/12] dt-bindings: net: dsa: convert ksz bindings document to yaml Christian Eggers
2020-11-19 13:42   ` Rob Herring
2020-11-19 13:48   ` Rob Herring
2020-11-19 20:22     ` Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 02/12] net: dsa: microchip: support for "ethernet-ports" node Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 03/12] net: dsa: microchip: rename ksz9477.c to ksz9477_main.c Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 04/12] dt-bindings: net: dsa: microchip,ksz: add interrupt property Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 05/12] net: dsa: microchip: ksz9477: move chip reset to ksz9477_switch_init() Christian Eggers
2020-11-20 22:49   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 06/12] net: dsa: microchip: ksz9477: basic interrupt support Christian Eggers
2020-11-20 23:03   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 07/12] net: dsa: microchip: ksz9477: add Posix clock support for chip PTP clock Christian Eggers
2020-11-20 23:14   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 08/12] net: ptp: add helper for one-step P2P clocks Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 09/12] net: dsa: microchip: ksz9477: initial hardware time stamping support Christian Eggers
2020-11-20 23:27   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 10/12] net: dsa: microchip: ksz9477: remaining " Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 11/12] net: dsa: microchip: ksz9477: add Pulse Per Second (PPS) support Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 12/12] net: dsa: microchip: ksz9477: add periodic output support Christian Eggers
2020-11-20 23:48   ` Vladimir Oltean
2020-11-18 23:40 ` [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x Vladimir Oltean
2020-11-19  5:28   ` Christian Eggers
2020-11-19 18:51     ` Tristram.Ha
2020-11-19 20:16       ` Christian Eggers
2020-11-21  1:26       ` Vladimir Oltean
2020-11-22  1:36         ` Richard Cochran [this message]
2020-11-22  1:53         ` Richard Cochran
2020-11-25 21:08       ` Christian Eggers
2020-11-26 16:53         ` Christian Eggers
2020-11-30 21:01           ` Tristram.Ha
2020-11-30 22:28             ` Richard Cochran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201122013640.GA997@hoboy.vegasvil.org \
    --to=richardcochran@gmail.com \
    --cc=Codrin.Ciubotariu@microchip.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=ceggers@arri.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=george.mccollister@gmail.com \
    --cc=helmut.grohne@intenta.de \
    --cc=kuba@kernel.org \
    --cc=kurt.kanzenbach@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pbarker@konsulko.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).