Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-09-22 Thread Richard Cochran
On Tue, Sep 21, 2010 at 04:47:45PM -0400, Kyle Moffett wrote: > Well how about something much more straightforward: I am about to post another patch set for discussion, so please comment on it when it appears. Thanks, Richard ___ Linuxppc-dev mailing li

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-09-21 Thread Kyle Moffett
On Fri, Aug 27, 2010 at 18:30, John Stultz wrote: > On one side, there is the view that the kernel should abstract and hide > the hardware details to increase app portability. And the other is that > the raw hardware details should be exposed, so the OS stays out of the > way. > > Neither of these

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-09-21 Thread Stephan Gatzka
Hi Richard, 1. Character device 2. POSIX clock with dynamic ids Please, just take your pick ;^) Just to reopen this nearly dead but very interesting thread: I'm happy with every solution that has no impact on the accuracy of the PTP clock. If I can choose, I would prefer the POSIX clock wi

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-09-05 Thread Richard Cochran
On Fri, Aug 27, 2010 at 03:30:39PM -0700, John Stultz wrote: > On Fri, 2010-08-27 at 14:38 +0200, Richard Cochran wrote: > > We have not introduced new PPS interface. We use existing PPS subsystem. > > Doesn't the pps subsystem have its own way to control the pps signal > interrupt? I'm not totall

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-29 Thread Christian Riesch
Alan Cox wrote: The master node in a PTP network probably takes its time from a precise external time source, like GPS. The GPS provides a 1 PPS directly to the PTP clock hardware, which latches the PTP hardware clock time on the PPS edge. This provides one sample as input to a clock servo (in th

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread John Stultz
On Fri, 2010-08-27 at 14:38 +0200, Richard Cochran wrote: > On Mon, Aug 23, 2010 at 01:08:45PM -0700, john stultz wrote: > > On Thu, 2010-08-19 at 07:55 +0200, Richard Cochran wrote: > > > The clockid_t CLOCK_PTP will be arch-neutral. > > > > Sure, but are they conceptually neutral? There are othe

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread John Stultz
On Fri, 2010-08-27 at 14:03 +0200, Arnd Bergmann wrote: > On Friday 27 August 2010, Richard Cochran wrote: > > On Mon, Aug 23, 2010 at 01:21:39PM -0700, john stultz wrote: > > > On Thu, 2010-08-19 at 17:38 +0200, Richard Cochran wrote: > > > > On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread John Stultz
On Fri, 2010-08-27 at 13:08 +0200, Richard Cochran wrote: > On Mon, Aug 23, 2010 at 01:21:39PM -0700, john stultz wrote: > > On Thu, 2010-08-19 at 17:38 +0200, Richard Cochran wrote: > > > On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann wrote: > > > > My point was that a syscall is better t

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Jacob Keller
On Fri, Aug 27, 2010 at 8:06 AM, Alan Cox wrote > > > system time bimble track a source makes sense just as with NTP but > making > > > it a new clock seems the wrong model extending a non-too-bright API > when > > > you can just put the time sources in a file tree. > > > > Don't get your meaning

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Patrick Loschmidt
Hi! I'd like to add my two cents about the discussion. Just to shortly introduce myself: I'm working with PTP since version 2002 (now 2008 or PTPv2) and I'm developing matching network cards, drivers, and also sometimes a bit of the stack. I always had the problem of different HW implementations

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread M. Warner Losh
In message: <20100827140205.ga3...@riccoc20.at.omicron.at> Richard Cochran writes: : On Fri, Aug 27, 2010 at 01:41:54PM +0100, Alan Cox wrote: : > > The master node in a PTP network probably takes its time from a : > > precise external time source, like GPS. The GPS provides a 1 PPS :

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Alan Cox
> Sorry for causing confusion, but please understand "a hardware clock > with timestamping capabilities than can be used for PTP support" > whenever I wrote "PTP" or "PTP clock." Ok that makes sense. > > Well, what I just said is not entirely true. > most are bound to the PTP protocol. That may c

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Richard Cochran
On Fri, Aug 27, 2010 at 02:38:44PM +0100, Alan Cox wrote: > > 2007. If we can justify adding a clock id in this case, surely we can > > add one for PTP as well! > > But PTP isn't really a clock - its a time sync protocol. You can (and may > need to) have multiple clocks of this form on the same ho

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Alan Cox
> To tell the truth, my original motivation for the patch set was to > support PTP clocks and applications. I don't think that is such a bad ptp *clocks* > idea. After all, the adjtimex interface was added just to support NTP. > > At the same time, I can understand the desire to have a generic >

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Richard Cochran
On Fri, Aug 27, 2010 at 01:41:54PM +0100, Alan Cox wrote: > > The master node in a PTP network probably takes its time from a > > precise external time source, like GPS. The GPS provides a 1 PPS > > directly to the PTP clock hardware, which latches the PTP hardware > > clock time on the PPS edge. T

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Alan Cox
> 2007. If we can justify adding a clock id in this case, surely we can > add one for PTP as well! But PTP isn't really a clock - its a time sync protocol. You can (and may need to) have multiple clocks of this form on the same host because it's master based and you may have to deal with multiple

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Alan Cox
> The master node in a PTP network probably takes its time from a > precise external time source, like GPS. The GPS provides a 1 PPS > directly to the PTP clock hardware, which latches the PTP hardware > clock time on the PPS edge. This provides one sample as input to a > clock servo (in the PTPd)

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Alan Cox
> > So if the clock_adjtime interface is needed, it would seem best for it > > to be generic enough to support not only PTP, but also the NTP kernel > > PLL. > > For the proposed clock_adjime, what else is needed to support clock > adjustment in general? Multiple PLLs, at least with containers an

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Richard Cochran
On Mon, Aug 23, 2010 at 01:08:45PM -0700, john stultz wrote: > On Thu, 2010-08-19 at 07:55 +0200, Richard Cochran wrote: > > The clockid_t CLOCK_PTP will be arch-neutral. > > Sure, but are they conceptually neutral? There are other clock > synchronization algorithms out there. Will they need their

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Arnd Bergmann
On Friday 27 August 2010, Richard Cochran wrote: > On Mon, Aug 23, 2010 at 01:21:39PM -0700, john stultz wrote: > > On Thu, 2010-08-19 at 17:38 +0200, Richard Cochran wrote: > > > On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann wrote: > > > > Have you considered passing a struct timex inste

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Richard Cochran
On Mon, Aug 23, 2010 at 01:21:39PM -0700, john stultz wrote: > On Thu, 2010-08-19 at 17:38 +0200, Richard Cochran wrote: > > On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann wrote: > > > My point was that a syscall is better than an ioctl based interface here, > > > which I definitely still

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-27 Thread Richard Cochran
On Thu, Aug 26, 2010 at 06:57:49PM -0700, john stultz wrote: > On Wed, 2010-08-25 at 11:40 +0200, Christian Riesch wrote: > > 2) Master clock: > > We have one or more network ports. Our system has a really good clock > > (ovenized quartz crystal, an atomic clock, a GPS timing receiver...) > > and i

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-26 Thread john stultz
On Wed, 2010-08-25 at 11:40 +0200, Christian Riesch wrote: > What you describe here is only one of the use cases. If the hardware > has a single network port and operates as a PTP slave, it timestamps > the PTP packets that are sent and received and subsequently uses these > timestamps and the info

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-25 Thread Christian Riesch
On Mon, Aug 23, 2010 at 10:08 PM, john stultz wrote: > On Thu, 2010-08-19 at 07:55 +0200, Richard Cochran wrote: >> On Wed, Aug 18, 2010 at 05:12:56PM -0700, john stultz wrote: >> > Again, my knowledge in the networking stack is pretty limited. But it >> > would seem that having an interface that

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-24 Thread Stephan Gatzka
Hello! I'm curious if its possible to do the PTP hardware offset/adjustment calculation in a module internally to the kernel? That would allow the PPS interface to still be used to sync the system time, and not expose additional interfaces. Just my 2 cents on this issue. PTP is very often used i

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-23 Thread john stultz
On Thu, 2010-08-19 at 17:38 +0200, Richard Cochran wrote: > On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann wrote: > > My point was that a syscall is better than an ioctl based interface here, > > which I definitely still think. Given that John knows much more about > > clocks than I do, we

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-23 Thread john stultz
Sorry for the slow response here, I got busy with other work at the end of last week. On Thu, 2010-08-19 at 07:55 +0200, Richard Cochran wrote: > On Wed, Aug 18, 2010 at 05:12:56PM -0700, john stultz wrote: > > On Wed, 2010-08-18 at 09:19 +0200, Richard Cochran wrote: > > > The timer/alarm stuff i

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Arnd Bergmann
On Thursday 19 August 2010, Ira W. Snyder wrote: > Perhaps you were thinking of the vhost example (taken from > drivers/vhost/Kconfig): > > config VHOST_NET > tristate "Host kernel accelerator for virtio net (EXPERIMENTAL)" > depends on NET && EVENTFD && (TUN || !TUN) && (MACVTAP |

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Richard Cochran
On Thu, Aug 19, 2010 at 02:28:04PM +0200, Arnd Bergmann wrote: > My point was that a syscall is better than an ioctl based interface here, > which I definitely still think. Given that John knows much more about > clocks than I do, we still need to get agreement on the question that > he raised, whi

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Ira W. Snyder
On Thu, Aug 19, 2010 at 02:29:49PM +0200, Arnd Bergmann wrote: > On Thursday 19 August 2010, Richard Cochran wrote: > > > > On Wed, Aug 18, 2010 at 05:02:03PM +0200, Arnd Bergmann wrote: > > > You might want to use callbacks for these system calls that you > > > can register to at module load time

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Arnd Bergmann
On Thursday 19 August 2010, Richard Cochran wrote: > > On Wed, Aug 18, 2010 at 05:02:03PM +0200, Arnd Bergmann wrote: > > You might want to use callbacks for these system calls that you > > can register to at module load time, like it is done for the > > existing syscalls. > > Can you point me to

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Arnd Bergmann
On Thursday 19 August 2010, Richard Cochran wrote: > On Wed, Aug 18, 2010 at 05:12:56PM -0700, john stultz wrote: > > On Wed, 2010-08-18 at 09:19 +0200, Richard Cochran wrote: > > > The timer/alarm stuff is "ancillary" and is not at all necessary. It > > > is just a "nice to have." I will happily r

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-19 Thread Richard Cochran
On Wed, Aug 18, 2010 at 05:02:03PM +0200, Arnd Bergmann wrote: > You might want to use callbacks for these system calls that you > can register to at module load time, like it is done for the > existing syscalls. Can you point me to a specific example? > The simpler way (e.g. for testing) is usin

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-18 Thread Richard Cochran
On Wed, Aug 18, 2010 at 05:12:56PM -0700, john stultz wrote: > On Wed, 2010-08-18 at 09:19 +0200, Richard Cochran wrote: > > The timer/alarm stuff is "ancillary" and is not at all necessary. It > > is just a "nice to have." I will happily remove it, if it is too > > troubling for people. > > If th

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-18 Thread john stultz
On Wed, 2010-08-18 at 09:19 +0200, Richard Cochran wrote: > On Tue, Aug 17, 2010 at 05:22:43PM -0700, john stultz wrote: >> > > So while to me, it think it would be more ideal (or maybe just less > > different) to have a read-only interface (like the RTC), leaving PTPd to > > manage offset calculat

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-18 Thread Arnd Bergmann
On Wednesday 18 August 2010, Richard Cochran wrote: > On Tue, Aug 17, 2010 at 01:36:29PM +0200, Arnd Bergmann wrote: > > On Tuesday 17 August 2010, Richard Cochran wrote: > > > I've been looking at offering the PTP clock as a posix clock, and it > > > is not as hard as I first thought. The PTP cloc

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-18 Thread Richard Cochran
On Tue, Aug 17, 2010 at 01:36:29PM +0200, Arnd Bergmann wrote: > On Tuesday 17 August 2010, Richard Cochran wrote: > > I've been looking at offering the PTP clock as a posix clock, and it > > is not as hard as I first thought. The PTP clock or clocks just have > > to be registered as one of the pos

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-18 Thread Richard Cochran
On Tue, Aug 17, 2010 at 05:22:43PM -0700, john stultz wrote: > Why would system time not be adjusted to the PTP time? > > This is my main concern, that we're presenting a fractured API to > userland. Suddenly there isn't just system time, but ptp time as well, > and possibly multiple different ptp

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread john stultz
On Tue, 2010-08-17 at 13:36 +0200, Arnd Bergmann wrote: > On Tuesday 17 August 2010, Richard Cochran wrote: > > On Tue, Aug 17, 2010 at 09:25:55AM +, Arnd Bergmann wrote: > > > Another difference is that we generally use ioctl for devices that can > > > be enumerated, while syscalls are for sys

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread john stultz
On Tue, 2010-08-17 at 10:53 +0200, Richard Cochran wrote: > On Mon, Aug 16, 2010 at 12:24:48PM -0700, john stultz wrote: > > 3) I'm not sure I see the benefit of being able to have multiple > > frequency corrected time domains. In other words, what benefit would > > you get from adjusting a PTP cl

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread Arnd Bergmann
On Tuesday 17 August 2010, Richard Cochran wrote: > On Tue, Aug 17, 2010 at 09:25:55AM +, Arnd Bergmann wrote: > > Another difference is that we generally use ioctl for devices that can > > be enumerated, while syscalls are for system services that are not tied to > > a specific device. This ar

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread Richard Cochran
On Tue, Aug 17, 2010 at 09:25:55AM +, Arnd Bergmann wrote: > Another difference is that we generally use ioctl for devices that can > be enumerated, while syscalls are for system services that are not tied to > a specific device. This argument works both ways for PTP IMHO: On the one > hand you

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread Arnd Bergmann
On Tuesday 17 August 2010, Richard Cochran wrote: > > Why did you not want to add syscalls? Adding ioctls instead of syscalls > > does not make the interface better, just less visible. > > I bet that, had I posted patch set with new syscalls, someone would > have said, "You are adding new syscalls

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread Richard Cochran
On Mon, Aug 16, 2010 at 12:24:48PM -0700, john stultz wrote: > 3) I'm not sure I see the benefit of being able to have multiple > frequency corrected time domains. In other words, what benefit would > you get from adjusting a PTP clock's frequency instead of just > adjusting the system's time freq

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-17 Thread Richard Cochran
On Mon, Aug 16, 2010 at 09:59:39PM +0200, Arnd Bergmann wrote: > Why does it matter how long it takes to read the clock? I wasn't thinking > of replacing the system clock with this, just exposing the additional > clock as a new clockid_t value that can be accessed using the existing > syscalls. Ok

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread Arnd Bergmann
On Monday 16 August 2010 21:00:03 Richard Cochran wrote: > > On Mon, Aug 16, 2010 at 04:26:23PM +0200, Arnd Bergmann wrote: > > Have you considered integrating the subsystem into the Posix clock/timer > > framework? > > Yes, but see below. > > > I can't really tell from reading the source if th

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread john stultz
On Mon, Aug 16, 2010 at 12:24 PM, john stultz wrote: > On Mon, Aug 16, 2010 at 4:17 AM, Richard Cochran > A few comments below > >> +** PTP user space API >> + >> +   The class driver creates a character device for each registered PTP >> +   clock. User space programs may control the clock usi

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread john stultz
On Mon, Aug 16, 2010 at 4:17 AM, Richard Cochran wrote: > This patch adds an infrastructure for hardware clocks that implement > IEEE 1588, the Precision Time Protocol (PTP). A class driver offers a > registration method to particular hardware clock drivers. Each clock is > exposed to user space a

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread Richard Cochran
On Mon, Aug 16, 2010 at 04:26:23PM +0200, Arnd Bergmann wrote: > Have you considered integrating the subsystem into the Posix clock/timer > framework? Yes, but see below. > I can't really tell from reading the source if this is possible or > not, but my feeling is that if it can be done, that wo

Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread Arnd Bergmann
On Monday 16 August 2010, Richard Cochran wrote: > This patch adds an infrastructure for hardware clocks that implement > IEEE 1588, the Precision Time Protocol (PTP). A class driver offers a > registration method to particular hardware clock drivers. Each clock is > exposed to user space as a char

[PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.

2010-08-16 Thread Richard Cochran
This patch adds an infrastructure for hardware clocks that implement IEEE 1588, the Precision Time Protocol (PTP). A class driver offers a registration method to particular hardware clock drivers. Each clock is exposed to user space as a character device with ioctls that allow tuning of the PTP clo