]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
igc: Fix missing time sync events
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Tue, 20 Feb 2024 23:57:10 +0000 (15:57 -0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:37 +0000 (18:19 -0400)
commit9bfb3503245f16da2c50685a23073f67a819113c
tree55f87c71d24b2b128808e145bfc190084f21f684
parent2b74b2a92e524d7c8dec8e02e95ecf18b667c062
igc: Fix missing time sync events

[ Upstream commit 244ae992e3e80e5c9c272c77324c831148457f95 ]

Fix "double" clearing of interrupts, which can cause external events
or timestamps to be missed.

The IGC_TSIRC Time Sync Interrupt Cause register can be cleared in two
ways, by either reading it or by writing '1' into the specific cause
bit. This is documented in section 8.16.1.

The following flow was used:
 1. read IGC_TSIRC into 'tsicr';
 2. handle the interrupts present in 'tsirc' and mark them in 'ack';
 3. write 'ack' into IGC_TSICR;

As both (1) and (3) will clear the interrupt cause, if the same
interrupt happens again between (1) and (3) it will be ignored,
causing events to be missed.

Remove the extra clear in (3).

Fixes: 2c344ae24501 ("igc: Add support for TX timestamping")
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Tested-by: Kurt Kanzenbach <kurt@linutronix.de> # Intel i225
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igc/igc_main.c