Skip to content

Commit a711a32

Browse files
kolacinskikarolanguy11
authored andcommitted
ice: Check for PTP HW lock more frequently
It was observed that 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 <[email protected]> Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent e80bd08 commit a711a32

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,16 +2963,18 @@ bool ice_ptp_lock(struct ice_hw *hw)
29632963
u32 hw_lock;
29642964
int i;
29652965

2966-
#define MAX_TRIES 5
2966+
#define MAX_TRIES 15
29672967

29682968
for (i = 0; i < MAX_TRIES; i++) {
29692969
hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id));
29702970
hw_lock = hw_lock & PFTSYN_SEM_BUSY_M;
2971-
if (!hw_lock)
2972-
break;
2971+
if (hw_lock) {
2972+
/* Somebody is holding the lock */
2973+
usleep_range(5000, 6000);
2974+
continue;
2975+
}
29732976

2974-
/* Somebody is holding the lock */
2975-
usleep_range(10000, 20000);
2977+
break;
29762978
}
29772979

29782980
return !hw_lock;

0 commit comments

Comments
 (0)