[fprint] fprintd and fpi_timeout_add
Sergio Cerlesi
sergio.cerlesi at gmail.com
Wed Feb 16 10:50:12 GMT 2011
Hi Bastien,
patch attached. Tell me if the format isn't correct.
Bye
Sergio
Il giorno mar, 15/02/2011 alle 20.47 +0000, Bastien Nocera ha scritto:
> Hey Sergio,
>
> On Tue, 2011-02-15 at 16:38 +0100, sergio cerlesi wrote:
> > Hi Daniel, Bastien,
> >
> > i found the bug!
> >
> > On function fp_get_next_timeout of libfprint (file poll.c) if exist
> > fprint timeout or libusb timeout the function return the smaller of
> > the 2 timeout.
> >
> > But if one of that not exist and have a smaller value the function
> > return a timeout that not exist.
> >
> > The attached patch fix the bug. It possible to apply the patch to the
> > library ?
>
> Good catch. Any chance you could create a git formatted patch so that
> explanations about the bug it solves, and authorship are kept?
>
> Cheers
>
> > 2011/2/14 sergio cerlesi <sergio.cerlesi at gmail.com>
> > Hi Bastien,
> >
> > at first, sorry for my bad english e if i'm not clear.
> >
> > The problem is that the driver i wrote for device Validity
> > VFS101 work with fprint_demo and pam_fprint but NOT with
> > pam_fprintd.
> >
> > I debug the driver and i find that the cause of problem is a
> > call of function fpi_timeout_add on the driver. Below i report
> > the portion of code that have the problem:
> >
> > /* Callback of asynchronous sleep */
> > static void async_sleep_cb(void *data)
> > {
> > struct fpi_ssm *ssm = data;
> >
> > fpi_ssm_next_state(ssm);
> > }
> >
> > /* Submit asynchronous sleep */
> > static void async_sleep(unsigned int msec, struct fpi_ssm
> > *ssm)
> > {
> > if (fpi_timeout_add(msec, async_sleep_cb, ssm) == NULL)
> > fpi_ssm_mark_aborted(ssm, -ETIME);
> > }
> >
> > If i use fprint_demo or pam_fprint for test the driver the
> > callback function are correctly called after timeout and the
> > driver work.
> > If i use pam_fprintd (fprintd-0.2.0) the callback are never
> > called and the driver are blocked.
> >
> > I can't understand if it's a bug of driver or of fprintd. Can
> > you help me ?
> >
> > Bye
> > Sergio
> >
> > 2011/2/14 Bastien Nocera <hadess at hadess.net>
> >
> >
> >
> > On Mon, 2011-02-14 at 09:25 +0100, sergio cerlesi
> > wrote:
> > > Hi Daniel, Bastien,
> > >
> > > i'm working on fprint Validity VFS101 driver. The
> > driver work with
> > > fprint_demo and pam_fprint but not with fprintd.
> > >
> > > The cause of problem is that it call the function
> > fpi_timeout_add that
> > > take conflict with fprintd ( the callback is never
> > call).
> > >
> > > I can't use this function or is a bug of fprintd ?
> > >
> > > I'm not sure but i think that other drivers like
> > uru4000 can have the
> > > same problem.
> >
> >
> > Sorry Sergio, but I don't understand what the problem
> > is here...
> >
> > Cheers
> >
> >
> >
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-return-timeout-of-fp_get_next_timeout.patch
Type: text/x-patch
Size: 1166 bytes
Desc: not available
Url : http://lists.reactivated.net/pipermail/fprint/attachments/20110216/88dcee0e/0001-Fix-return-timeout-of-fp_get_next_timeout-0001.bin
More information about the fprint
mailing list