Google
  Web www.spinics.net

Discussion: recovery from transient disconnects

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


The hub driver in 2.6.27 has a feature allowing it to recover from
transient disconnections or port-enable changes.  The idea is that if
either one occurs and after the debouncing period (100 ms or so) the
same device is still connected to the same port, the event is handled
as a reset rather than a disconnect.  The existing usb_device isn't
removed and drivers aren't unbound.

In theory this should make us more resilient against errors.  In 
practice I'm not so sure.  Port-enable changes are very rare, and 
disconnects normally last a lot longer than 100 ms.

Furthermore, the recovery procedure can itself lead to problems.  
While many drivers are good about detecting errors and retrying as part
of their normal operation, most don't react so robustly when an error
occurs in their probe routine.  As an outstanding example, consider the
usb_generic driver, whose probe routine does little more than select a
default configuration and install it.  If something goes wrong with the
Set-Config call, the call is not retried; instead the device simply
remains unconfigured.

Now under most circumstances this is all okay.  We've got a non-robust 
reaction to a type of error that almost never occurs.  That's fine, 
except for one thing:

	These errors _do_ occur quite reliably when ehci-hcd is
	loaded after ohci-hcd or uhci-hcd!

What happens is that ehci-hcd takes over the port, disconnecting the
device from the companion controller.  If the device can't run at high
speed then the port is returned to the companion controller.  The
overall result is exactly that of a transient disconnection.

A user has reported a case in which this occurred during the
usb_generic probe routine.  As a result the device (a keyboard) never 
got configured and consequently was nonfunctional.

Given the significant probability of bad outcomes, together with the 
fact that real transient errors are so rare, I'm starting to think we 
would be better off without this new recovery feature.

What do other people think?

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

[Home]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]

Add to Google Powered by Linux