Do not run a timestamp processing callback on unready hardware
thus avoiding hitting uninitialized structures etc.

Fixes: 88b68f35eb43 ("ice: PTP: fix missing timestamps on E825 hardware")
Signed-off-by: Sergey Temerkhanov <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c 
b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 24d4ab2197c3..d04a4099db92 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -2806,6 +2806,9 @@ s8 ice_ptp_request_ts(struct ice_ptp_tx *tx, struct 
sk_buff *skb)
 
 void ice_ptp_process_ts(struct ice_pf *pf)
 {
+       if (pf->ptp.state != ICE_PTP_READY)
+               return;
+
        switch (pf->ptp.tx_interrupt_mode) {
        case ICE_PTP_TX_INTERRUPT_NONE:
                /* This device has the clock owner handle timestamps for it */
-- 
2.53.0

Reply via email to