]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: microchip: lan743x: Reduce PTP timeout on HW failure
authorRengarajan S <rengarajan.s@microchip.com>
Thu, 2 May 2024 05:03:00 +0000 (10:33 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 6 May 2024 09:41:32 +0000 (11:41 +0200)
commitb1de3c0df7abc41dc41862c0b08386411f2799d7
tree7be00148bb92c7020d93356f565eed10defbd3a8
parentcdc74c9d06e72addde01092d09f13bb86d3ed7d0
net: microchip: lan743x: Reduce PTP timeout on HW failure

The PTP_CMD_CTL is a self clearing register which controls the PTP clock
values. In the current implementation driver waits for a duration of 20
sec in case of HW failure to clear the PTP_CMD_CTL register bit. This
timeout of 20 sec is very long to recognize a HW failure, as it is
typically cleared in one clock(<16ns). Hence reducing the timeout to 1 sec
would be sufficient to conclude if there is any HW failure observed. The
usleep_range will sleep somewhere between 1 msec to 20 msec for each
iteration. By setting the PTP_CMD_CTL_TIMEOUT_CNT to 50 the max timeout
is extended to 1 sec.

Signed-off-by: Rengarajan S <rengarajan.s@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240502050300.38689-1-rengarajan.s@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/lan743x_ptp.c
drivers/net/ethernet/microchip/lan743x_ptp.h