On Tuesday 25 April 2006 6:50 am, Alan Stern wrote: > > We might have been able to avoid some of these problems with USB devices > if we had been a bit more careful. In particular, it wouldn't hurt to > have usb_resume_device() verify that the upstream port is enabled and not > suspended in the non-CONFIG_USB_SUSPEND case. Nope ... remember, the USB device enumerated from scratch both times. Identically, reproducibly. So the first device will again be given address 2, and will even pass the "is it still there" sanity check in finish_device_resume(). (I was testing with USB_SUSPEND of course.) But that device wasn't in the _right_ suspend state, the one in which it had been left before swsusp turned the power off. Only the low level setup had been (could have been) done -- USB enumeration, that's all. The reason such devices can't work after this fakey "resume" is that the system (specifically swsusp) is lying about things. It brought all the hardware part way up, obliterating all the true state that drivers rely on to make resume() behave correctly. Making swsusp do like kexec -- resetting the devices that need it -- is just making that PM code stop its lies. HCDs (and similar drivers) can handle it OK if there was a power loss after suspend(). By calling device_suspend() not device_shutdown(), swsusp is going out of its way to prevent drivers from knowing . - Dave