• Konstantin Shkolnyy's avatar
    USB: cp210x: flush device queues at close · ebfb319b
    Konstantin Shkolnyy authored
    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>
    ebfb319b
cp210x.c 31 KB