From nobody Mon Oct 6 01:25:48 2025 Received: from smtp.blochl.de (mail.blochl.de [151.80.40.192]) (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 055A423F421; Fri, 25 Jul 2025 20:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=151.80.40.192 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753475632; cv=none; b=MRviHI7k4t6gDzHHJCeUdw762ST0ca1AjT/IqWdk5IwaU27AJiClHLjTtqegHuLJAhjZy1K/ZRXYAsa7Smn8JJw+wpdZ1R/43mCPxbbBUvtr+q8dpUVIBYawkUfZmSd6g3SZRNSZREN3sjimTxoKefNgitTbJJufyzlqSsPmhxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753475632; c=relaxed/simple; bh=Um8nTzh656Pi7VP5BcSWXmH++wVExc/uJZ0Tx3+/PtM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kDEDGjqjPEZ6ERgzaNXGFDVEL+vyail0zsMEq2jJXomio3Pdlxj/JCrkrp7CDoTsvcATthF/4eeDp9bDMiiUPoExCgFnYyaf0wjttVj3FxllzaNB7z6S0wi0kREQjt0Yr1kvcK+iqQ+5YfCOTl3Nak9N8BYb9sc8RoXnb1Yee8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blochl.de; spf=pass smtp.mailfrom=blochl.de; arc=none smtp.client-ip=151.80.40.192 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blochl.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=blochl.de DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.blochl.de 154C644664AD Authentication-Results: mail.blochl.de; dmarc=none (p=none dis=none) header.from=blochl.de Authentication-Results: mail.blochl.de; spf=fail smtp.mailfrom=blochl.de Received: from WorkKnecht.fritz.box (ppp-93-104-0-143.dynamic.mnet-online.de [93.104.0.143]) by smtp.blochl.de (Postfix) with ESMTPSA id 154C644664AD; Fri, 25 Jul 2025 20:33:36 +0000 (UTC) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 1.4.2 at 472b552e6fe8 Date: Fri, 25 Jul 2025 22:33:31 +0200 From: Markus =?utf-8?Q?Bl=C3=B6chl?= To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Anton Nadezhdin , markus.bloechl@ipetronik.com Subject: [PATCH] ice/ptp: fix crosstimestamp reporting Message-ID: <20250725-ice_crosstimestamp_reporting-v1-1-3d0473bb7b57@blochl.de> X-B4-Tracking: v=1; b=H4sIAELpg2gC/x3MQQqFIBAA0KvErBPKyqKrxCfMpppFKjPyCaK7J y3f5t0gyIQCY3ED45+Egs+oywLcYf2OitZs0JXuqr42ihzOjoNIohMl2TPOjDFwIr+rxejGWN0 a1w6Qi8i40fX10+95Xh9SEVhuAAAA X-Change-ID: 20250716-ice_crosstimestamp_reporting-b6236a246c48 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (smtp.blochl.de [0.0.0.0]); Fri, 25 Jul 2025 20:33:36 +0000 (UTC) From: Anton Nadezhdin commit a5a441ae283d upstream. Set use_nsecs=3Dtrue as timestamp is reported in ns. Lack of this result in smaller timestamp error window which cause error during phc2sys execution on E825 NICs: phc2sys[1768.256]: ioctl PTP_SYS_OFFSET_PRECISE: Invalid argument This problem was introduced in the cited commit which omitted setting use_nsecs to true when converting the ice driver to use convert_base_to_cs(). Testing hints (ethX is PF netdev): phc2sys -s ethX -c CLOCK_REALTIME -O 37 -m phc2sys[1769.256]: CLOCK_REALTIME phc offset -5 s0 freq -0 delay 0 Fixes: d4bea547ebb57 ("ice/ptp: Remove convert_art_to_tsc()") Signed-off-by: Anton Nadezhdin Reviewed-by: Aleksandr Loktionov Reviewed-by: Arkadiusz Kubalewski Tested-by: Rinitha S Signed-off-by: Tony Nguyen Signed-off-by: Markus Bl=C3=B6chl --- Hi Greg, please consider this backport for linux-6.12.y It fixes a regression from the series around d4bea547ebb57 ("ice/ptp: Remove convert_art_to_tsc()") which affected multiple drivers and occasionally caused phc2sys to fail on ioctl(fd, PTP_SYS_OFFSET_PRECISE, ...). This was the initial fix for ice but apparently tagging it for stable was forgotten during submission. The hunk was moved around slightly in the upstream commit=20 92456e795ac6 ("ice: Add unified ice_capture_crosststamp") from ice_ptp_get_syncdevicetime() into another helper function ice_capture_crosststamp() so its indentation and context have changed. I adapted it to apply cleanly. --- drivers/net/ethernet/intel/ice/ice_ptp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/etherne= t/intel/ice/ice_ptp.c index 7c6f81beaee4602050b4cf366441a2584507d949..369c968a0117d0f7012241fd3e2= c0a45a059bfa4 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -2226,6 +2226,7 @@ ice_ptp_get_syncdevicetime(ktime_t *device, hh_ts =3D ((u64)hh_ts_hi << 32) | hh_ts_lo; system->cycles =3D hh_ts; system->cs_id =3D CSID_X86_ART; + system->use_nsecs =3D true; /* Read Device source clock time */ hh_ts_lo =3D rd32(hw, GLTSYN_HHTIME_L(tmr_idx)); hh_ts_hi =3D rd32(hw, GLTSYN_HHTIME_H(tmr_idx)); --- base-commit: d90ecb2b1308b3e362ec4c21ff7cf0a051b445df change-id: 20250716-ice_crosstimestamp_reporting-b6236a246c48 Best regards, --=20 Markus Bl=C3=B6chl --=20