On Wed, 6 Apr 2016, Greg KH wrote: > On Wed, Apr 06, 2016 at 04:08:04PM +0300, Mathias Nyman wrote: > > We don't want to runtime suspend a bus if there is an event pending. > > The roothub on a NEC uPD720200 host with a single USB3 device connected > > might go back to runtime suspend immediately after runtime resume as > > hub might not yet see any port changes in resume. > > > > Prevent this by checking if there is a unhandled event pending when > > calling runtime suspend. > > As Alan points out, you didn't actually test this :( Also as Björn pointed out, failing a system suspend isn't a good idea. In general, you should do it only if wakeup is enabled and there is a pending wakeup event. In this case there may be alternatives. For example, you could just delay a few ms until the pending event has been handled. Or, if you really just want to prevent runtime suspend, you should check to see if this was a runtime suspend and not a system suspend. Or you could prevent the bus from being runtime suspended in the first place by doing a pm_runtime_get_sync(). 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