From: Alexander Gordeev <lasaine@lvk.cs.msu.su>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: linux-kernel@vger.kernel.org, linuxpps@ml.enneenne.com,
"Nikita V. Youshchenko" <yoush@cs.msu.su>,
stas@lvk.cs.msu.su, john stultz <johnstul@us.ibm.com>,
Randy Dunlap <rdunlap@xenotime.net>,
Andrew Morton <akpm@linux-foundation.org>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
Avi Kivity <avi@redhat.com>, Reg Clemens <clemens@dwf.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Dave Jones <davej@redhat.com>,
linux-doc@vger.kernel.org
Subject: Re: [PATCHv2 4/6] pps: add kernel consumer support
Date: Mon, 1 Mar 2010 13:48:01 +0300 [thread overview]
Message-ID: <20100301134801.319a6c3b@desktopvm.lvknet> (raw)
In-Reply-To: <20100301082916.GJ3671@enneenne.com>
[-- Attachment #1: Type: text/plain, Size: 2886 bytes --]
On Mon, 1 Mar 2010 09:29:16 +0100
Rodolfo Giometti <giometti@enneenne.com> wrote:
> On Wed, Feb 24, 2010 at 03:28:15PM +0300, Alexander Gordeev wrote:
> > Add an optional feature of PPSAPI, kernel consumer support, which uses
> > the added hardpps() function.
> >
> > Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
>
> Acked-by: Rodolfo Giometti <giometti@linux.it>
>
> However see the note below.
>
> > ---
> > Documentation/ioctl/ioctl-number.txt | 2 +-
> > drivers/pps/kapi.c | 26 +++++++++++++
> > drivers/pps/pps.c | 67 +++++++++++++++++++++++++++++++++-
> > include/linux/pps.h | 7 ++++
> > include/linux/pps_kernel.h | 6 +++
> > 5 files changed, 106 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
> > index 9473749..d68718b 100644
> > --- a/Documentation/ioctl/ioctl-number.txt
> > +++ b/Documentation/ioctl/ioctl-number.txt
> > @@ -152,7 +152,7 @@ Code Seq# Include File Comments
> > 'p' 40-7F linux/nvram.h
> > 'p' 80-9F user-space parport
> > <mailto:tim@cyberelk.net>
> > -'p' a1-a4 linux/pps.h LinuxPPS
> > +'p' a1-a5 linux/pps.h LinuxPPS
> > <mailto:giometti@linux.it>
> > 'q' 00-1F linux/serio.h
> > 'q' 80-FF Internet PhoneJACK, Internet LineJACK
> > diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
> > index b87f699..5871744 100644
> > --- a/drivers/pps/kapi.c
> > +++ b/drivers/pps/kapi.c
> > @@ -25,6 +25,7 @@
> > #include <linux/init.h>
> > #include <linux/sched.h>
> > #include <linux/time.h>
> > +#include <linux/timex.h>
> > #include <linux/spinlock.h>
> > #include <linux/idr.h>
> > #include <linux/fs.h>
> > @@ -37,6 +38,12 @@
> > DEFINE_SPINLOCK(pps_idr_lock);
> > DEFINE_IDR(pps_idr);
> >
> > +/* state variables to bind kernel consumer */
> > +/* PPS API (RFC 2783): current source and mode for ``kernel consumer'' */
> > +DEFINE_SPINLOCK(pps_kc_hardpps_lock);
> > +void *pps_kc_hardpps_dev; /* some unique pointer to device */
> > +int pps_kc_hardpps_mode; /* mode bits for kernel consumer */
> > +
> > /*
> > * Local functions
> > */
> > @@ -248,6 +255,15 @@ void pps_unregister_source(int source)
> > }
> > spin_unlock_irq(&pps_idr_lock);
> >
> > + spin_lock_irq(&pps_kc_hardpps_lock);
> > + if (pps == pps_kc_hardpps_dev) {
> > + pps_kc_hardpps_mode = 0;
> > + pps_kc_hardpps_dev = NULL;
> > + spin_unlock_irq(&pps_kc_hardpps_lock);
> > + pr_info("unbound kernel consumer on device removal\n");
> > + } else
> > + spin_unlock_irq(&pps_kc_hardpps_lock);
> > +
>
> I suppose you are using such if-else schema due the fact pr_info is
> too slow to be executed with helded spinlock, arent't you? :)
Yes, indeed. Is it ok? :)
--
Alexander
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
next prev parent reply other threads:[~2010-03-01 10:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-24 12:28 [PATCHv2 0/6] pps: time synchronization over LPT Alexander Gordeev
2010-02-24 12:28 ` [PATCHv2 1/6] ntp: add hardpps implementation Alexander Gordeev
2010-03-01 8:14 ` Rodolfo Giometti
2010-03-01 10:43 ` Alexander Gordeev
2010-02-24 12:28 ` [PATCHv2 2/6] pps: unify timestamp gathering Alexander Gordeev
2010-03-01 8:18 ` Rodolfo Giometti
2010-02-24 12:28 ` [PATCHv2 3/6] pps: capture MONOTONIC_RAW timestamps as well Alexander Gordeev
2010-03-01 8:19 ` Rodolfo Giometti
2010-02-24 12:28 ` [PATCHv2 4/6] pps: add kernel consumer support Alexander Gordeev
2010-03-01 8:29 ` Rodolfo Giometti
2010-03-01 10:48 ` Alexander Gordeev [this message]
2010-02-24 12:28 ` [PATCHv2 5/6] pps: add parallel port PPS signal generator Alexander Gordeev
2010-03-01 8:38 ` Rodolfo Giometti
2010-03-01 10:51 ` Alexander Gordeev
2010-02-24 12:28 ` [PATCHv2 6/6] pps: add parallel port PPS client Alexander Gordeev
2010-03-01 8:42 ` Rodolfo Giometti
2010-03-09 3:25 ` [PATCHv2 0/6] pps: time synchronization over LPT john stultz
2010-03-22 20:42 ` Alexander Gordeev
2010-03-22 21:01 ` john stultz
2010-03-22 21:37 ` Alexander Gordeev
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=20100301134801.319a6c3b@desktopvm.lvknet \
--to=lasaine@lvk.cs.msu.su \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=avi@redhat.com \
--cc=clemens@dwf.com \
--cc=davej@redhat.com \
--cc=giometti@enneenne.com \
--cc=johnstul@us.ibm.com \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxpps@ml.enneenne.com \
--cc=mchehab@redhat.com \
--cc=rdunlap@xenotime.net \
--cc=stas@lvk.cs.msu.su \
--cc=yoush@cs.msu.su \
/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