mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 15:58:47 +00:00
net: macb: Optimize reading HW timestamp
The seconds input from BD (6 bits) just needs to be ORed with the upper bits from timer in this function. Avoid addition operation every single time. Seconds rollover handling is left untouched. Signed-off-by: Harini Katakam <harini.katakam@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ee4e92c26c
commit
8c0d0fe044
@ -258,6 +258,8 @@ static int gem_hw_timestamp(struct macb *bp, u32 dma_desc_ts_1,
|
||||
*/
|
||||
gem_tsu_get_time(&bp->ptp_clock_info, &tsu, NULL);
|
||||
|
||||
ts->tv_sec |= ((~GEM_DMA_SEC_MASK) & tsu.tv_sec);
|
||||
|
||||
/* If the top bit is set in the timestamp,
|
||||
* but not in 1588 timer, it has rolled over,
|
||||
* so subtract max size
|
||||
@ -266,8 +268,6 @@ static int gem_hw_timestamp(struct macb *bp, u32 dma_desc_ts_1,
|
||||
!(tsu.tv_sec & (GEM_DMA_SEC_TOP >> 1)))
|
||||
ts->tv_sec -= GEM_DMA_SEC_TOP;
|
||||
|
||||
ts->tv_sec += ((~GEM_DMA_SEC_MASK) & tsu.tv_sec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user