diff options
author | Jiri Slaby <jslaby@suse.cz> | 2017-09-12 12:39:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-18 18:19:20 +0200 |
commit | 104583b504da8a3ad86d033b497cb6e58941a9a1 (patch) | |
tree | bd26ede2093fe93714d6d49aff4e28f3ac0aa591 /drivers/tty/serial | |
parent | 432219fd002ada95d2f45dd3a25c3f7c73f27864 (diff) | |
download | blackbird-op-linux-104583b504da8a3ad86d033b497cb6e58941a9a1.tar.gz blackbird-op-linux-104583b504da8a3ad86d033b497cb6e58941a9a1.zip |
mxser: fix timeout calculation for low rates
Paul reported, that low rates like B300 make the driver to hang in
mxser_wait_until_sent. His debugging tackled the issue down to the
info->timeout computation in mxser_set_baud. Obviously, ints are used
there and they easily overflow with these low rates: B300 makes
info->timeout to be -373.
So switch all these types to unsigned as it ought to be. And use the u64
domain to perform the computation as in the worst case, we need 35 bits
to store the computed value (before division).
And use do_div not to break 32 bit kernels.
[v2] make it actually build
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Paul <Paul@abelian.netcom.co.uk>
Tested-by: <Paul@abelian.netcom.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
0 files changed, 0 insertions, 0 deletions