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 E173829C35B; Wed, 23 Apr 2025 15:26:50 +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=1745422011; cv=none; b=pjOPJn7t6b7jE1Kl6LbLvdsMf8uOa3Fw+bc/629UUelKWwKtmmst8XU5Bw3vuzp/8kOHnnFl3NtQlFk8Wxe8oz6axKPH8LB6aZ15VZndcDDPXUBCHv1SvNnMtdzHdPSFrhfLApzHxeBYTBgg3OQ99K1fp1w+/GoYWMDZkIe23Sw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745422011; c=relaxed/simple; bh=reJfm/CqDHFFZ12zaOxi7tglSlWOY3jDDUJOCtJlt7U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6Z9BqCWvq5G0lZevzmvwiaaD05uFb03TZZK77NxwGzYzvDUq4pkOfmzj/XtrvWBUk6CjQ1hMx30OK++4z8kM9e6gUzAYCgWxw2XaatDcDM8IX2CyfvvD6SeS9xbfsya+i2TNvm3zigNBifb1vtYo3SNGprZU8DJLozpwRRVmGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EOsLPhvb; 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="EOsLPhvb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16B99C4CEE2; Wed, 23 Apr 2025 15:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745422010; bh=reJfm/CqDHFFZ12zaOxi7tglSlWOY3jDDUJOCtJlt7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EOsLPhvbzsFcSIPmZImdAo/X67bM/W6mIQShNRfKyHMpyAauUs/IO5/6JQWjgq9WT 9yRHQ7cAEU3PNa91iJudmqEYhWwooFQ4Vnp0oB+z6aK/mi1mH0wFyy1NcqhjH/9znK /EdOeSXI9E5A6QzwoA0Aaq9MGjE9bpkOJAK9I4Co= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christopher S M Hall , Corinna Vinschen , Jacob Keller , Mor Bar-Gabay , Vinicius Costa Gomes , Tony Nguyen , Sasha Levin Subject: [PATCH 6.6 262/393] igc: handle the IGC_PTP_ENABLED flag correctly Date: Wed, 23 Apr 2025 16:42:38 +0200 Message-ID: <20250423142654.191156592@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250423142643.246005366@linuxfoundation.org> References: <20250423142643.246005366@linuxfoundation.org> User-Agent: quilt/0.68 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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christopher S M Hall [ Upstream commit 26a3910afd111f7c1a96dace6dc02f3225063896 ] 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 Reviewed-by: Corinna Vinschen Signed-off-by: Jacob Keller Tested-by: Mor Bar-Gabay Acked-by: Vinicius Costa Gomes Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- 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 adb31cccaf9a5..c5387610ca3df 100644 --- a/drivers/net/ethernet/intel/igc/igc_ptp.c +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c @@ -1191,8 +1191,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"); @@ -1213,6 +1217,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.39.5