PTP HW semaphore can be held for ~50 ms in worst case.
SW should wait longer and check more frequently if
the HW lock is held.

Signed-off-by: Karol Kolacinski <karol.kolacin...@intel.com>
Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
---
 drivers/net/ice/base/ice_ptp_hw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_ptp_hw.c 
b/drivers/net/ice/base/ice_ptp_hw.c
index f5ebf5f328..974c96f60c 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -4844,18 +4844,18 @@ bool ice_ptp_lock(struct ice_hw *hw)
        u32 hw_lock;
        int i;
 
-#define MAX_TRIES 5
+#define MAX_TRIES 15
 
        for (i = 0; i < MAX_TRIES; i++) {
                hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id));
                hw_lock = hw_lock & PFTSYN_SEM_BUSY_M;
                if (hw_lock) {
                        /* Somebody is holding the lock */
-                       ice_msec_delay(10, true);
+                       ice_msec_delay(5, true);
                        continue;
-               } else {
-                       break;
                }
+
+               break;
        }
 
        return !hw_lock;
-- 
2.31.1

Reply via email to