From patchwork Wed Oct 9 13:59: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: 1994882 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=FzFtvuQE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4XNvjB68dJz1xsq for ; Thu, 10 Oct 2024 01:02:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3FA5C40765; Wed, 9 Oct 2024 14:02:36 +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 OaskWzA3Bn_h; Wed, 9 Oct 2024 14:02:35 +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 smtp4.osuosl.org 2A01B40749 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1728482555; bh=DwbPhWtUplz0EXwUu5FXIluw/tZOH92+sex4OJuvgOI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=FzFtvuQEqXM1gGZnCadJWxvfRLOmact6OUYlKqvzQPx/pVFFXJ4hLw3Zm405Oah2c t4TMKrtmkT/qzaMFpp/QCcR1xrQWAKh0NtErZ1TwwG54c0/+/5HAaoVU9CBaFF9i3D HKxymmxXHW+NEiV+CL4wteu85XMwDSMKFo5mUvGcSwd/ZRV0lm0CJOHJ7SeMbSeSu5 BKcXGXaZxmhuekO/mjxuXG4VnstfS4JL9nqsqpoZ5LPhmNFMQx209fP38jVs2CLqT6 zo1nea0nH+p+Gry4s+YhEqYDh1Zt8DleKovw4s1PPhl3ObKQEpEZ+s8LKj/N8oFO74 ENIWjjUpCoVuw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2A01B40749; Wed, 9 Oct 2024 14:02:35 +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 12CB21BF215 for ; Wed, 9 Oct 2024 14:02:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EC04440763 for ; Wed, 9 Oct 2024 14:02:33 +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 vf1YzeKNJBlx for ; Wed, 9 Oct 2024 14:02:31 +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 B108F400EA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B108F400EA Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by smtp4.osuosl.org (Postfix) with ESMTPS id B108F400EA for ; Wed, 9 Oct 2024 14:02:31 +0000 (UTC) X-CSE-ConnectionGUID: onsnZA2TTLuezlxo+9AHmA== X-CSE-MsgGUID: RgwYhI96QG+2Qk7mXZpofg== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31483933" X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="31483933" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2024 07:02:31 -0700 X-CSE-ConnectionGUID: sF4ot5/aTym5EY2h3tIkYA== X-CSE-MsgGUID: DrwpK6FzTqmU5GjUxheC4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="76210750" Received: from kkolacin-desk1.ger.corp.intel.com (HELO kkolacin-desk1.igk.intel.com) ([10.217.160.108]) by orviesa009.jf.intel.com with ESMTP; 09 Oct 2024 07:02:30 -0700 From: Karol Kolacinski To: intel-wired-lan@lists.osuosl.org Date: Wed, 9 Oct 2024 15:59:26 +0200 Message-ID: <20241009140223.1918687-2-karol.kolacinski@intel.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241009140223.1918687-1-karol.kolacinski@intel.com> References: <20241009140223.1918687-1-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=1728482551; x=1760018551; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NzG7OmrTfLym3bLrrOLj9xE4SCbxC59P1KycO8/ZuSo=; b=LaSkzlmtiKeAtkhdfPLM+Ud0Hc+5PjX9zvZwcN9lVE2dXPaLlqI/dwt4 rRmrvZZBo5g7Cj4yu3MCj5dCfGhSq75olq7yS5wa6WJ12jT+ygqo9bQH3 lNkzRgFMdklvRsxYwIYupCpIP1aPAbDU8OW6tIwhJ4PXvdTqHL8mPotuQ /fIAms3Q2rsP1BhFkXPQioWUBP84K1XKSHaaNV0Ueo6QyYSbgjULwJ7ql ufP9om2jFHv0fX7tIhZNZwf3cGQEZ4X3a9BCuL36sUT1TXkj7dIGOIdE+ sclQuOqA3eMqKFX/1Ds9LvmEckhddCYBK+0eqFvimtCoJyUDxkCqebS7S g==; 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=LaSkzlmt Subject: [Intel-wired-lan] [PATCH v2 iwl-next 1/4] ice: Fix E825 initialization 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 , Arkadiusz Kubalewski , anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Current implementation checks revision of all PHYs on all PFs, which is incorrect and may result in initialization failure. Check only the revision of the current PHY. Fixes: 7cab44f1c35f ("ice: Introduce ETH56G PHY model for E825C products") Reviewed-by: Arkadiusz Kubalewski Signed-off-by: Karol Kolacinski --- V1 -> V2: Removed net-next hunks drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 22 ++++++++------------- drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 3 ++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c index 3a33e6b9b313..d9a3c7de0342 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -2665,14 +2665,15 @@ static bool ice_is_muxed_topo(struct ice_hw *hw) } /** - * ice_ptp_init_phy_e825c - initialize PHY parameters + * ice_ptp_init_phy_e825 - initialize PHY parameters * @hw: pointer to the HW struct */ -static void ice_ptp_init_phy_e825c(struct ice_hw *hw) +static void ice_ptp_init_phy_e825(struct ice_hw *hw) { struct ice_ptp_hw *ptp = &hw->ptp; struct ice_eth56g_params *params; - u8 phy; + u32 phy_rev; + int err; ptp->phy_model = ICE_PHY_ETH56G; params = &ptp->phy.eth56g; @@ -2686,16 +2687,9 @@ static void ice_ptp_init_phy_e825c(struct ice_hw *hw) ptp->num_lports = params->num_phys * ptp->ports_per_phy; ice_sb_access_ena_eth56g(hw, true); - for (phy = 0; phy < params->num_phys; phy++) { - u32 phy_rev; - int err; - - err = ice_read_phy_eth56g(hw, phy, PHY_REG_REVISION, &phy_rev); - if (err || phy_rev != PHY_REVISION_ETH56G) { - ptp->phy_model = ICE_PHY_UNSUP; - return; - } - } + err = ice_read_phy_eth56g(hw, hw->pf_id, PHY_REG_REVISION, &phy_rev); + if (err || phy_rev != PHY_REVISION_ETH56G) + ptp->phy_model = ICE_PHY_UNSUP; ptp->is_2x50g_muxed_topo = ice_is_muxed_topo(hw); } @@ -5396,7 +5390,7 @@ void ice_ptp_init_hw(struct ice_hw *hw) else if (ice_is_e810(hw)) ice_ptp_init_phy_e810(ptp); else if (ice_is_e825c(hw)) - ice_ptp_init_phy_e825c(hw); + ice_ptp_init_phy_e825(hw); else ptp->phy_model = ICE_PHY_UNSUP; } diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h index 0852a34ade91..35141198f261 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h @@ -326,7 +326,8 @@ extern const struct ice_vernier_info_e82x e822_vernier[NUM_ICE_PTP_LNK_SPD]; */ #define ICE_E810_PLL_FREQ 812500000 #define ICE_PTP_NOMINAL_INCVAL_E810 0x13b13b13bULL -#define E810_OUT_PROP_DELAY_NS 1 +#define ICE_E810_OUT_PROP_DELAY_NS 1 +#define ICE_E825_SYNC_DELAY 6 /* Device agnostic functions */ u8 ice_get_ptp_src_clock_index(struct ice_hw *hw);