From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B160A00C3; Mon, 15 Aug 2022 01:09:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36C3242CDA; Mon, 15 Aug 2022 01:04:55 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id ED4D342CD4 for ; Mon, 15 Aug 2022 01:04:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660518293; x=1692054293; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oFnOBnuHm6++/2jL1puAA9rbQNSlx446jLtwTxnxXto=; b=kPJml3XQ7grzh2mMYLhOIBXICBPxSYKPZf7FT8mW7V96OlLu5GMCQs8s dXX0TSRUMAaT2l5vJ8FAeSe47nw4hK88HnnMn4brH+3nuYZg2pZBSX6ej Le6ZYveabSWwV45HgiisQC9jmeSJV4MmmbN1uQdf56FALzU92nIWTMPcl ySFNjYG3sLupJJ8UstCZtavQYbNZfS+hOiWyRpYcjFuY/e/gVI4sa5Fyn FIH69s6VDsGSsKyqUiC5H8F3Ehvkki1+6jdpongDzHgxdNk3zyHwFICJO Uk2Pr2fj+UUcNOSQo9D+Rdy+Uh0o+gBvvhGo3xQtnI2m78dctyyMg2R+m w==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="293128820" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="293128820" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 16:04:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="934296985" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by fmsmga005.fm.intel.com with ESMTP; 14 Aug 2022 16:04:51 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , Karol Kolacinski Subject: [PATCH 67/70] net/ice/base: check for PTP HW lock more frequently Date: Mon, 15 Aug 2022 03:13:03 -0400 Message-Id: <20220815071306.2910599-68-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220815071306.2910599-1-qi.z.zhang@intel.com> References: <20220815071306.2910599-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org PTP HW semaphore can be held for ~50 ms in worst case. SW should wait longer and check more frequently if the HW lock is held. Signed-off-by: Karol Kolacinski Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_ptp_hw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index f5ebf5f328..974c96f60c 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4844,18 +4844,18 @@ bool ice_ptp_lock(struct ice_hw *hw) u32 hw_lock; int i; -#define MAX_TRIES 5 +#define MAX_TRIES 15 for (i = 0; i < MAX_TRIES; i++) { hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id)); hw_lock = hw_lock & PFTSYN_SEM_BUSY_M; if (hw_lock) { /* Somebody is holding the lock */ - ice_msec_delay(10, true); + ice_msec_delay(5, true); continue; - } else { - break; } + + break; } return !hw_lock; -- 2.31.1