• Johan Hovold's avatar
    USB: serial: ch341: fix receiver regression · 7c3d0228
    Johan Hovold authored
    While assumed not to make a difference, not using the factor-2 prescaler
    makes the receiver more susceptible to errors.
    
    Specifically, there have been reports of problems with devices that
    cannot generate a 115200 rate with a smaller error than 2.1% (e.g.
    117647 bps). But this can also be reproduced with a low-speed RS232
    tranceiver at 115200 when the input rate matches the nominal rate.
    
    So whenever possible, enable the factor-2 prescaler and halve the
    divisor in order to use settings closer to that of the previous
    algorithm.
    
    Fixes: 35714565 ("USB: serial: ch341: reimplement line-speed handling")
    Cc: stable <stable@vger.kernel.org>	# 5.5
    Reported-by: default avatarJakub Nantl <jn@forever.cz>
    Tested-by: default avatarJakub Nantl <jn@forever.cz>
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    7c3d0228
ch341.c 17.3 KB