Martin Pieuchot wrote: > > 1. The driver's ioctl function. > > > > 2. The driver's USB transfer completion callbacks. > > Those are called by usb_transfer_complete(). This correspond to > xhci_xfer_done() and xhci_event_port_change(). Does those functions > need to be called during suspend?
xhci_xfer_done() is called among other places when hardware completes a transfer, which could happen during suspend unless endpoints were stopped/transfers were aborted before suspend is allowed to proceed. The USB stack (I guess xhci.c) would have to delay suspend until active transfers complete or are aborted while failing new transfers. I don't know if that's desirable. A variant could be for suspend to cancel any active transfers, e.g. using xhci_abort_xfer(). I see that xhci.c doesn't handle DVACT_SUSPEND like other ?hci.c. It only handles DVACT_POWERDOWN. Could this be the underlying reason? xhci_event_port_change() might be called /because of/ suspend, if devices are shut down and the HC can report port change events while the kernel is suspending, which xHCI spec says does not happen if the HC is halted, which seems like a good idea while suspending - but again I don't see xhci.c halting the HC nor doing anything else for suspend. @kettenis Since ehci_activate() handles DVACT_SUSPEND is it possible to use only the EHCI driver on your machine for comparison? //Peter