[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100805164829.33855c7a@desktopvm.lvknet>
Date: Thu, 5 Aug 2010 16:48:29 +0400
From: Alexander Gordeev <lasaine@....cs.msu.su>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
"Nikita V\. Youshchenko" <yoush@...msu.su>,
linuxpps@...enneenne.com, Rodolfo Giometti <giometti@...eenne.com>,
john stultz <johnstul@...ibm.com>
Subject: Re: [PATCHv3 15/16] pps: add parallel port PPS client
В Wed, 4 Aug 2010 16:34:30 -0700
Andrew Morton <akpm@...ux-foundation.org> пишет:
> On Thu, 5 Aug 2010 01:06:52 +0400
> Alexander Gordeev <lasaine@....cs.msu.su> wrote:
>
> > Add parallel port PPS client. It uses a standard method for capturing
> > timestamps for assert edge transitions: getting a timestamp soon after
> > an interrupt has happened. This is not a very precise source of time
> > information due to interrupt handling delays. However, timestamps for
> > clear edge transitions are much more precise because the interrupt
> > handler continuously polls hardware port until the transition is done.
> > Hardware port operations require only about 1us so the maximum error
> > should not exceed this value. This was my primary goal when developing
> > this client.
> > Clear edge capture could be disabled using clear_wait parameter.
> >
> >
> > ...
> >
> > +
> > +#define SIGNAL_IS_SET(port) \
> > + ((port->ops->read_status(port) & PARPORT_STATUS_ACK) != 0)
>
> This could (and hence should) be implemented in a regular old C
> function.
Ok, thanks!
> >
> > ...
> >
> > +{
> > + struct pps_client_pp *device;
> > + struct pps_source_info info = {
> > + .name = DRVNAME,
> > + .path = "",
> > + .mode = PPS_CAPTUREBOTH | \
> > + PPS_OFFSETASSERT | PPS_OFFSETCLEAR | \
> > + PPS_ECHOASSERT | PPS_ECHOCLEAR | \
> > + PPS_CANWAIT | PPS_TSFMT_TSPEC,
> > + .echo = pps_echo,
> > + .owner = THIS_MODULE,
> > + .dev = NULL
> > + };
> > +
> > + device = kzalloc(sizeof(struct pps_client_pp), GFP_KERNEL);
> > + if (!device) {
> > + pr_err(DRVNAME ": memory allocation failed, not attaching\n");
> > + return;
>
> eww. parport_driver.attach() returns void so there's no way to
> propagate the error code back. That sucks a bit.
IMHO, the whole parport thing currently sucks quite a bit.
--
Alexander
Download attachment "signature.asc" of type "application/pgp-signature" (490 bytes)
Powered by blists - more mailing lists