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 B76AD2FD7C3; Thu, 28 May 2026 20:29:16 +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=1780000157; cv=none; b=PqAMAhP1+3DqI8hPdiD5kQ3d8CJxunsv8PsBFKGL5TKGIZfmCqxiHhjxzfpIyIH+skLMGnzumYtYbxb+OWhVt5uSUgkyVoHIzODOLDDcRBUDjzpwvTq2TKVXWumIagGfnA5+cks2ZT1vCxw+e/tN32UwrFg7mCokUF4I5mVXUsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000157; c=relaxed/simple; bh=HX6HQLhaceHM1mRqUbRAGOLKacEoJfyXzbXD5OGBI5Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HfxZ8X64rUytR3G/rusBIF+j2e+/L5XinewCElwKavFI0EnYv4g7UBi1gGDQ0hs3OwZ9pbE6ca1IyZJXW8n54iLDMrtHyGkY+vJ6Tv3L4YAu1N/4Nl6Pvq9try9vwgbbXZ3KoW4USIODemtXHOccLqXbo8xfXkG612iwrZjDL6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SXXLMNGl; 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="SXXLMNGl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27F7E1F000E9; Thu, 28 May 2026 20:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000156; bh=zHYvlcuMX1m/fbmdJLge+P0R9ZFkm3mH6O/nGfNJSMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SXXLMNGls0hyJ4CKtInHWoHV3r+bMxR4jvp8Cmnw3O9adWFoVbzYMasDK+fgrGYUT iFBvnt3zRH+n8dl+kNFhMTZLhNRsvbI7MleAI6AjpRoimbgLWKyPuc15ccjXEDda/U dqBLG7jMgUhnk4S7+dPfMjPsds5KkdL1RRGrF2po= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arkadiusz Kubalewski , Grzegorz Nitka , Aleksandr Loktionov , Alexander Nowlin , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 323/377] ice: ptp: use primary NAC semaphore on E825 Date: Thu, 28 May 2026 21:49:21 +0200 Message-ID: <20260528194647.757498081@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Grzegorz Nitka [ Upstream commit 7b28523546c7e4adbb8436f2986efcfc8382985e ] For E825 2xNAC configurations, PTP semaphore operations must hit the primary NAC register block so both sides coordinate on the same lock. Commit e2193f9f9ec9 ("ice: enable timesync operation on 2xNAC E825 devices") updated other primary-only PTP register accesses to use the primary NAC on non-primary functions, but left ice_ptp_lock() and ice_ptp_unlock() operating on the local NAC. As a result, secondary NAC PTP paths can take a different semaphore than the primary side. Select the primary hardware in ice_ptp_lock() and ice_ptp_unlock() when the current function is not primary, keeping semaphore operations symmetric and consistent with the rest of the 2xNAC PTP register access path. Fixes: e2193f9f9ec9 ("ice: enable timesync operation on 2xNAC E825 devices") Reviewed-by: Arkadiusz Kubalewski Signed-off-by: Grzegorz Nitka Reviewed-by: Aleksandr Loktionov Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20260515182419.1597859-6-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c index 0f378e68f72f1..99bf38cf352a2 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -5264,9 +5264,13 @@ static void ice_ptp_init_phy_e830(struct ice_ptp_hw *ptp) */ bool ice_ptp_lock(struct ice_hw *hw) { + struct ice_pf *pf = container_of(hw, struct ice_pf, hw); u32 hw_lock; int i; + if (!ice_is_primary(hw)) + hw = ice_get_primary_hw(pf); + #define MAX_TRIES 15 for (i = 0; i < MAX_TRIES; i++) { @@ -5293,6 +5297,11 @@ bool ice_ptp_lock(struct ice_hw *hw) */ void ice_ptp_unlock(struct ice_hw *hw) { + struct ice_pf *pf = container_of(hw, struct ice_pf, hw); + + if (!ice_is_primary(hw)) + hw = ice_get_primary_hw(pf); + wr32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id), 0); } -- 2.53.0