]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: ocp: have adjtime handle negative delta_ns correctly
authorJonathan Lemon <jonathan.lemon@gmail.com>
Fri, 13 May 2022 22:52:31 +0000 (15:52 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 May 2022 20:07:46 +0000 (13:07 -0700)
commitb19d831bea679a120f1ad8b46b97365fd22da954
tree418bb6e59adf98dc47abb9b67452e2167cb5cb43
parent2f96d76a162fb4e43a21e712b437b079df1ec3b4
ptp: ocp: have adjtime handle negative delta_ns correctly

delta_ns is a s64, but it was being passed ptp_ocp_adjtime_coarse
as an u64.  Also, it turns out that timespec64_add_ns() only handles
positive values, so perform the math with set_normalized_timespec().

Fixes: d6c5da8943dc ("ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments")
Suggested-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: Vadim Fedorenko <vfedorenko@novek.ru>
Link: https://lore.kernel.org/r/20220513225231.1412-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c