Comment 65 for bug 790183

Revision history for this message
In , AceLan Kao (acelankao) wrote :

Created attachment 83699
0001-lib-Add-VFS5011-driver.patch

Sorry to take so long to resend the patch.

@@ +1000,5 @@
>> +
>> + struct fpi_ssm *ssm;
>> + ssm = fpi_ssm_new(dev->dev, open_loop, DEV_OPEN_NUM_STATES);
>> + ssm->priv = dev;
>> + fpi_ssm_start(ssm, open_loop_complete);
>
>And no one waits for this ssm (and async USB reqs) to complete here. It's a race >condition I've described earlier. Please move device initialization into >dev_activate().
The code is required and I can imagine the race condition you mentioned, but the fingerprint device won't work if move the code to dev_activate() function.
So, I add a check in dev_activate() function to make sure open_loop_complete() have finished to continue.

And you had mentioned that do we need to do reset in dev_open()
r = libusb_reset_device(dev->udev);
        if (r != 0) {
                fp_err("Failed to reset the device");
                return r;
        }
I checked if I removed the code, the device doesn't work.

I'm learning libfprint by modifying the code, so please give me more explicit advise, so that I can know how to fix it.
Thanks.