From patchwork Thu Jul 11 09:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karol Kolacinski X-Patchwork-Id: 1959177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=fgXseWmV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WKTwW3gxMz1xqj for ; Thu, 11 Jul 2024 19:30:19 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 06DF541025; Thu, 11 Jul 2024 09:30:16 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8Dbr8fiZyf2s; Thu, 11 Jul 2024 09:30:15 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 20B7A4102A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1720690215; bh=XHDcvDmKU0TuszHyF9ZoyTvg5pheQ5IM4WnPEQq5tX8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fgXseWmVijmEFMpvG7LxOn3eDUYgaWuMhFhYItj+LWkMVcboxbIEqISZalNPZXc5C Yb467gbUzirddzGCqVSVXYYg06YbCP4+Pf9B/4HTzN5itxbdkOpeYKGYZqhxi1McPO 7YMDSmsjm6caGWGibzNCY7h/5cACTvw+jxjWfqZoMSozD2he0Q4uUcAr6qYMJbMecS R7WCEdqrKTXpzgTC4D8dRlwuNheTmmqzI6Q3mySPCg9AVhvnxpX8QiqUFowWlfGFDb cYh5qOcusDB+xuWNMfq+4rSGv/M3MLoglW7eI4ieWNdVFzYf96rcVVjoJgpIJM2fdF g8+o95YZ4Bi9Q== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 20B7A4102A; Thu, 11 Jul 2024 09:30:15 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id C16781BF574 for ; Thu, 11 Jul 2024 09:30:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id AE252413DA for ; Thu, 11 Jul 2024 09:30:09 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id dwXFgKrMhw-D for ; Thu, 11 Jul 2024 09:30:08 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.15; helo=mgamail.intel.com; envelope-from=karol.kolacinski@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 88240414C1 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 88240414C1 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by smtp4.osuosl.org (Postfix) with ESMTPS id 88240414C1 for ; Thu, 11 Jul 2024 09:30:08 +0000 (UTC) X-CSE-ConnectionGUID: VeVgvK6QTOOovJJRl+UWCw== X-CSE-MsgGUID: 0nVkxvdlR+iTdVHywBQ8yQ== X-IronPort-AV: E=McAfee;i="6700,10204,11129"; a="21821455" X-IronPort-AV: E=Sophos;i="6.09,199,1716274800"; d="scan'208";a="21821455" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2024 02:28:21 -0700 X-CSE-ConnectionGUID: dqFxgdv2SkiWc+nFyYnzgw== X-CSE-MsgGUID: eABvY0LrSmGf5AxIFdFSaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,199,1716274800"; d="scan'208";a="48580022" Received: from kkolacin-desk1.igk.intel.com ([10.102.102.132]) by fmviesa010.fm.intel.com with ESMTP; 11 Jul 2024 02:28:19 -0700 From: Karol Kolacinski To: intel-wired-lan@lists.osuosl.org Date: Thu, 11 Jul 2024 11:24:26 +0200 Message-ID: <20240711092757.890786-9-karol.kolacinski@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711092757.890786-6-karol.kolacinski@intel.com> References: <20240711092757.890786-6-karol.kolacinski@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720690209; x=1752226209; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0YJY2Aa3go2/EbA2qSk2gMlQrXaVyiX2lgjsOCRJ0uQ=; b=Q5EKvbS10QNNIreVrSkN8sppsc/8uS8DwmuA3LR+zuVF5W6Ol6GZmBLq KBfkBWe4bIH15Q6dYt3CXVxsbY0bhAjh3hU23UlRGaQmYNi2JpcUjbjHq aEGXJ2nA6d2+LmR/4CfilVqqWrQc5EMHH0pkDiWD5GrQq4TXQji3W2CJ3 tWMWkwFT0LskYI2gaxxDgbCaJ5TbdyPCWm55cDl3XY++f65TcG0vCyEn4 BciQgtGg8WW46ItzNHtOgP4pYe0XnBCQD8fwqMy7tpP1GBem3Kmc+heh1 XFUlPi23xM8yvndZyI/fLFyQxF4NGpqPD3Z8Z42EYyPowcZ5LqGLPNvaZ A==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q5EKvbS1 Subject: [Intel-wired-lan] [PATCH v2 iwl-next 3/4] ice: Add timestamp ready bitmap for E830 products X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Karol Kolacinski , anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" E830 PHY supports timestamp ready bitmap. Enable the bitmap by refactoring tx init function. Reviewed-by: Przemek Kitszel Signed-off-by: Karol Kolacinski --- drivers/net/ethernet/intel/ice/ice_ptp.c | 47 +++++------------------- drivers/net/ethernet/intel/ice/ice_ptp.h | 3 +- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 6fae3841bdaa..6eb8583dc7bc 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -963,28 +963,6 @@ ice_ptp_release_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx) tx->len = 0; } -/** - * ice_ptp_init_tx_eth56g - Initialize tracking for Tx timestamps - * @pf: Board private structure - * @tx: the Tx tracking structure to initialize - * @port: the port this structure tracks - * - * Initialize the Tx timestamp tracker for this port. ETH56G PHYs - * have independent memory blocks for all ports. - * - * Return: 0 for success, -ENOMEM when failed to allocate Tx tracker - */ -static int ice_ptp_init_tx_eth56g(struct ice_pf *pf, struct ice_ptp_tx *tx, - u8 port) -{ - tx->block = port; - tx->offset = 0; - tx->len = INDEX_PER_PORT_ETH56G; - tx->has_ready_bitmap = 1; - - return ice_ptp_alloc_tx_tracker(tx); -} - /** * ice_ptp_init_tx_e82x - Initialize tracking for Tx timestamps * @pf: Board private structure @@ -1008,24 +986,25 @@ ice_ptp_init_tx_e82x(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) } /** - * ice_ptp_init_tx_e810 - Initialize tracking for Tx timestamps + * ice_ptp_init_tx - Initialize tracking for Tx timestamps * @pf: Board private structure * @tx: the Tx tracking structure to initialize + * @port: the port this structure tracks * - * Initialize the Tx timestamp tracker for this PF. For E810 devices, each - * port has its own block of timestamps, independent of the other ports. + * Initialize the Tx timestamp tracker for this PF. For all PHYs except E82X, + * each port has its own block of timestamps, independent of the other ports. */ -static int -ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) +static int ice_ptp_init_tx(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port) { - tx->block = pf->hw.port_info->lport; + tx->block = port; tx->offset = 0; - tx->len = INDEX_PER_PORT_E810; + tx->len = INDEX_PER_PORT; + /* The E810 PHY does not provide a timestamp ready bitmap. Instead, * verify new timestamps against cached copy of the last read * timestamp. */ - tx->has_ready_bitmap = 0; + tx->has_ready_bitmap = ice_get_phy_model(&pf->hw) != ICE_PHY_E810; return ice_ptp_alloc_tx_tracker(tx); } @@ -3196,19 +3175,13 @@ static int ice_ptp_init_port(struct ice_pf *pf, struct ice_ptp_port *ptp_port) mutex_init(&ptp_port->ps_lock); switch (ice_get_phy_model(hw)) { - case ICE_PHY_ETH56G: - return ice_ptp_init_tx_eth56g(pf, &ptp_port->tx, - ptp_port->port_num); - case ICE_PHY_E810: - return ice_ptp_init_tx_e810(pf, &ptp_port->tx); case ICE_PHY_E82X: kthread_init_delayed_work(&ptp_port->ov_work, ice_ptp_wait_for_offsets); - return ice_ptp_init_tx_e82x(pf, &ptp_port->tx, ptp_port->port_num); default: - return -ENODEV; + return ice_ptp_init_tx(pf, &ptp_port->tx, ptp_port->port_num); } } diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h index 5b786e972388..288e06c35603 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.h +++ b/drivers/net/ethernet/intel/ice/ice_ptp.h @@ -128,8 +128,7 @@ struct ice_ptp_tx { /* Quad and port information for initializing timestamp blocks */ #define INDEX_PER_QUAD 64 #define INDEX_PER_PORT_E82X 16 -#define INDEX_PER_PORT_E810 64 -#define INDEX_PER_PORT_ETH56G 64 +#define INDEX_PER_PORT 64 /** * struct ice_ptp_port - data used to initialize an external port for PTP