• David Brownell's avatar
    [PATCH] USB: usb PM updates, root hub stuff (2/4) · 8df93ce6
    David Brownell authored
    Makes usbcore handle some suspend scenarios more consistently, especially
    when talking with root hubs.
    
     - Use usb_device->state, not device->power.power_state.  (The driver model
       power_state is still needed for interfaces.)  With USB_SUSPEND=n, there
       are also cases where the HCD_STATE_SUSPENDED needs to be used instead
       of testing for USB_STATE_SUSPENDED.
    
     - Updates usb_device->state for root hubs during suspend/resume.
    
     - Fixes a locking bug (extra "up") that got merged recently, affecting
       CONFIG_USB_SUSPEND.
    
     - Recover one of the "HC died" cases better.
    
     - Root hub timer updates, handling various suspend transitions more
       consistently:  don't duplicate earlier submit checks, only work
       when hub is configured, address various submit/resume races.
    
    Together, these help hubs work better regardless of whether USB_SUSPEND
    has been enabled (that's the only way USB_STATE_SUSPENDED appears), and
    whether or not the HCD is marked as suspended (or maybe Alan would
    want to call that "half suspended").
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    8df93ce6
hcd.c 46.2 KB