Re: [Bugme-new] [Bug 12301] New: Fingerprint reader doesn't respod after the first use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Dec 2008, Timo Hoenig wrote:

> Hi Alan,
> 
> On Tue, 2008-12-30 at 14:09 -0500, Alan Stern wrote:
> 
> > Timo, pay attention to this: There may still be another problem
> > lurking in the library source code.  _libthinkfinger_usb_hello()
> > behaves very badly: It sends a direct Set-Config request without using
> > usb_set_configuration().  You should remove the entire first call to
> > usb_control_msg() from that function.  I know the comment says "should
> > not be relevant", but the comment is wrong.
> 
> OK, will do.  Thanks for the pointer.  This code was taken from Pavel's
> initial attempts on getting this device supported.

It's common for userspace drivers to call usb_set_configuration() at 
the wrong time.  But it's not common (in fact, I don't remember ever 
seeing it before) for them to concoct a Set-Config request on their 
own and bypass usb_set_configuration().

> > If it turns out that the Set-Config really is needed (it might indeed
> > be necessary for Windows systems), it shouldn't be done this way.  
> > Instead, usb_set_configuration() should be called from within
> > _libthinkfinger_usb_init(), just before usb_claim_interface().
> 
> Will do.  Out of curiosity: Would this bug have never shown up if
> libthinkfinger would have called this as you propose?

No, this issue is not directly related to the original bug report.  
That bug really was caused by an oversight in a commit I added to the
kernel.

But the fix for that bug might expose this issue, because of the way 
usb_set_configuration() is bypassed.  When libthinkfinger sends the 
Set-Config request to the device, the device will clear the data 
toggles for its bulk endpoints -- but the kernel won't realize this has 
happened.  Consequently the device's notion of the toggle values and 
the kernel's notion might get out of sync with each other, leading to 
data loss or communication errors.

Before my commit was added this would not have mattered, since the 
kernel would send a Set-Interface request when the program calls 
usb_release_interface(), and it would know that the Set-Interface would 
clear the data toggles.  Now that the Set-Interface request isn't being 
sent, the issue might arise.

> As libthinkfinger was merged into libfprint I'll care to fix it there as
> well, if required.

Good idea.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux