• Dan Streetman's avatar
    USB: retain USB device power/wakeup setting across reconfiguration · a30ded70
    Dan Streetman authored
    commit 16985408 upstream.
    
    Currently a non-root-hub USB device's wakeup settings are initialized when the
    device is set to a configured state using device_init_wakeup(), but this is not
    correct as wakeup is split into "capable" (can_wakeup) and "enabled"
    (should_wakeup).  The settings should be initialized instead in the device
    initialization (usb_new_device) with the "capable" setting disabled and the
    "enabled" setting enabled.  The "capable" setting should be set based on the
    device being configured or unconfigured, and "enabled" setting set based on
    the sysfs power/wakeup control.
    
    This patch retains the sysfs power/wakeup setting of a non-root-hub USB device
    over a USB device re-configuration, which can happen (for example) after a
    suspend/resume cycle.
    Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
    Cc: David Brownell <dbrownell@users.sourceforge.net>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    [bwh: Adjust context for 2.6.32]
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    a30ded70
hub.c 107 KB