• Johan Hovold's avatar
    USB: sierra: fix remote wakeup · 80cc0fcb
    Johan Hovold authored
    Make sure that needs_remote_wake up is always set when there are open
    ports.
    
    Currently close() would unconditionally set needs_remote_wakeup to 0
    even though there might still be open ports. This could lead to blocked
    input and possibly dropped data on devices that do not support remote
    wakeup (and which must therefore not be runtime suspended while open).
    
    Add an open_ports counter (protected by the susp_lock) and only clear
    needs_remote_wakeup when the last port is closed.
    
    Fixes: e6929a90 ("USB: support for autosuspend in sierra while
    online")
    
    Cc: <stable@vger.kernel.org>	# v2.6.32
    Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    80cc0fcb
sierra.c 29.7 KB