Skip to content

Commit 207ce62

Browse files
mlichvarkuba-moo
authored andcommitted
igb: Fix PPS input and output using 3rd and 4th SDP
Fix handling of the tsync interrupt to compare the pin number with IGB_N_SDP instead of IGB_N_EXTTS/IGB_N_PEROUT and fix the indexing to the perout array. Fixes: cf99c1d ("igb: move PEROUT and EXTTS isr logic to separate functions") Reported-by: Matt Corallo <[email protected]> Signed-off-by: Miroslav Lichvar <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d3a3734 commit 207ce62

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6794,15 +6794,15 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
67946794
struct timespec64 ts;
67956795
u32 tsauxc;
67966796

6797-
if (pin < 0 || pin >= IGB_N_PEROUT)
6797+
if (pin < 0 || pin >= IGB_N_SDP)
67986798
return;
67996799

68006800
spin_lock(&adapter->tmreg_lock);
68016801

68026802
if (hw->mac.type == e1000_82580 ||
68036803
hw->mac.type == e1000_i354 ||
68046804
hw->mac.type == e1000_i350) {
6805-
s64 ns = timespec64_to_ns(&adapter->perout[pin].period);
6805+
s64 ns = timespec64_to_ns(&adapter->perout[tsintr_tt].period);
68066806
u32 systiml, systimh, level_mask, level, rem;
68076807
u64 systim, now;
68086808

@@ -6850,8 +6850,8 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
68506850
ts.tv_nsec = (u32)systim;
68516851
ts.tv_sec = ((u32)(systim >> 32)) & 0xFF;
68526852
} else {
6853-
ts = timespec64_add(adapter->perout[pin].start,
6854-
adapter->perout[pin].period);
6853+
ts = timespec64_add(adapter->perout[tsintr_tt].start,
6854+
adapter->perout[tsintr_tt].period);
68556855
}
68566856

68576857
/* u32 conversion of tv_sec is safe until y2106 */
@@ -6860,7 +6860,7 @@ static void igb_perout(struct igb_adapter *adapter, int tsintr_tt)
68606860
tsauxc = rd32(E1000_TSAUXC);
68616861
tsauxc |= TSAUXC_EN_TT0;
68626862
wr32(E1000_TSAUXC, tsauxc);
6863-
adapter->perout[pin].start = ts;
6863+
adapter->perout[tsintr_tt].start = ts;
68646864

68656865
spin_unlock(&adapter->tmreg_lock);
68666866
}
@@ -6874,7 +6874,7 @@ static void igb_extts(struct igb_adapter *adapter, int tsintr_tt)
68746874
struct ptp_clock_event event;
68756875
struct timespec64 ts;
68766876

6877-
if (pin < 0 || pin >= IGB_N_EXTTS)
6877+
if (pin < 0 || pin >= IGB_N_SDP)
68786878
return;
68796879

68806880
if (hw->mac.type == e1000_82580 ||

0 commit comments

Comments
 (0)