[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100301134801.319a6c3b@desktopvm.lvknet>
Date: Mon, 1 Mar 2010 13:48:01 +0300
From: Alexander Gordeev <lasaine@....cs.msu.su>
To: Rodolfo Giometti <giometti@...eenne.com>
Cc: linux-kernel@...r.kernel.org, linuxpps@...enneenne.com,
"Nikita V. Youshchenko" <yoush@...msu.su>, stas@....cs.msu.su,
john stultz <johnstul@...ibm.com>,
Randy Dunlap <rdunlap@...otime.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Mauro Carvalho Chehab <mchehab@...hat.com>,
Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>,
Avi Kivity <avi@...hat.com>, Reg Clemens <clemens@....com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Dave Jones <davej@...hat.com>, linux-doc@...r.kernel.org
Subject: Re: [PATCHv2 4/6] pps: add kernel consumer support
On Mon, 1 Mar 2010 09:29:16 +0100
Rodolfo Giometti <giometti@...eenne.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@....cs.msu.su>
>
> Acked-by: Rodolfo Giometti <giometti@...ux.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@...erelk.net>
> > -'p' a1-a4 linux/pps.h LinuxPPS
> > +'p' a1-a5 linux/pps.h LinuxPPS
> > <mailto:giometti@...ux.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
Download attachment "signature.asc" of type "application/pgp-signature" (490 bytes)
Powered by blists - more mailing lists