Re: [Bugme-new] [Bug 8297] New: ldusb returns bad data on subsequent reads if no data is available.

Andrew Morton <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, 2 Apr 2007 20:06:49 -0700 [email protected] wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=8297
> 
>            Summary: ldusb returns bad data on subsequent reads if no data is
>                     available.
>     Kernel Version: 2.6.21-rc5
>             Status: NEW
>           Severity: normal
>              Owner: [email protected]
>          Submitter: [email protected]
> 
> 
> Problem Description:
> Using my Go!Temp temperature probe with the ldusb driver I decided to cat the
> device file /dev/ldusb0 to see what it would return.  Bad idea, I was presented
> with an endless spewing of crap.
> 
> After a little debugging it seems the problem is that in ld_usb_open
> dev->interrupt_in_done is set to 0, and the URB is submitted.  When ld_usb_read
> is called if no data is in the buffer it waits for ld_usb_interrupt_in_callback
> to complete by checking if dev->interrupt_in_done has been set to 1.  That works
> fine if you only read once after calling open however, if you happen to read
> more than once dev->interrupt_in_done is never reset so you read from the empty
> buffer even though no data has arrived.
> 
> Steps to reproduce:
> Plug in a Go!Temp temperature probe
> dd if=/dev/ldusb0 ibs=8 count=10
> dmesg
> notice strange error message (ldusb 4-2:1.0: Read buffer overflow, 1095783997
> bytes dropped)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.