From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 59B7335DA67; Thu, 30 Jul 2026 15:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785426440; cv=none; b=WtqwitMneFbbInvxtueh2sV1LDmBi7JXcKxA/XhZQElKV55VwRURH7GlcX1vIUyDVrli097J2W/1BCuU46BZxd3b9BKsgCpboEnYZGOTaNgPjuEY5Bwqc6KwLyhz7xLmzh+iA3+0o3TkQjMKHtkoM9hIKeu7KtmalIwzifrjB1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785426440; c=relaxed/simple; bh=DKHlWpe0wj4ywpZOUZoEtcmtUPJpusyUSeIqvExUp1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=COJd66UhcVTgfM1MI2faA9ZVGYHFDaYeP/+RSI0z8N8SjYvYDg/UP4Iod5t2QcIhLZ9OY2y7kN6JJtAKSimva78GOMed4wV8aXGhBkiyL9H6jIJRy8WLx+zE1Kx687TkwoY4aWKMMeQenB1esJbCrjxzG9bnUECz6sstNajqnVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fl9Nrg1E; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fl9Nrg1E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8C8A1F00A3A; Thu, 30 Jul 2026 15:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785426439; bh=oPOG5pueTGukgGtHMbKH1fLD3g609sMNJ16IUU3H+R4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fl9Nrg1EVODnrOAvH/npkXQl9MixkGXlNbIy7T8fK3pEtftUffmO3UUbt+9BUP4SW ntZbBvjQC+fAWAis63yjLgSL6b0YAmb6IccaKArLOEFrmCVOZgGQY2pJCvkFyK0Vru h6OwBI6Zm5psyWE1MfMQnz7Tk0JplhWLFcfYRecQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paul Greenwalt , Aleksandr Loktionov , Simon Horman , Tony Nguyen , Jakub Kicinski , Rinitha S Subject: [PATCH 6.12 418/602] ice: fix PTP Call Trace during PTP release Date: Thu, 30 Jul 2026 16:13:30 +0200 Message-ID: <20260730141444.748777803@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141435.976815864@linuxfoundation.org> References: <20260730141435.976815864@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Greenwalt commit f6a7e00b81e35ef1325234925f2fe1e53b466f92 upstream. If a PF reset occurs when the PTP state is ICE_PTP_UNINIT, then ice_ptp_rebuild() will update the state to ICE_PTP_ERROR. This will result in the following PTP release call trace during driver unload: kernel BUG at lib/list_debug.c:52! ice_ptp_release+0x332/0x3c0 [ice] ice_deinit_features.part.0+0x10e/0x120 [ice] ice_remove+0x100/0x220 [ice] This was observed when passing PF1 through to a VM. ice_ptp_init() fails because ctrl_pf is NULL and sets the state to ICE_PTP_UNINIT. Fix by detecting the ICE_PTP_UNINIT state in ice_ptp_rebuild() and returning without error, preventing the invalid state transition to ICE_PTP_ERROR. The only valid path to ICE_PTP_ERROR is from ICE_PTP_RESETTING after a failed rebuild. Fixes: 8293e4cb2ff5 ("ice: introduce PTP state machine") Cc: stable@vger.kernel.org Signed-off-by: Paul Greenwalt Signed-off-by: Aleksandr Loktionov Reviewed-by: Simon Horman Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260717185340.3595286-10-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ice/ice_ptp.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -2886,6 +2886,11 @@ void ice_ptp_rebuild(struct ice_pf *pf, struct ice_ptp *ptp = &pf->ptp; int err; + if (ptp->state == ICE_PTP_UNINIT) { + dev_dbg(ice_pf_to_dev(pf), "PTP was not initialized, skipping rebuild\n"); + return; + } + if (ptp->state == ICE_PTP_READY) { ice_ptp_prepare_for_reset(pf, reset_type); } else if (ptp->state != ICE_PTP_RESETTING) {