From: Richard Cochran <richardcochran@gmail.com>
To: Jonathan Richardson <jonathar@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Darren Edamura <dedamura@broadcom.com>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Scott Branden <sbranden@broadcom.com>,
Pawel Moll <pawel.moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Ray Jui <rjui@broadcom.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
bcm-kernel-feedback-list@broadcom.com,
Kumar Gala <galak@codeaurora.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] misc: Add initial Digital Timing Engine (DTE) driver for cygnus
Date: Wed, 13 May 2015 22:27:16 +0200 [thread overview]
Message-ID: <20150513202716.GA15878@localhost.localdomain> (raw)
In-Reply-To: <5553AAEA.30503@broadcom.com>
On Wed, May 13, 2015 at 12:50:02PM -0700, Jonathan Richardson wrote:
> ptp_clock_adjtime() casts it to an unsigned and returns an error:
>
> if ((unsigned long) ts.tv_nsec >= NSEC_PER_SEC)
> return -EINVAL;
The value of a timeval is the sum of its fields, but the field tv_usec
must always be non-negative. The tv_sec field can be negative. So,
your application simply needs to do this:
if (tx.time.tv_usec < 0) {
tx.time.tv_sec -= 1;
tx.time.tv_usec += 1000000000;
}
> >> IRQ interval: I mentioned before that we may be able to calculate the
> >> isochronous interrupt rate automatically but this isn't possible because
> >> the DTE doesn't know the frequency of the clients. One solution is to
> >> use the 'PTP_PEROUT_REQUEST' ioctl to set a periodic timer frequency.
> >> Not really a timer but good enough for our purposes.
> >
> > As I said in my other reply, I don't understand what the problem is.
>
> See reply to previous email. We can use this ioctl or add a new one as
> Arnd suggested. It doesn't matter to me.
Still makes no sense. Why should the interrupt rate depend on the
clock frequency?
If the ISR is delivering batches of time stamps, then the interrupt
rate aught to be the highest rate that the system can support.
> >> Set divider: There is no ability to set a frequency or do anything to a
> >> channel. We could re-use the PTP_EXTTS_REQUEST ioctl but extend 'struct
> >> ptp_extts_request' by using the reserved field rsv to allow setting an
> >> integer value representing either a frequency or divider value in our
> >> case - some value to configure a channel. A new flag would have to be
> >> added to the existing PTP_ENABLE_FEATURE, RISING and FALLING EDGE.
> >
> > I don't get this, either.
>
> See reply to previous email.
Didn't help me too much :(
> > The PTP interface supports poll/read just fine already.
>
> Yes that's why I wanted to re-use it. As it currently is, it's not going
> to work for reasons I explained in previous follow up yesterday:
>
> http://marc.info/?l=linux-kernel&m=143147907431947&w=2
You said:
one user space process would have to read timestamps for all
channels/clients and then leave it up to user space IPC to get them
to other processes, which isn't great.
I disagree. I think having tons of fifos isn't great.
Ideally, there will be kernel consumers for most of the channels, and
they will forward the time stamps in a way appropriate to their
subsystem. For example, network devices will use so_timestamping.
Any "leftover" channels can go through the generic PTP interface.
Thanks,
Richard
next prev parent reply other threads:[~2015-05-13 20:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 23:22 [PATCH 0/2] Add DTE driver for Cygnus Jonathan Richardson
[not found] ` <1429744923-2007-1-git-send-email-jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-04-22 23:22 ` [PATCH 1/2] misc: Add DT binding for cygnus Digital Timing Engine (DTE) driver Jonathan Richardson
2015-04-22 23:22 ` [PATCH 2/2] misc: Add initial Digital Timing Engine (DTE) driver for cygnus Jonathan Richardson
[not found] ` <1429744923-2007-3-git-send-email-jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-04-23 8:04 ` Arnd Bergmann
2015-04-23 18:07 ` Jonathan Richardson
2015-05-01 19:01 ` Jonathan Richardson
2015-05-01 19:30 ` One Thousand Gnomes
2015-05-01 19:40 ` Arnd Bergmann
2015-05-08 20:02 ` Jonathan Richardson
[not found] ` <554D1649.2030106-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-05-13 1:03 ` Jonathan Richardson
2015-05-13 12:19 ` Arnd Bergmann
2015-05-13 14:37 ` Richard Cochran
2015-05-13 14:51 ` Richard Cochran
2015-05-13 15:35 ` Richard Cochran
[not found] ` <20150513153544.GC2065-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-05-13 19:50 ` Jonathan Richardson
2015-05-13 20:27 ` Richard Cochran [this message]
2015-05-13 23:25 ` Jonathan Richardson
[not found] ` <5553DD7D.8090905-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-05-14 11:30 ` Richard Cochran
2015-05-20 23:38 ` Jonathan Richardson
2015-05-21 6:33 ` Richard Cochran
2015-05-21 17:48 ` Jonathan Richardson
[not found] ` <5543CD73.2030902-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-05-13 15:21 ` Richard Cochran
[not found] ` <20150513152130.GB2065-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2015-05-13 19:38 ` Jonathan Richardson
2015-05-13 19:42 ` Richard Cochran
2015-05-13 19:39 ` Jonathan Richardson
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=20150513202716.GA15878@localhost.localdomain \
--to=richardcochran@gmail.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dedamura@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jonathar@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rjui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=sbranden@broadcom.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).