On Thu, 22 Jan 2009 Saito.Koichiro@xxxxxxxxx wrote: > I tried to one-time retrying. But it turned out that > retrying fail occasionally. Retrying with retry counter > may not have less chance of recovery. > > I thought about retrying with some fixed length of time. > In this case, I think that there is a following problem. > When I unplugged usb device while accessing the device, > there is a possibility that a lot of retrying occur though > it depends on keeping time. That's right. The retries will end either when the kernel realizes that the device has been unplugged or else when the fixed length of time expires. > If I can know that unplugged > the device, I can avoid needless retrying. But I had no > idea about avoiding this situation. In general there's no way to know whether the device has been unplugged, because the device might have been attached to an external hub. > If I can solve this > problem, I think that retrying with fix times is better > solution . If there is not solution, I think that it is > better to retry with retry counter. > > Could you give me your advice in this problem? I don't know. It depends on how long the "fixed length of time" is, and on how often people unplug USB devices. Since unplugging is rare, I think you could use a fixed length of 50 ms or so. That would not cause too much overhead and it should be long enough to cover many sources of transient interference. (This may be equivalent to using a retry counter of 400, figuring that there will be one retry every microframe.) 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