From patchwork Tue Nov 5 12:29:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Nitka X-Patchwork-Id: 13862890 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 C9AA21E485 for ; Tue, 5 Nov 2024 12:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730809960; cv=none; b=Y3XvJKe18EuG7nVROq3O6wMi2fsvaJofAqJ9juraep1Cq8bnUooBGhtZf8y2WsOW+P20067NEMXXVI0YVqfGZ9hsdt/EYVKwouu7n526s6qekHallgMYXUct24c1/6+K+9x0LHrsVTJRHiSTuez9WjwKFmfUxGw2gZT1B7eWNv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730809960; c=relaxed/simple; bh=BDydHqNR5zXBY9PoWgr9U5vTL8XuDoXIk21JjkBsB5o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nKb7kZvG6nStj9i8hIba8HGeSqa2DQNN41WmyIW0aibheErcfvcifn/9K09kYoF4AZp2Pc/rBiuE5UDh72IyRizvzu+/4QvUrzqb72dwi2QOfErPobvFrlkHLunyHIUuHwBt9L5ifyTagNqMsqhcvd/5IF0nEncQ8QIJkwICa/0= ARC-Authentication-Results: i=1; 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=cfjT8vt3; arc=none smtp.client-ip=192.198.163.18 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="cfjT8vt3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730809958; x=1762345958; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BDydHqNR5zXBY9PoWgr9U5vTL8XuDoXIk21JjkBsB5o=; b=cfjT8vt3pJe95nBLGXiblxt0e9NSxlcNAxNvEzLx3cgKWVyampnuiu9r gkpqJThgEj7oUwirN914LUExG/5y3K7wVbXLLthimlKbKyjtCyPIBD5Ky nEjGzH6fswi0RXqHDttU7ItDAsO4gYInb1SXNPM4GGZ6lefxr+4siG7yu okWIToDyD8/1C7k1r6QvKV2cvdDnJHwQ6ActTddWozfYpxSxiuUVHNw2O ETRa9XahNUQ5GEyFQvHsC1SvDTxv2+u3CQtFeXkPXfVjw3cyHljhIIdQf plKNIhhjB6vDGSJaw2h9TFmUPb2S77kHRu5I5GR5dOt4OJOC3r03/EaZg g==; X-CSE-ConnectionGUID: zEGsHu4IQRyNwaEaoOfG/g== X-CSE-MsgGUID: +xp/3XNlRp+od7o6t97isg== X-IronPort-AV: E=McAfee;i="6700,10204,11246"; a="29976226" X-IronPort-AV: E=Sophos;i="6.11,260,1725346800"; d="scan'208";a="29976226" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2024 04:32:37 -0800 X-CSE-ConnectionGUID: 2TIWPUrpQiONzICALC0bkA== X-CSE-MsgGUID: K9y9zgZfRd2dM4qlBhu5iw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,260,1725346800"; d="scan'208";a="121481317" Received: from gklab-003-001.igk.intel.com ([10.211.3.1]) by orviesa001.jf.intel.com with ESMTP; 05 Nov 2024 04:32:36 -0800 From: Grzegorz Nitka To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, Karol Kolacinski , Arkadiusz Kubalewski , Grzegorz Nitka Subject: [PATCH v4 iwl-net 1/4] ice: Fix E825 initialization Date: Tue, 5 Nov 2024 13:29:13 +0100 Message-Id: <20241105122916.1824568-2-grzegorz.nitka@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20241105122916.1824568-1-grzegorz.nitka@intel.com> References: <20241105122916.1824568-1-grzegorz.nitka@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Karol Kolacinski 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 Signed-off-by: Grzegorz Nitka Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) --- V1 -> V3: Removed net-next hunks, add 'return' on PHY revision read failure V1 -> V2: Removed net-next hunks drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 22 +++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c index ec8db830ac73..d27b2f52b5ce 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -2663,14 +2663,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; @@ -2684,15 +2685,10 @@ 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; + return; } ptp->is_2x50g_muxed_topo = ice_is_muxed_topo(hw); @@ -5394,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; }