Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 EE37663B9 for ; Mon, 27 Jul 2026 22:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.7 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785192425; cv=fail; b=Iu1zhZpIP2BHXzPkhmDQyC9f9vVcpVfaL+PCFxL/dswEcj1JdKP3rE8FvSeZ1WKlo46A3aLaBVsAP7cnXGUZW5CkzbZLkxcfYULjaERB2jmfqs6DF88LwMuwIkh3sNb+7IZBy1u16rIKNVFcw968/sscTgB9zLwbHx3PElfha7k= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785192425; c=relaxed/simple; bh=F/EL4Jc5KtZLYooPCPIlsrKj513ptlBel/96uu8ZcB4=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=MoREL2GiTgMVgYDl8wNJGw3pPPujPbUyc3h5JvZs3PsIv0MRAGVGj77kbqgyn9mI5pKT/5oQ6urGR3d4Jwvhnzzufah2iOV55/bJmsD32joUSw5Gn+Yi9uagqiTCDAamIOKBr/1Q4zd7iuPD6dw3cjHvIsjXI9SXs+gxd+oI90o= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eLAXymZZ; arc=fail smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eLAXymZZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785192424; x=1816728424; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=F/EL4Jc5KtZLYooPCPIlsrKj513ptlBel/96uu8ZcB4=; b=eLAXymZZIZITHcsZy8sdGSd8dh45+RvzJu2036zKvDV/AGepbo9ReLMD WfN8K4DOolUtWmGaa23QUXyLOV3B5ei2R/WHL8SetjszmZatq/u9MHOco YHFga/EFbMbGMhgb6VdGh6VXWrrxTgEZpA0SLlrWXWXGyb/Zcc5I3VjC4 IxwzqK9zxo9xUc9ZTIvcti6sqT+x2S5PuserXf3Wbe7pq+mxjALoe9IQ4 yF5Px3N73THoLZw0wiUNWcGeKkFHkrPILy7JLTWXgW9iL/N2bh/TIziyY j6r3iKtmSxMY1vBYARK6OrubpK4amGYBW+mfpGjP0UxJeJ5WrNRaF5kSK w==; X-CSE-ConnectionGUID: ytZk1Y9lQhWDig+yxtCuug== X-CSE-MsgGUID: Xjg2FGFlRn6r8sLHncKNcw== X-IronPort-AV: E=McAfee;i="6800,10657,11858"; a="111314656" X-IronPort-AV: E=Sophos;i="6.25,189,1779174000"; d="scan'208";a="111314656" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2026 15:47:03 -0700 X-CSE-ConnectionGUID: qJAZnhC4SKOb9E5RawxbmA== X-CSE-MsgGUID: gXPgY3tHSM2uYbN4Q9uDeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,189,1779174000"; d="scan'208";a="263323660" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by orviesa004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2026 15:47:04 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Mon, 27 Jul 2026 15:47:03 -0700 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43 via Frontend Transport; Mon, 27 Jul 2026 15:47:02 -0700 Received: from SJ2PR03CU001.outbound.protection.outlook.com (52.101.43.6) by edgegateway.intel.com (134.134.137.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Mon, 27 Jul 2026 15:47:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PueMIzx76rQjf1edOJdgjYY/1E55gGA9kY7up6DKKniijPKrSzkKNeZu/rBO5cHjjCw4o//J45UAWlUMTeWwFbWGfbcnol9cVa1IvRLs3/94URdcLBtYlXXNyg1f37Sk9zx7zuKyOWyVdofv7RtiumovMDBytziubqcjb6XMQaCCQIPJ8QktTlspq37hbA8iOhLKKpSGHsBP8G2MV0Q3gLHhNRxNPueGiXF6SAbTbEvI9Sml545MTosz2kBF7ekseQgDrrXtwi2QOuGeRirdSZELbLzw3ZwuzBpPGSdPu5Kb8g3SjyBR4s+ExGzXk0gwnoAaZ2Y0gtag72egPlsfgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TzWHPDlA9GvETvj7Xa6EvoraNBLD9PaKyldHLPWQnMM=; b=JeXFZxn9ldknsNZxnmq60i1M2jifv99HOCahFMw+NCa1opW5P4344zcFRs1Km9kbEmm5u8SYE0sy7HgMLj+jqdw9d7jlMOGDZu5yK43aQyhISipmf+dr6nzk0lT7jO+A9WJb5IdnibS9WXg8+wtCPRYNIO1jfRvmoSrFqsq/epgiV9XfjGIJE+X8Po+3JFA6YD3/lwQu6r6ddVTnmI04/dUqehOqUDyeAE6LXtUvZS4CYxdnudlgGLGGUmIQOikp1bOJ+QtyapMF/sMLFD4s43MoBxER7tDsPfsvYApvlziQhLj+sxKQ2daTzcvfkItTo4MTxC7ILnX7veeo+D1/HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7381.namprd11.prod.outlook.com (2603:10b6:8:134::14) by MW6PR11MB8391.namprd11.prod.outlook.com (2603:10b6:303:243::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul 2026 22:47:00 +0000 Received: from DS0PR11MB7381.namprd11.prod.outlook.com ([fe80::4c39:dfe6:d6dc:6f58]) by DS0PR11MB7381.namprd11.prod.outlook.com ([fe80::4c39:dfe6:d6dc:6f58%6]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026 22:47:00 +0000 Message-ID: Date: Mon, 27 Jul 2026 15:46:56 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [Intel-wired-lan] [PATCH iwl-net 2/4] ice: clear unexpected Tx timestamp ready bits to prevent stuck PHY To: "Korba, Przemyslaw" , "Oros, Petr" , "intel-wired-lan@lists.osuosl.org" CC: "netdev@vger.kernel.org" , "Kubalewski, Arkadiusz" , "Loktionov, Aleksandr" , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , "Ilichev, Konstantin" References: <20260720120151.2675206-1-przemyslaw.korba@intel.com> <20260720120151.2675206-3-przemyslaw.korba@intel.com> Content-Language: en-US From: Jacob Keller In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW3PR05CA0021.namprd05.prod.outlook.com (2603:10b6:303:2b::26) To DS0PR11MB7381.namprd11.prod.outlook.com (2603:10b6:8:134::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7381:EE_|MW6PR11MB8391:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f72b008-0ae8-4e37-a516-08deec30f820 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|23010399003|1800799024|6133799003|18002099003|22082099003|56012099006|4143699003|5023799004|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: /dN+WUtAw7MjK6yE/Wbg4jiO/z6ScWJ0Hku59bFffC+ZfRq+ZO7Pui7ghgwO3ohaJW2PFVFechRBynx3oTPOD5d7aj4CqGvwTNCSQQrVfDVZqKJ0HvzRqsMw6yy9uT8ty3Kug5WPjjWTnnzscVqTVZQUaVdrO41jNGWcthLkItgEORxc0dc0nI9U2oC5QKc4ucQyA9ngqSmd5gQLpvYl10VAVvyd+0Wan3ZPVzBQeV0kcOxdJ+xQ8MX5pt57c0g9MgPlBZkyQ4KvH8EIZhhDLtG/nMfpaFW0ZiwgxY6qEvpL0LNz0Im7uJRxyQSKa0IewcVFm5jswUEFf1bswL/1BdZb5tAdNh85iC7bylvyipsaQuYjIg/63vVq3EvN+HLsSh/hyfxnYaFLkYtHN+Cq9gFleu8VWMc/I0cpjJc5nG8MGhejFZvC9Dt7BeiNY+UnyqRXfQ/IvBn7G+1KZb9lGR3yJFLYpy+hj5whtJ0spTQac4K139zjEJvAv/+rJqj8eNEObih2XUCDlOdDeAh7SvYX+JXH6zXIyvWXQY5PrTH5Ulg0sAHVvKVe8LY71JnqyH2ptkqq/el/NCeGAbXBuGVQlZTdS6chpzs8gr80C2+3Zb/Q2aOJ+PAc890tAV6YdGD0mRHONyOWiSorFfsmjtWLLHNwWpa4y04mTAp14Os= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7381.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(23010399003)(1800799024)(6133799003)(18002099003)(22082099003)(56012099006)(4143699003)(5023799004)(11063799006)(10067099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dS9mcWozSVpkZEl4NFhmeHZ4SHcwVjVwUGV5SDEwK1BnYlMzeE5SKzZwbHZk?= =?utf-8?B?bFQ2SXBiMkhmZHpES2o3MjdLM3N2N2tlTjNVVnRKN0YrVlllL1VnWURTdFBi?= =?utf-8?B?OWh2OUN4cWNFTlMvSGVLK0luOGxsWnkzVXZybVhtM0hmWFcvM0xGN0YzTkc2?= =?utf-8?B?NlhoMWE5TTN3WEN0czlKQk5JQTNvaEppRXlqNk5EUEltNWgyRC9FRWdGMEVh?= =?utf-8?B?RDNaempwdUxhS0hrNnErdUpvRi9GUGhRWFdlY1d1NGNNVCtScDJaTGZRS1VW?= =?utf-8?B?MzR4Z3JtQlJmckRtSkhEQ0ZkZjNidG9qNzJhQUNwa0t5Tms2OEhNcllOMUxG?= =?utf-8?B?NHUvR0JCckhsRXdJUFkzWE1qa1E4U3B2RGhUb05yNlpnRlhBekVSVGdZL0pI?= =?utf-8?B?WnZ0MVlvSHFQbHhoL1pSL2FCUDhPd2hSSkREV3FoM3o2MjhLaDFjOXIrR3dP?= =?utf-8?B?enFsM1ZJMDhMSVozaWFCSz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WpNNWZK?= =?utf-8?B?ek44Qk9qcG1mZ3hJcTFpS2lVcDlXc2hpeW9LQ0J1aVRobkk1ZzhsUT09?= X-Exchange-RoutingPolicyChecked: iYKplijPcCXqSKxYUe6zsWXKr1u6j65qYS/fn+LI2fqIt40U1BkcAka8RTpXBBu8Iagm2inyKkB4sQV7Yu6cLISa8C0bA0VBQjaqBKpVTHi7Y1NhnSqrEL2G49cK3f/Il3tb05iYoc84XsTm6ooAbOV2IeM5GDNSCKB1h/tjwN4Ggxm6K3L2cwCdsnff22u5yHklBgaJ8tjts/X/fXhlfIuWalm1ZTaviHkptIkL3fL2+C9LnkNHn7h8JilfBewQr540y+5bZVm/Ryu64XV+7cRynJO+uHiR/njTt/z0wmTiGfJwlUSWoyNEr7SR4ROb11aGh4V4bY6SkxIAQqbLlA== X-MS-Exchange-CrossTenant-Network-Message-Id: 2f72b008-0ae8-4e37-a516-08deec30f820 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7381.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 22:47:00.0408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hivaNqXAuFuOFrzrSpkUQG+D7ryYDBLno8RGXrwYY6SxIFeCy/42q9cz/Ei6pZmxr66Qj1kmMej7Nc7fSYPlmkCi5P5eU/1yRz4TU4ufhQk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR11MB8391 X-OriginatorOrg: intel.com On 7/27/2026 1:21 AM, Korba, Przemyslaw wrote: > > > >> -----Original Message----- >> From: Korba, Przemyslaw >> Sent: Thursday, July 23, 2026 3:16 PM >> To: 'Petr Oros' ; intel-wired-lan@lists.osuosl.org >> Cc: netdev@vger.kernel.org; Kubalewski, Arkadiusz ; Loktionov, Aleksandr >> ; Nguyen, Anthony L ; Kitszel, Przemyslaw ; >> Ilichev, Konstantin >> Subject: RE: [Intel-wired-lan] [PATCH iwl-net 2/4] ice: clear unexpected Tx timestamp ready bits to prevent stuck PHY >> >> >> >> >>> -----Original Message----- >>> From: Petr Oros >>> Sent: Thursday, July 23, 2026 10:27 AM >>> To: Korba, Przemyslaw ; intel-wired-lan@lists.osuosl.org >>> Cc: netdev@vger.kernel.org; Kubalewski, Arkadiusz ; Loktionov, Aleksandr >>> ; Nguyen, Anthony L ; Kitszel, Przemyslaw ; >>> Ilichev, Konstantin >>> Subject: Re: [Intel-wired-lan] [PATCH iwl-net 2/4] ice: clear unexpected Tx timestamp ready bits to prevent stuck PHY >>> >>> >>> On 7/20/26 14:01, Przemyslaw Korba wrote: >>>> From: Jacob Keller >>>> >>>> Clear orphaned timestamp ready bits left in the PHY when a packet is >>>> timestamped just as the link goes down. The driver clears its software >>>> in_use bits during link-down cleanup, but the PHY has already latched >>>> the timestamp, so on the next link-up a stale ready bit from the >>>> previous link cycle remains set with no matching in_use entry. >>>> >>>> The PHY timestamp interrupt logic will not generate a new interrupt >>>> until ALL outstanding ready bits have been read. ice_ptp_process_tx_ >>>> tstamp() only iterates slots set in the software in_use bitmap, so it >>>> never reads these orphaned slots. The result is a permanent interrupt >>>> deadlock: >>>> >>>> 1. The PHY has ready bits set for slots with no in_use tracker entry >>>> 2. The driver never reads those slots because in_use is clear >>>> 3. The PHY refuses to generate new timestamp interrupts >>>> 4. All future Tx timestamps permanently fail >>>> 5. Only a power-on reset can recover the device >>>> >>>> Clear these stale ready bits on link-up, in ice_ptp_link_change(), >>>> before any new timestamp requests arrive, scoped to the affected port >>>> only so timestamps still pending on other ports are left untouched. For >>>> every affected MAC the clearing iterates the not-in_use slots with >>>> for_each_clear_bit(), so a pending software request is never discarded >>>> and tx->lock need not be held across the PHY access: >>>> >>>> - E810 is skipped (guarded by tx->has_ready_bitmap) because >>>> ice_get_phy_tx_tstamp_ready_e810() returns an all-ones bitmap rather >>>> than a real ready status. >>>> - E830 and E825/eth56g read the real Tx timestamp ready bitmap and >>>> clear only the slots the PHY actually latched, via >>>> ice_clear_phy_tstamp(). If the ready bitmap cannot be read, the >>>> clear is skipped and a rate-limited warning is logged. >>>> >>>> On every MAC the ready bit is cleared by reading the slot's timestamp >>>> memory; the orphaned bits linger only because the normal processing path >>>> never reads those not-in_use slots. The link-up recovery clears them by >>>> reading the timestamp memory via ice_clear_phy_tstamp(): >>>> >>>> - E830: add ice_clear_phy_tstamp_e830(), which reads the >>>> PRTTSYN_TXTIME_H/L registers to clear the entry, and add an >>>> ICE_MAC_E830 case to the ice_clear_phy_tstamp() dispatch. >>>> - eth56g: ice_clear_ptp_tstamp_eth56g() reads the timestamp memory >>>> location, which per the PHY spec is the operation that clears the >>>> entry's valid bit and its corresponding (read-only) ts_memory_status >>>> bit. The ts_memory_status registers cannot be written to clear a >>>> bit, so only reading the timestamp memory has any effect. >>>> >>>> The new for_each_clear_bit() loop runs from the service task via link >>>> events. During device removal, tx->in_use is freed before the service >>>> task is stopped. Fix by stopping the service task at the start of >>>> ice_unload(), before ice_ptp_release() frees tx->in_use. >>>> >>>> Reviewed-by: Grzegorz Nitka >>>> Signed-off-by: Jacob Keller >>>> Signed-off-by: Arkadiusz Kubalewski >>>> Signed-off-by: Przemyslaw Korba >>>> --- >>>> drivers/net/ethernet/intel/ice/ice_main.c | 1 + >>>> drivers/net/ethernet/intel/ice/ice_ptp.c | 72 +++++++++++++++-- >>>> drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 89 +++++++++++++++++---- >>>> drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 1 + >>>> drivers/net/ethernet/intel/ice/ice_type.h | 7 ++ >>>> 5 files changed, 149 insertions(+), 21 deletions(-) >>>> >>>> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c >>>> index e3d3810c791f..231d533309cb 100644 >>>> --- a/drivers/net/ethernet/intel/ice/ice_main.c >>>> +++ b/drivers/net/ethernet/intel/ice/ice_main.c >>>> @@ -5169,6 +5169,7 @@ void ice_unload(struct ice_pf *pf) >>>> >>>> devl_assert_locked(priv_to_devlink(pf)); >>>> >>>> + ice_service_task_stop(pf); >>>> ice_unplug_aux_dev(pf); >>>> ice_deinit_rdma(pf); >>>> ice_deinit_features(pf); >>>> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c >>>> index 1aa440b0639f..9d9d9958fe5c 100644 >>>> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c >>>> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c >>>> @@ -1372,15 +1372,73 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup) >>>> switch (hw->mac_type) { >>>> case ICE_MAC_E810: >>>> case ICE_MAC_E830: >>>> - /* Do not reconfigure E810 or E830 PHY */ >>>> + case ICE_MAC_GENERIC_3K_E825: >>>> + /* Do not reconfigure E810 or E830 PHY, but on link-up clear >>>> + * any stale timestamp ready bits left over from a previous >>>> + * link cycle. The PHY may have latched timestamps for packets >>>> + * in flight when the link went down; these must be cleared >>>> + * before new timestamp requests arrive. >>>> + * >>>> + * E810 does not have a real ready bitmap >>>> + * (ice_get_phy_tx_tstamp_ready_e810 returns all-ones), so >>>> + * skip clearing on E810 to avoid unnecessary sideband queue >>>> + * operations for every not-in-use slot on each link-up. >>>> + */ >>>> + if (linkup && ptp_port->tx.has_ready_bitmap) { >>>> + struct ice_ptp_tx *tx = &ptp_port->tx; >>>> + u64 tstamp_ready; >>>> + int i; >>>> + >>>> + if (ice_get_phy_tx_tstamp_ready(hw, tx->block, >>>> + &tstamp_ready)) { >>>> + dev_warn_ratelimited(ice_pf_to_dev(pf), >>>> + "PTP failed to read Tx timestamp ready bitmap on link-up; stale PHY timestamps may >>> remain and stall Tx timestamping\n"); >>>> + } else { >>>> + /* Only clear stale ready bits for slots that >>>> + * have no in-flight software request. Iterating >>>> + * the not-in-use slots skips any concurrent >>>> + * ice_ptp_request_ts() allocation without >>>> + * holding tx->lock across the PHY access. E830 >>>> + * and E825 reach this clear; E810 is filtered >>>> + * out above by has_ready_bitmap. >>>> + */ >>>> + for_each_clear_bit(i, tx->in_use, tx->len) { >>>> + u8 phy_idx = i + tx->offset; >>>> + >>>> + if (tstamp_ready & BIT_ULL(phy_idx)) >>>> + ice_clear_phy_tstamp(hw, >>>> + tx->block, >>>> + phy_idx); >>>> + } >>>> + } >>>> + } >>>> + >>>> + /* E810 and E830 need no further PHY reconfiguration */ >>>> + if (hw->mac_type != ICE_MAC_GENERIC_3K_E825) >>>> + return; >>>> + >>>> + /* E825 recovers its Tx path by soft resetting the PHY >>>> + * timestamp block and restarting the port, but only on >>>> + * link-up. The reset is a three-step register toggle; if it >>>> + * fails partway through, the port can be left held in reset, >>>> + * and programming a PHY that is stuck in reset via >>>> + * ice_ptp_port_phy_restart() would leave Tx timestamping >>>> + * permanently broken. So warn and skip the restart on >>>> + * failure; the sequence is retried on the next link-up event. >>>> + */ >>>> + if (!linkup) >>>> + return; >>>> + >>>> + if (ice_ptp_phy_soft_reset_eth56g(hw, ptp_port->port_num)) >>>> + dev_warn(ice_pf_to_dev(pf), >>>> + "PTP failed to soft reset PHY port %u on link-up; skipping restart, Tx timestamping may be stuck, try toggle a >>> link to recover\n", >>>> + ptp_port->port_num); >>>> + else >>>> + ice_ptp_port_phy_restart(ptp_port); >>> >>> We hit a regression from this hunk while testing the series on an >>> E825 T-BC system: after the soft reset the port no longer signals >>> latched Tx timestamps. Nothing re-enables the port interrupt >>> configuration (PHY_REG_TS_INT_CONFIG) afterwards, the only writers >>> are the clock owner init and rebuild paths via >>> ice_ptp_cfg_phy_interrupt(), and ice_ptp_port_phy_restart() does not >>> touch it. So the first link-up that takes this path leaves the port >>> without Tx timestamp interrupts until the next reset of the clock >>> owner PF or a driver reload. >>> >>> Regards, >>> >>> Petr >> >> Hi, thanks for letting me know. I will look into it. > > Hi, > If I am not mistaken, Jake Keller sent you a patch fixing the issue with this patch regarding PHY reconfiguration. > Did you have a chance to test this? If so, I will implement this fix in the new revision. > We have a patch undergoing testing, but I am not confident it will fix the issue. I believe we have a gap here where the ice_ptp_init and link state can race such that the PTP state shows the link is down, but we never follow up by calling ice_ptp_link_change on link going up. I'm still trying to investigate the full path, but I think the patch in this series which removes the call of ice_ptp_link_change from ice_down and ice_up is possibly the root cause here. I am not certain what a correct fix looks like yet, and Petr and I are still working on reproducing and confirming the situation. Thanks, Jake