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: 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>

authored by

Rengarajan S and committed by
Paolo Abeni
b1de3c0d cdc74c9d

+2 -1
+1 -1
drivers/net/ethernet/microchip/lan743x_ptp.c
··· 58 58 static void lan743x_ptp_wait_till_cmd_done(struct lan743x_adapter *adapter, 59 59 u32 bit_mask) 60 60 { 61 - int timeout = 1000; 61 + int timeout = PTP_CMD_CTL_TIMEOUT_CNT; 62 62 u32 data = 0; 63 63 64 64 while (timeout &&
+1
drivers/net/ethernet/microchip/lan743x_ptp.h
··· 21 21 #define LAN743X_PTP_N_EXTTS 4 22 22 #define LAN743X_PTP_N_PPS 0 23 23 #define PCI11X1X_PTP_IO_MAX_CHANNELS 8 24 + #define PTP_CMD_CTL_TIMEOUT_CNT 50 24 25 25 26 struct lan743x_adapter; 26 27