Re: [RFC PATCH v3 5/7] virtio_rtc: Add PTP clocks

2024-06-20 Thread David Woodhouse
On Thu, 2024-06-20 at 14:01 +0200, Peter Hilber wrote: > On 15.06.24 10:01, David Woodhouse wrote: > > On Mon, 2023-12-18 at 08:38 +0100, Peter Hilber wrote: > > > > > > +   ret = viortc_hw_xtstamp_params(_counter, _id); > > > +   if (ret) > > > +   return ret; > > > + > > > + 

Re: [RFC PATCH v3 5/7] virtio_rtc: Add PTP clocks

2024-06-20 Thread Peter Hilber
On 15.06.24 10:01, David Woodhouse wrote: > On Mon, 2023-12-18 at 08:38 +0100, Peter Hilber wrote: >> >> + ret = viortc_hw_xtstamp_params(_counter, _id); >> + if (ret) >> + return ret; >> + >> + ktime_get_snapshot(_begin); >> + if (history_begin.cs_id !=

Re: [RFC PATCH v3 5/7] virtio_rtc: Add PTP clocks

2024-06-15 Thread David Woodhouse
On Mon, 2023-12-18 at 08:38 +0100, Peter Hilber wrote: > > +   ret = viortc_hw_xtstamp_params(_counter, _id); > +   if (ret) > +   return ret; > + > +   ktime_get_snapshot(_begin); > +   if (history_begin.cs_id != cs_id) > +   return -EOPNOTSUPP; I think

[RFC PATCH v3 5/7] virtio_rtc: Add PTP clocks

2023-12-17 Thread Peter Hilber
Expose the virtio_rtc clocks as PTP clocks to userspace, similar to ptp_kvm. virtio_rtc can expose multiple clocks, e.g. a UTC clock and a monotonic clock. Userspace should distinguish different clocks through the name assigned by the driver. A udev rule such as the following can be used to get a