Re: Questions about USB core reset behavior

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

 



On Mon, 25 Apr 2011, Sarah Sharp wrote:

> Random question time. :)
> 
> Do USB device drivers have to cancel all URBs that are pending for a
> device before calling usb_reset_device?  Will the drivers have to wait
> for the URBs to complete before resetting the device?

There is no requirement that drivers cancel all URBs before a reset 
occurs.  Indeed, some drivers can't because they have no way to know 
when another driver bound to another interface on the same device wants 
to do a reset, i.e., they have no pre_reset callback.

Of course, an URB that remains active during a reset is quite likely to
fail.

> The specific random question I got asked by the chipset folks is:
> 
> "Before issuing a Port Reset, is there any condition that the driver
> should remove the TD associated with the device?"
> 
> Not quite sure what to make of that, since I don't know EHCI internals.

I'm not quite sure what to make of it either.  TDs aren't associated
with devices, or at least, not in a one-to-one relationship.  Anyway,
the answer appears to be "No".

> The second question relates to the CLEAR_TT_BUFFER request, and it only
> applies to an Intel EHCI controller with a built-in rate matching hub
> (RMH).  The chipset folks want to know if a CLEAR_TT_BUFFER request
> might be used before a port suspend or a port reset.

Yes, it might.  In fact, as far as I can tell, a Clear-TT-Buffer 
request might still be in progress when a suspend or reset is issued 
for one of the ports associated with that TT.

> It looks like the EHCI driver automatically clears the TT buffer, except
> when the host controller has a Transaction Translator built into the
> root hub, or we need to clear a TT buffer on an external HS hub.

You got that reversed.  TT buffers on non-root high-speed hubs do get
cleared.  In theory a root hub's built-in TT (if there is one) should
have its buffers cleared as well, but there doesn't appear to be a
standard way of doing it so we don't even try.

>  I
> assume that means we won't clear the TT buffer for the EHCI roothub,
> since this platform has a rate matching hub?

On the platform you're talking about, the root hub does not have a TT.  
On the other hand, we _will_ clear the TT buffers in the rate-matching
hub when they need it.

I trust these answers will dismay your chipset people...  :-)

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