• Johan Hovold's avatar
    USB: serial: ftdi_sio: fix break and sysrq handling · 733fff67
    Johan Hovold authored
    Only the last NUL in a packet should be flagged as a break character,
    for example, to avoid dropping unrelated characters when IGNBRK is set.
    
    Also make sysrq work by consuming the break character instead of having
    it immediately cancel the sysrq request, and by not processing it
    prematurely to avoid triggering a sysrq based on an unrelated character
    received in the same packet (which was received *before* the break).
    
    Note that the break flag can be left set also for a packet received
    immediately following a break and that and an ending NUL in such a
    packet will continue to be reported as a break as there's no good way to
    tell it apart from an actual break.
    
    Tested on FT232R and FT232H.
    
    Fixes: 72fda3ca ("USB: serial: ftd_sio: implement sysrq handling on break")
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    733fff67
ftdi_sio.c 99.5 KB