From: Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: John Stultz <johnstul-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Rodolfo Giometti <giometti-k2GhghHVRtY@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Krzysztof Halasa <khc-9GfyWEdoJtJmR6Xm/wNWPw@public.gmane.org>
Subject: Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.
Date: Mon, 6 Sep 2010 08:33:27 +0200 [thread overview]
Message-ID: <20100906063327.GA4549@riccoc20.at.omicron.at> (raw)
In-Reply-To: <1282948239.2268.155.camel@jstultz-laptop>
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 totally sure here, but given your point above that
> having multiple pps events it seems like they should be selectable. It
> seems something that we'd want to control via the global pps interface,
> rather then having a pps-enable flag on every random bit of hardware
> that can support it.
The PPS subsystem offers no way to disable PPS interrupts.
> > > Same for the timestamps and periodic output (ie: and how do they differ
> > > from reading or setting a timer on CLOCK_PTP?)
> >
> > The posix timer calls won't work:
> >
> > I have a PTP hardware clocks with multiple external timestamp
> > channels. Using timer_gettime, how can I specify (or decode) the
> > channel of interest to me?
>
> I guess I'm not following you here. Again, I'm not super familiar with
> the hardware involved. Could you clarify a bit more? What do you mean by
> external timestamp? Is this what is used on the packet timestamping?
No, the packet timestamp occurs in the PHY, MAC, or on the MII bus and
is an essential feature to support the PTP.
An external timestamp is just a wire going into the clock and is an
optional feature to make the clock more useful. The clock can latch
the current time value when an edge is dectected on the wire. Using
external timestamps, you correlate real world events with the absolute
time in the clock.
Typically, a clock offers two or more such input channels (wires), but
timer_gettime does not offer a way to differentiate between them, and
thus is not suitable.
> The posix clock id interface is frustrating because the flat static
> enumeration is really limiting.
>
> I wonder if a dynamic enumeration for posix clocks would be possibly a
> way to go?
I am perfectly happy with this.
> In other words, a driver registers a clock with the system, and the
> system reserves a clock_id for it from the designated available pool and
> assigns it back. Then userland could query the driver via something like
> sysfs to get the clockid for the hardware.
>
> Would that maybe work?
I have now posted a sample implementation of this idea. Do you like it?
> > The sysfs will include one class device for each PTP clock. Each clock
> > has a sysfs attribute with the corresponding clock id.
>
> Do you mean the clock_id # in the posix clocks namespace?
Yes.
> > I would also be happy with the character device idea already
> > posted. Just pick one of the two, and I'll resubmit the patch set...
>
> Personally, with regard to exposing the ptp clock to userland I'm more
> comfortable via the chardev. However, the posix clocks/timer api is
> really close to what you need, so I'm not totally set against it. And
> maybe the dynamic enumeration would resolve my main problems with it?
Okay, I have posted a draft of the dynamic idea. Can you support it?
> That said, with the chardev method, I don't like the idea of duplicating
> the existing time apis via a systemtime device. Dropping that from your
> earlier patch would ease the majority of my objections.
Well, the clock interface needs to offer basic services:
1. Set time
2. Get time
3. Jump offset
4. Adjust frequency
This is similar to what the posix clock and ntp API offer. Using a
chardev, should I make the ioctls really different, just for the
purpose of being different?
To me, it makes more sense to offer a familiar interface.
I was perfectly happy with the chardev idea. In fact, that is the way
I first implemented it. Now, I have also gone ahead and implemented
the dynamic posix clock idea, too.
> > At this point I would just like to go forward with one of the two
> > proposed APIs. I had modelled the character device on the posix clock
> > calls in order to make it immediately familar, and I think it is a
> > viable approach. After the lkml discussion, I think it is even cleaner
> > and nicer to just offer a new clock id.
I would like to repeat the sentiment in this last paragraph! I already
implemented and would be content with either form for the new clock
control API:
1. Character device
2. POSIX clock with dynamic ids
Please, just take your pick ;^)
Thanks,
Richard
next prev parent reply other threads:[~2010-09-06 6:33 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 11:17 [PATCH v5 0/5] ptp: IEEE 1588 clock support Richard Cochran
2010-08-16 11:17 ` [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks Richard Cochran
[not found] ` <363bd749a38d0b785d8431e591bf54c38db4c2d7.1281956490.git.richard.cochran-3mrvs1K0uXizZXS1Dc/lvw@public.gmane.org>
2010-08-16 14:26 ` Arnd Bergmann
2010-08-16 19:00 ` Richard Cochran
2010-08-16 19:59 ` Arnd Bergmann
2010-08-17 8:32 ` Richard Cochran
2010-08-17 9:25 ` Arnd Bergmann
[not found] ` <201008170925.55592.arnd-r2nGTMty4D4@public.gmane.org>
2010-08-17 10:52 ` Richard Cochran
[not found] ` <20100817105232.GA9079-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-08-17 11:36 ` Arnd Bergmann
2010-08-18 0:40 ` john stultz
[not found] ` <201008171336.29375.arnd-r2nGTMty4D4@public.gmane.org>
2010-08-18 14:04 ` Richard Cochran
2010-08-18 15:02 ` Arnd Bergmann
[not found] ` <201008181702.03384.arnd-r2nGTMty4D4@public.gmane.org>
2010-08-19 9:22 ` Richard Cochran
2010-08-19 12:29 ` Arnd Bergmann
2010-08-19 15:23 ` Ira W. Snyder
2010-08-19 15:48 ` Arnd Bergmann
2010-08-16 19:24 ` john stultz
2010-08-16 19:38 ` john stultz
[not found] ` <AANLkTik_2MKMhOuDGOmu8Kzyq-ipLe+Bxrb3FaD+Tv4U-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-17 8:53 ` Richard Cochran
2010-08-18 0:22 ` john stultz
2010-08-18 7:19 ` Richard Cochran
2010-08-19 0:12 ` john stultz
[not found] ` <1282176776.2865.100.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-08-19 5:55 ` Richard Cochran
2010-08-19 12:28 ` Arnd Bergmann
2010-08-19 15:38 ` Richard Cochran
2010-08-23 20:21 ` john stultz
[not found] ` <1282594899.3111.358.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-08-27 11:08 ` Richard Cochran
[not found] ` <20100827110855.GA11657-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-08-27 12:03 ` Arnd Bergmann
2010-08-27 20:56 ` John Stultz
2010-08-27 12:45 ` Alan Cox
2010-08-27 20:14 ` John Stultz
2010-08-23 20:08 ` john stultz
2010-08-24 18:30 ` Stephan Gatzka
2010-08-25 9:40 ` Christian Riesch
2010-08-27 1:57 ` john stultz
[not found] ` <1282874269.4371.74.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-08-27 7:57 ` Richard Cochran
2010-08-27 12:41 ` Alan Cox
[not found] ` <20100827134154.50eef56c-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-08-27 14:02 ` Richard Cochran
[not found] ` <20100827140205.GA3293-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-08-27 14:50 ` Alan Cox
2010-08-27 15:35 ` M. Warner Losh
2010-08-29 13:32 ` Christian Riesch
[not found] ` <1282594125.3111.344.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-08-27 12:38 ` Richard Cochran
[not found] ` <20100827123849.GC11657-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-08-27 13:38 ` Alan Cox
[not found] ` <20100827143844.646eccf6-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-08-27 14:34 ` Richard Cochran
[not found] ` <20100827143437.GB3293-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-08-27 15:06 ` Alan Cox
2010-08-27 15:21 ` Patrick Loschmidt
2010-08-27 16:17 ` Jacob Keller
2010-08-27 22:30 ` John Stultz
2010-09-06 6:33 ` Richard Cochran [this message]
[not found] ` <20100906063327.GA4549-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org>
2010-09-21 16:54 ` Stephan Gatzka
2010-09-21 20:47 ` Kyle Moffett
[not found] ` <AANLkTinRM3_kBc5S3wV=_S6P8+x7A43kz0qSYbixJYnq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-22 10:14 ` Richard Cochran
2010-08-16 11:18 ` [PATCH 2/5] ptp: Added a clock that uses the Linux system time Richard Cochran
2010-08-16 11:18 ` [PATCH 3/5] ptp: Added a clock that uses the eTSEC found on the MPC85xx Richard Cochran
2010-08-16 11:18 ` [PATCH 4/5] ptp: Added a clock driver for the IXP46x Richard Cochran
2010-08-16 11:19 ` [PATCH 5/5] ptp: Added a clock driver for the National Semiconductor PHYTER Richard Cochran
2010-08-25 21:55 ` [PATCH v5 0/5] ptp: IEEE 1588 clock support Jacob Keller
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=20100906063327.GA4549@riccoc20.at.omicron.at \
--to=richardcochran-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=giometti-k2GhghHVRtY@public.gmane.org \
--cc=johnstul-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=khc-9GfyWEdoJtJmR6Xm/wNWPw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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