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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 618E0D59F69 for ; Wed, 6 Nov 2024 18:58:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 95C6D6090A; Wed, 6 Nov 2024 18:58:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id zmVbi0Le8tF6; Wed, 6 Nov 2024 18:58:54 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 64C97608D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1730919534; bh=ssImHwbC7zp4CSTGYQ3B1o2RJxl8VB9zptYKfJ90+LM=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vJEdDjV8KMX5CZknD6cweNWOyb4aDi/Noj1msjP3Notn/p08I999a3VGPkmvNzHxa pFmcX1A8op5nE9fD7HzH6iD/TyouUPA+ab4p/DkpmSHjkVyXhdk+QxSro7FXj8/t82 ELkIpxeMsLlCFu9pFdOyVOm2D6A7ieWcDDMtQb+9gp7U+gxgwgTQrt8c432zHDbXJQ 6aIdvHOfNHLAJZucoSVzq6Rk5lWvG6kqM7xpPJrqaepEkkz4AIcYdcpcZTH1PiWgQz VKY5LZMTr1OU5qPvspf7nez9+aoWPWPCoN6NE+9uPNCaW6A3AzSohYJ5UZKIP+upnQ beu7F+3OerPoQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 64C97608D1; Wed, 6 Nov 2024 18:58:54 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id 2332A3B for ; Wed, 6 Nov 2024 18:58:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F08C540450 for ; Wed, 6 Nov 2024 18:58:52 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id W5CeJ0wKAEZC for ; Wed, 6 Nov 2024 18:58:52 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.14; helo=mgamail.intel.com; envelope-from=christopher.s.hall@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 1647D400D8 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 1647D400D8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by smtp2.osuosl.org (Postfix) with ESMTPS id 1647D400D8 for ; Wed, 6 Nov 2024 18:58:51 +0000 (UTC) X-CSE-ConnectionGUID: sNnD/WUgQ42D1r1miTPJJw== X-CSE-MsgGUID: gN2MqbnxRJCiFO2OQE52LQ== X-IronPort-AV: E=McAfee;i="6700,10204,11248"; a="30959473" X-IronPort-AV: E=Sophos;i="6.11,263,1725346800"; d="scan'208";a="30959473" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2024 10:58:51 -0800 X-CSE-ConnectionGUID: Wt116T5XSFmacTxaz98PaQ== X-CSE-MsgGUID: kiB6UEE4S4ecp80eDo+RnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,263,1725346800"; d="scan'208";a="89813797" Received: from timelab-spr11.ch.intel.com ([143.182.136.151]) by orviesa004.jf.intel.com with ESMTP; 06 Nov 2024 10:56:41 -0800 From: Christopher S M Hall To: intel-wired-lan@lists.osuosl.org Cc: david.zage@intel.com, vinicius.gomes@intel.com, netdev@vger.kernel.org, rodrigo.cadore@l-acoustics.com, vinschen@redhat.com Date: Wed, 6 Nov 2024 18:47:20 +0000 Message-Id: <20241106184722.17230-5-christopher.s.hall@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106184722.17230-1-christopher.s.hall@intel.com> References: <20241106184722.17230-1-christopher.s.hall@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=1730919532; x=1762455532; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QOTNwCbXC0dEBBEghJ97he0ts6uyFWd6JAr1mw42WaI=; b=OEW0wQEraUJMjX4kWMJjC3XPCE53BHxfDlNk43QzONyb52J+iMmOVfKF Yn7HnfU+qZOcyvwwbkOmJFVyfjP+tcuSVwwgmjaYuDIqiCwAjiat5glEv 5g1TIHsECGb86bARDaemYmAZDx/cX+a6KNT6eyTf40bdC/j/bZVRPJxA6 jBQohJA1CeSj7OZBKTUC1/M2E8AvRRoXU+L6T/YMQoMG4kNNagHsyEja3 ZNtyrhv93M9gp6YyJVn95yUgWwOdAFaYoA/oM2Rz9Emc9O5bYZvVhqWZi 1xHRBM6HMexd0CVKQ5V4P7uYOD7NPpZKaqCVHEVHg9nYDHNnDRBrG7Aqp g==; 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, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OEW0wQEr Subject: [Intel-wired-lan] [PATCH iwl-net v3 4/6] igc: Handle the IGC_PTP_ENABLED flag correctly X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" All functions in igc_ptp.c called from igc_main.c should check the IGC_PTP_ENABLED flag. Adding check for this flag to stop and reset functions. Fixes: 5f2958052c58 ("igc: Add basic skeleton for PTP") Signed-off-by: Christopher S M Hall --- drivers/net/ethernet/intel/igc/igc_ptp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c index 516abe7405de..343205bffc35 100644 --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -1244,8 +1244,12 @@ void igc_ptp_suspend(struct igc_adapter *adapter) **/ void igc_ptp_stop(struct igc_adapter *adapter) { + if (!(adapter->ptp_flags & IGC_PTP_ENABLED)) + return; + igc_ptp_suspend(adapter); + adapter->ptp_flags &= ~IGC_PTP_ENABLED; if (adapter->ptp_clock) { ptp_clock_unregister(adapter->ptp_clock); netdev_info(adapter->netdev, "PHC removed\n"); @@ -1266,6 +1270,9 @@ void igc_ptp_reset(struct igc_adapter *adapter) unsigned long flags; u32 timadj; + if (!(adapter->ptp_flags & IGC_PTP_ENABLED)) + return; + /* reset the tstamp_config */ igc_ptp_set_timestamp_mode(adapter, &adapter->tstamp_config); -- 2.34.1