• Johan Hovold's avatar
    USB: usb_wwan: fix remote wakeup · c1c01803
    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.
    
    Note that there are currently no multi-port drivers using the usb_wwan
    implementation.
    Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    c1c01803
usb_wwan.c 17.4 KB