net: macb: Fix ptp time adjustment for large negative delta
authorHarini Katakam <harini.katakam@xilinx.com>
Wed, 20 Jun 2018 11:34:20 +0000 (17:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 12:28:44 +0000 (14:28 +0200)
commitf389c17b8dc54b474d33728e5882dcc276a467fa
tree251ad26a9253a3d998ab4d53a7b41dbfe26dc270
parentb364a914c4993f46c0d849dab20d67ba0d82809d
net: macb: Fix ptp time adjustment for large negative delta

[ Upstream commit 64d7839af8c8f67daaf9bf387135052c55d85f90 ]

When delta passed to gem_ptp_adjtime is negative, the sign is
maintained in the ns_to_timespec64 conversion. Hence timespec_add
should be used directly. timespec_sub will just subtract the negative
value thus increasing the time difference.

Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/cadence/macb_ptp.c