Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: macb: Fix ptp time adjustment for large negative delta

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>

authored by

Harini Katakam and committed by
David S. Miller
64d7839a 30877961

+1 -4
+1 -4
drivers/net/ethernet/cadence/macb_ptp.c
··· 170 170 171 171 if (delta > TSU_NSEC_MAX_VAL) { 172 172 gem_tsu_get_time(&bp->ptp_clock_info, &now); 173 - if (sign) 174 - now = timespec64_sub(now, then); 175 - else 176 - now = timespec64_add(now, then); 173 + now = timespec64_add(now, then); 177 174 178 175 gem_tsu_set_time(&bp->ptp_clock_info, 179 176 (const struct timespec64 *)&now);