aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/timerlist.py
diff options
context:
space:
mode:
authorGeert Uytterhoeven <[email protected]>2019-04-01 13:25:10 +0200
committerGreg Kroah-Hartman <[email protected]>2019-04-16 15:24:38 +0200
commitace965696da2611af759f0284e26342b7b6cec89 (patch)
tree4940e55d2b2f43a43cc894e4f69e5f28689640db /scripts/gdb/linux/timerlist.py
parent79a3aaa7b82e3106be97842dedfd8429248896e6 (diff)
serial: sh-sci: Fix HSCIF RX sampling point calculation
There are several issues with the formula used for calculating the deviation from the intended rate: 1. While min_err and last_stop are signed, srr and baud are unsigned. Hence the signed values are promoted to unsigned, which will lead to a bogus value of deviation if min_err is negative, 2. Srr is the register field value, which is one less than the actual sampling rate factor, 3. The divisions do not use rounding. Fix this by casting unsigned variables to int, adding one to srr, and using a single DIV_ROUND_CLOSEST(). Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Cc: stable <[email protected]> Reviewed-by: Ulrich Hecht <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions