From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B52A188A0C; Tue, 10 Sep 2024 10:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725962502; cv=none; b=g2umtav0x3J1IZdOONpw+3ByCws3PMVv9fUHb5NHqC89+PW8gH+MGxAFbBbhWMB7shHHUMQI6U/DULfuu7X/mNfYeP3YAlMtcR5s16SO4ZvshZsSuZeqcAKJbVGd2NUkFPwqMZFxfpHK1BTtTBx/4dvndXOyTBzYC0xlnPF/t6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725962502; c=relaxed/simple; bh=6Qzv4oKzCerCRDAFSNO1qfDcimomR2blLxXJHBc3d9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bUrfzM7tBcak1JQ5cAFR/UZ/2tlHt9k3U8eFoWfs4z70RybuqDFnAE4xwasJ9u+D09vAq2wrYSXusHQsvXI3DqvKZkzj/eYfWXiLd5C874fyuactmbL28UyTigwDy+5cIXaXrJWcjWdlPSMHLTJyRNfORj7N2z3o9FfkpFLAWWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ktpb47TI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ktpb47TI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B04BAC4CEC3; Tue, 10 Sep 2024 10:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725962502; bh=6Qzv4oKzCerCRDAFSNO1qfDcimomR2blLxXJHBc3d9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ktpb47TIrULyQP0DqrtTiyVQpvXUCZouCSFNjZZCT80zAwkKD1tXIgHx6Qu7LmGCi 2MmtJuxeJlJogYT2yDfcw+gXjKCxVPYmdfIIrgrFxp42hIgqbL1AH5/UY7GjpBg/9i vlEzhcf/hW7ZuapIckKlYz1URbUNTmEEx7PSjzI0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daiwei Li , Vinicius Costa Gomes , Kurt Kanzenbach , Tony Nguyen , Sasha Levin , Pucha Himasekhar Reddy Subject: [PATCH 5.4 055/121] igb: Fix not clearing TimeSync interrupts for 82580 Date: Tue, 10 Sep 2024 11:32:10 +0200 Message-ID: <20240910092548.424293830@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092545.737864202@linuxfoundation.org> References: <20240910092545.737864202@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daiwei Li [ Upstream commit ba8cf80724dbc09825b52498e4efacb563935408 ] 82580 NICs have a hardware bug that makes it necessary to write into the TSICR (TimeSync Interrupt Cause) register to clear it: https://lore.kernel.org/all/CDCB8BE0.1EC2C%25matthew.vick@intel.com/ Add a conditional so only for 82580 we write into the TSICR register, so we don't risk losing events for other models. Without this change, when running ptp4l with an Intel 82580 card, I get the following output: > timed out while polling for tx timestamp increasing tx_timestamp_timeout or > increasing kworker priority may correct this issue, but a driver bug likely > causes it This goes away with this change. This (partially) reverts commit ee14cc9ea19b ("igb: Fix missing time sync events"). Fixes: ee14cc9ea19b ("igb: Fix missing time sync events") Closes: https://lore.kernel.org/intel-wired-lan/CAN0jFd1kO0MMtOh8N2Ztxn6f7vvDKp2h507sMryobkBKe=xk=w@mail.gmail.com/ Tested-by: Daiwei Li Suggested-by: Vinicius Costa Gomes Signed-off-by: Daiwei Li Acked-by: Vinicius Costa Gomes Reviewed-by: Kurt Kanzenbach Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index cceff1515ea1..884beeb67a1f 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -6522,10 +6522,20 @@ static void igb_extts(struct igb_adapter *adapter, int tsintr_tt) static void igb_tsync_interrupt(struct igb_adapter *adapter) { + const u32 mask = (TSINTR_SYS_WRAP | E1000_TSICR_TXTS | + TSINTR_TT0 | TSINTR_TT1 | + TSINTR_AUTT0 | TSINTR_AUTT1); struct e1000_hw *hw = &adapter->hw; u32 tsicr = rd32(E1000_TSICR); struct ptp_clock_event event; + if (hw->mac.type == e1000_82580) { + /* 82580 has a hardware bug that requires an explicit + * write to clear the TimeSync interrupt cause. + */ + wr32(E1000_TSICR, tsicr & mask); + } + if (tsicr & TSINTR_SYS_WRAP) { event.type = PTP_CLOCK_PPS; if (adapter->ptp_caps.pps) -- 2.43.0