• David Brownell's avatar
    [PATCH] USB: add CONFIG_USB_SUSPEND · 5104332e
    David Brownell authored
    This is the core of the USB_SUSPEND functionality.  Please merge.
    
    This adds an experimental CONFIG_USB_SUSPEND option, which supports the
    USB "suspend" state.  Linux-USB hosts have previously ignored that state.
    
        -	New driver API calls, usb_suspend_device() and its
    	sibling usb_resume_device().
    
        -	Access to those calls through sysfs, such as
    		echo -n 2 > power/state
    		echo -n 0 > power/state
    
    That can be used to reduce the power consumption of any given USB device,
    then re-activate it later.  Eventually, most USB device drivers should
    probably suspend idle USB devices.
    
    One problem with this patch:  USB drivers without suspend() callbacks
    may badly misbehave.  Right now only hub drivers know suspend().  If the
    driver core didn't self-deadlock when we try it, unbinding those drivers
    from those devices (then re-enumerating on resume) would be perfect...
    the current compromise is just to emit a warning message.
    
    In conjunction with host controller driver support (already merged for
    OHCI and EHCI), PCI host controllers will issue the PME# wakeup signal
    when a USB keyboard starts remote wakeup signaling.  (But the keyboard
    wasn't usable later, since HID doesn't try to suspend.)
    
    I understand some ACPI patches are circulating, and maybe already in
    the MM tree, to make a suspended system wake up given PME# signaling.
    It'd be great if someone made that work transparently with USB, but
    for now I'm told it'll need some sysfs setup first.
    Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    5104332e
hub.c 69.4 KB