From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C541C48BF6 for ; Sat, 17 Feb 2024 01:05:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D44FA41F6F; Sat, 17 Feb 2024 01:05:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3pz1GJz8eKY0; Sat, 17 Feb 2024 01:05:34 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0BB2742141 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1708131934; bh=6gc75gOyZPE6SubXe97RJ+/1694qv1vtWOhxiGTkuEU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=vnFS8zyvFwZHCdvGz6kiW4soPxfKVAFWUfQuMB6NdIHGuHhaCGsDI4unF/UJltPxp p22YPALGX8XJXanu5R8lBegmE1oC3O0nZgZyskwNNoFgMnDKOfB5VwP7sO6q6z8CYL xVIqLHs7qRmWCcZBHT4uHzqjTJe6AkaAL2Ad0IvXlvovwmYio1vQZr6lsNZkBnGa1z TGJQV30ugrwsTIXqPCRZHp0fUvwJdqbss0d49llxY/L8XoTn5HG8eCEhy0H4wYMiBe aZGW4nRfxL87Ri3HLr2uOLf6HT323FYGANI+wq46HMNTnzFJ4v9dEKUqYjDouA7/Rs q8ror8YDEuckg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0BB2742141; Sat, 17 Feb 2024 01:05:34 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 8C70F1BF263 for ; Sat, 17 Feb 2024 01:05:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EEE7041CE1 for ; Sat, 17 Feb 2024 01:05:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZcR0F60KkrQs for ; Sat, 17 Feb 2024 01:05:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.10; helo=mgamail.intel.com; envelope-from=vinicius.gomes@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 3295F40A65 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3295F40A65 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3295F40A65 for ; Sat, 17 Feb 2024 01:05:28 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10986"; a="13671720" X-IronPort-AV: E=Sophos;i="6.06,165,1705392000"; d="scan'208";a="13671720" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 17:05:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,165,1705392000"; d="scan'208";a="3953433" Received: from unknown (HELO vcostago-mobl3.lan) ([10.125.18.63]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2024 17:05:23 -0800 From: Vinicius Costa Gomes To: intel-wired-lan@lists.osuosl.org Date: Fri, 16 Feb 2024 17:04:54 -0800 Message-ID: <20240217010455.58258-3-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240217010455.58258-1-vinicius.gomes@intel.com> References: <20240217010455.58258-1-vinicius.gomes@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708131929; x=1739667929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3gIhMRxOTlYjhdMs6F0CktjFPYvv26wJULWvOFObDFc=; b=ayj0E+Hf8vFuJ1K+t54QzYKlcvl2bbweVU95fFipVnuq/5RxhSRJgiWn LYAyTjmEA1vebvIKHp8i7sy43rgpRlSjE9wrYEpqZrhtVV00uFVM4LCFP bE1JDjG567KSbYlSNDDEW1BloZHkViEciZEf/iHeMe0BUSKHDrfuNOpKa VWpzUNWeT9hV0d7rZie1vZPiK4C622aP/kHIuHVZeSW19cfK0xz8bcto1 mvA78mCYanAiteB828sbpQc0pbFMbWDBg/P6w6nNFyDLzTyaEW0ur9QDT +MNZIZnQpIpotYvVS5LSKfxj80zUPo1LeAIHj+cj2H78zbQy/hEs893pC A==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ayj0E+Hf Subject: [Intel-wired-lan] [iwl-net v1 2/2] igb: Fix missing time sync events X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sasha.neftin@intel.com, Vinicius Costa Gomes , netdev@vger.kernel.org, richardcochran@gmail.com, kurt@linutronix.de, jesse.brandeburg@intel.com, linux-kernel@vger.kernel.org, Eric Dumazet , anthony.l.nguyen@intel.com, Jeff Kirsher , Jakub Kicinski , Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Fix "double" clearing of interrupts, which can cause external events or timestamps to be missed. The E1000_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 E1000_TSIRC into 'tsicr'; 2. handle the interrupts present into 'tsirc' and mark them in 'ack'; 3. write 'ack' into E1000_TSICR; As both (1) and (3) will clear the interrupt cause, if an interrupt happens between (1) and (3) it will be ignored, causing events to be missed. Remove the extra clear in (3). Fixes: 00c65578b47b ("igb: enable internal PPS for the i210") Signed-off-by: Vinicius Costa Gomes --- drivers/net/ethernet/intel/igb/igb_main.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index cebb44f51d5f..7662c42e35c1 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -6985,44 +6985,31 @@ static void igb_extts(struct igb_adapter *adapter, int tsintr_tt) static void igb_tsync_interrupt(struct igb_adapter *adapter) { struct e1000_hw *hw = &adapter->hw; - u32 ack = 0, tsicr = rd32(E1000_TSICR); + u32 tsicr = rd32(E1000_TSICR); struct ptp_clock_event event; if (tsicr & TSINTR_SYS_WRAP) { event.type = PTP_CLOCK_PPS; if (adapter->ptp_caps.pps) ptp_clock_event(adapter->ptp_clock, &event); - ack |= TSINTR_SYS_WRAP; } if (tsicr & E1000_TSICR_TXTS) { /* retrieve hardware timestamp */ schedule_work(&adapter->ptp_tx_work); - ack |= E1000_TSICR_TXTS; } - if (tsicr & TSINTR_TT0) { + if (tsicr & TSINTR_TT0) igb_perout(adapter, 0); - ack |= TSINTR_TT0; - } - if (tsicr & TSINTR_TT1) { + if (tsicr & TSINTR_TT1) igb_perout(adapter, 1); - ack |= TSINTR_TT1; - } - if (tsicr & TSINTR_AUTT0) { + if (tsicr & TSINTR_AUTT0) igb_extts(adapter, 0); - ack |= TSINTR_AUTT0; - } - if (tsicr & TSINTR_AUTT1) { + if (tsicr & TSINTR_AUTT1) igb_extts(adapter, 1); - ack |= TSINTR_AUTT1; - } - - /* acknowledge the interrupts */ - wr32(E1000_TSICR, ack); } static irqreturn_t igb_msix_other(int irq, void *data) -- 2.43.2