All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: David Woodhouse <dwmw2@infradead.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: tglx@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	jstultz@google.com, anna-maria@linutronix.de,
	frederic@kernel.org, daniel.lezcano@kernel.org, sboyd@kernel.org,
	vladimir.oltean@nxp.com, wei.fang@nxp.com, xiaoning.wang@nxp.com,
	jonathan.lemon@gmail.com, vadim.fedorenko@linux.dev,
	yangbo.lu@nxp.com, svens@linux.ibm.com, nick.shi@broadcom.com,
	ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com,
	bcm-kernel-feedback-list@broadcom.com,
	linux-fpga@vger.kernel.org, imx@lists.linux.dev,
	linux-s390@vger.kernel.org, dust.li@linux.alibaba.com,
	xuanzhuo@linux.alibaba.com, mani@kernel.org,
	imran.shaik@oss.qualcomm.com, taniya.das@oss.qualcomm.com
Subject: Re: [PATCH v2 2/2] MAINTAINERS: update PTP maintainer entries after directory split
Date: Tue, 2 Jun 2026 22:03:34 +0800	[thread overview]
Message-ID: <335ae01a-20aa-439e-996c-d35ffd8d476a@linux.alibaba.com> (raw)
In-Reply-To: <0b3f00bbfa6bcc3badb4d1bb7845326e2dbaa1d4.camel@infradead.org>



On 2026/6/2 16:04, David Woodhouse wrote:
> On Mon, 2026-06-01 at 21:20 -0700, Richard Cochran wrote:
>>
>> Still, I don't understand why these new (non-network related ) device
>> drivers can't be implemented in their own class using
>> posix_clock_register()
>> etc.
>>
>> Any of the useful bits (like sysfs interfaces) can be refactored out
>> of ptp_clock.c and shared as a common layer.
> 
> The key is that userspace wants to get snapshots of the reference clock
> either precisely synchronized with the system clock where possible, or
> sandwiched as closely together as possible with ABA readings of the
> system, reference, system clock.
> 
> Those *are* the PTP_SYS_OFFSET* ioctls, which tools like chrony already
> support with 'refclock PHC /dev/ptp…'.
> 
> I'm not sure how factoring those out into separate POSIX AUX clocks
> would help? I think they do want to present as /dev/ptp*.
> 

I agree. Both [1] and [2] independently support the same point:
chrony's PHC refclock relies on ptp-specific ioctls (in sys_linux.c [3]),
not just clock_gettime(), so the ioctl interface needs to stay.
A posix_clock-based class wouldn't provide that.

[1] https://lore.kernel.org/netdev/2a4c9a00-45f5-4f6a-90c4-492ea1d50b79@linux.alibaba.com/
[2] https://lore.kernel.org/all/vmwwnl3zv26lmmuqp2vqltg2fudalpc5jrw7k6ifg6l5cwlk3j@i7jm62zcsl67/
[3] https://gitlab.com/chrony/chrony/-/blob/master/sys_linux.c

> There is some extra stuff we want to do for "Precision RTCs" or
> whatever we're going to call them. They might actually have a known TAI
> offset, they might convey leap second indications, we might want to set
> the kernel's CLOCK_REALTIME from them at boot. And in the case of
> VMClock, I'm working on being able to clamp the kernel's timekeeping to
> it directly².
> 
> So maybe what we want is linux/drivers/phc, to host those read-only
> devices which know real time. They can provide a simplified
> implementation; maybe *only* a function like vmclock_get_crosststamp(),
> which is just called in various different permutations by the various
> different PTP methods.
> 
> The core linux/drivers/phc code would then handle the interface to the
> kernel's core timekeeping *and* wrap them to register a PTP device that
> existing userspace can understand. And deal with the kvmclock/TSC
> awfulness where needed.
> 
> How does that sound?
> 

I think a dedicated phc core would make the classification of read-only
clocks clearer, reducing ambiguity around where they belong. I assume
direct timekeeping integration would be optional, drivers providing
only a snapshot-based crosststamp would use /dev/ptpX alone, while the
timekeeping path would require additional capability (as vmclock provides)?

> 
> ² https://lore.kernel.org/all/20260520135207.37826-9-dwmw2@infradead.org/
> 
> 
> 
> 
> 


  reply	other threads:[~2026-06-02 14:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 10:48 [PATCH v2 0/2] ptp: split non-NIC PHC drivers into the clock/timekeeping maintenance domain Wen Gu
2026-04-07 10:48 ` [PATCH v2 1/2] ptp: move emulated/virtual clock drivers into a dedicated subdirectory Wen Gu
2026-04-07 10:48 ` [PATCH v2 2/2] MAINTAINERS: update PTP maintainer entries after directory split Wen Gu
2026-04-12 15:47   ` Jakub Kicinski
2026-04-12 16:32     ` David Woodhouse
2026-04-12 16:53       ` Jakub Kicinski
2026-04-13  9:00         ` Wen Gu
2026-04-29  8:28           ` Wen Gu
2026-05-28 17:06           ` David Woodhouse
2026-06-01  0:20             ` Richard Cochran
2026-06-01  7:03               ` David Woodhouse
2026-06-01 15:20                 ` Richard Cochran
2026-06-01 16:53                   ` David Woodhouse
2026-06-02  1:52                     ` Jakub Kicinski
2026-06-02  4:20                       ` Richard Cochran
2026-06-02  8:04                         ` David Woodhouse
2026-06-02 14:03                           ` Wen Gu [this message]
2026-06-02 17:15                             ` David Woodhouse
2026-06-03  2:03                           ` Jakub Kicinski
2026-06-03 22:55                             ` David Woodhouse
2026-06-02  8:51                     ` Wen Gu

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=335ae01a-20aa-439e-996c-d35ffd8d476a@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=ajay.kaher@broadcom.com \
    --cc=alexey.makhalov@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anna-maria@linutronix.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=dwmw2@infradead.org \
    --cc=edumazet@google.com \
    --cc=frederic@kernel.org \
    --cc=imran.shaik@oss.qualcomm.com \
    --cc=imx@lists.linux.dev \
    --cc=jonathan.lemon@gmail.com \
    --cc=jstultz@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nick.shi@broadcom.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sboyd@kernel.org \
    --cc=svens@linux.ibm.com \
    --cc=taniya.das@oss.qualcomm.com \
    --cc=tglx@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=yangbo.lu@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.