On Thu, 30 Jun 2005 [EMAIL PROTECTED] wrote:

> Hello
> 
> I am testing a driver under 2.4.30, that originates from Philips, for
> their 1761 OTG high-speed chip. I was verifying drivers behaviour in
> error-cases, for which I connecetd a high-speed memory stick over a
> looooong cable and a USB analyser.

Implying that you are using the 1761 as a host, not as a slave.

>  Now, I can pretty easily bring the
> controller to a state when it sets the HALT bit in its queue-head.

That happens when it receives an error or a STALL token?

>  The
> driver sends -EPIPE back, calls usb_endpoint_halt(), does various cleanup,
> everything seems ok, then the (usb-storage?) driver sends BULK_RESET, the
> setup packet is ok, but the IN packet is NAKed infinitely.

Unforunately a lot of USB Mass Storage devices don't respond correctly to
the class-specific reset request.  That could easily explain the
indefinite NAK.  So could your looooong cable.

>  Now, that is
> actually my question. Originally, the driver would just re-validate the
> transfer descriptor, waiting for the device to eventually stop NAKing, but
> this never happens. So, the driver just spins there, until SCSI / storage
> aborts with a timeout. I tried putting a counter for NAK-revalidation
> attempts, and completing the URB with an error if the device doesn't
> response - but then the higher level retries - and this _forever_. So, the
> question is - what is the correct behaviour? Should the driver really just
> spin retrying NAKs and wait for higher level timeout (that works, btw), or
> should it complete the URB, but there's a bug in storage / SCSI that takes
> it to the endless loop?

The driver should keep on retrying NAKs.  That's what the standard
controllers do, and it's why higher levels use timeouts.

As for this endless loop -- I can't tell what you're referring to.  If you 
turn on CONFIG_USB_STORAGE_DEBUG, the debugging log will show what's going 
on at the higher level.

Alan Stern



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to