• Konstantin Shkolnyy's avatar
    USB: cp210x: flush device queues at close · bb91798f
    Konstantin Shkolnyy authored
    commit ebfb319b upstream.
    
    Flush all device queues at close in order to work around a cp2108 Tx
    queue bug.
    
    Occasionally, writing data and immediately closing the port makes cp2108
    stop responding. The device has to be unplugged to clear the error.
    The failure is induced by shutting down the device while its Tx queue
    still has unsent data. This condition is avoided by issuing PURGE command
    from the close() callback.
    
    This change is applied to all cp210x devices. Clearing internal queues on
    close is generally good.
    Signed-off-by: default avatarKonstantin Shkolnyy <konstantin.shkolnyy@gmail.com>
    [johan: amend commit message ]
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    Cc: Oliver Neukum <oliver@neukum.org>
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    bb91798f
cp210x.c 31.3 KB