Re: [PATCH] USB: Allocating buffer for IN endpoint.

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

 



On Fri, 30 Apr 2010, Martinez, Aldo wrote:

> Hello I've been following this list for a couple months, this is the first time I 
> think I can contribute, hopefully I am right :D

I don't think you are.  :-(

> I've been working in a test for f_loopback.c configuration. And I've noticed 
> that when a bulk transfer is attempted from the device to the host using
> usbtest  driver, the test simply hangs waiting for the transfer. 
> 
> I used the following comand:
> #sudo ./testusb -a -t2 -c1 -s4096

Test 2 is the bulk-IN read test.  In this situation it is supposed to
hang, because it waits for the device to send data.  Because the
loopback configuration only echoes data received from the host (that's
why it's called "loopback"), and since the host doesn't send any data
in this test, the device won't send anything either.

> This is appreciated in the following usbmon trace:
> f28bc800 0.778172 S Co:1:015:0 s 01 0b 0000 0000 0000 0
> f28bc800 0.779222 C Co:1:015:0 0 0
> f28bc800 0.779246 S Bi:1:015:1 - 4096 <

That's what it's supposed to do.

> I believe this is because there is no IN request allocated. Applying the 
> following patch this is fixed.
> 
> --------------------------------------------------------------------------------------------------------------------------------------------
> 
> Allocating for the request buffer is missing for the IN
> endpoint. Because of this testusb gets stuck in test 2;
> read X bytes Y times.

No.  The request buffer _is_ allocated; in fact, the OUT endpoint and 
the IN endpoint share the same requests and buffers.  Read 
loopback_complete() and you'll see.

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