From patchwork Fri Dec 6 19:35:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13897644 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 288E621B1AD for ; Fri, 6 Dec 2024 19:35:49 +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=1733513751; cv=none; b=km4FLEUkpxBY07QGoyOLVoayC5bvwrkA8Cle0rgVLFAkRyj+hR2kwob40C3ldE3wbIAGV0tznpBhPr+5R1bpxIwOFWKdvA3KDAS0wUPrZrUF/rbKzll0AkWCl1WJAl8JxNrBSZ0EPZcK3w39ig0X4yAWG9r6BQbcCBlookLDp88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733513751; c=relaxed/simple; bh=HtQyLoglbCF/AMPEfU82Cms87nNjI6dB4Y/DdhrLuNI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a2YDScNZ0Z0cv/yKHxkzPobaRjXOdezsPEb9SojHmzpDYoEflrnxuqQgZRAFH5Q75hoanb9MVYNYStqK7NsAZsS7LJGAuEyclHepa1T1Pk6VzedlKMRA/uaZg2brNMq1oXnHSbyJvR06UXUmXv02oEPG2xiRDnh0VnZuRV6B+eY= 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=AjqzPB55; 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="AjqzPB55" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733513749; x=1765049749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HtQyLoglbCF/AMPEfU82Cms87nNjI6dB4Y/DdhrLuNI=; b=AjqzPB55teyiuJxcz3jBBez5b57B6LPEDAoNK69tMaG5V1e5fp9pUaK1 FHquf8bStAp8b5OCGlWaGWiBkpr4IK3gOP/fyc0XzndG+LU55TLrRDOOi jPWiPW9yi0eHVrXpQU44S80oyOyc4YizedHjcOyYiMYoIqBEfWq1g+WfA kyHhpwYxCJhEq1B8FxpOFPcbEdvQoAKm/5NEv8NeOVBU3pdGIcl2aMZbL IrsRSW8RcK+foUTH0Ci7qOgJF16rhBpUm5CHz3hTObCsNXFjvAiy4R1DO MtzmOIrq8lxdu+D8ignGJ/1xP36+XNIR776YF7BAya5DWeyH2xDx3bkef g==; X-CSE-ConnectionGUID: qlBf2Wl+TV+RLsF6ajbNzw== X-CSE-MsgGUID: Mai9Hn5rS6uNTXxMFZ4IDg== X-IronPort-AV: E=McAfee;i="6700,10204,11278"; a="33226560" X-IronPort-AV: E=Sophos;i="6.12,214,1728975600"; d="scan'208";a="33226560" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2024 11:35:46 -0800 X-CSE-ConnectionGUID: AZfnBqzPSAGCdY3NB3G4Gw== X-CSE-MsgGUID: pxW3gjr9R2OSglhEADVhpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,214,1728975600"; d="scan'208";a="94301398" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa010.jf.intel.com with ESMTP; 06 Dec 2024 11:35:46 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Karol Kolacinski , anthony.l.nguyen@intel.com, richardcochran@gmail.com, przemyslaw.kitszel@intel.com, horms@kernel.org, Arkadiusz Kubalewski , Grzegorz Nitka , Pucha Himasekhar Reddy Subject: [PATCH net 1/4] ice: Fix E825 initialization Date: Fri, 6 Dec 2024 11:35:38 -0800 Message-ID: <20241206193542.4121545-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.46.0.522.gc50d79eeffbf In-Reply-To: <20241206193542.4121545-1-anthony.l.nguyen@intel.com> References: <20241206193542.4121545-1-anthony.l.nguyen@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) Signed-off-by: Tony Nguyen --- 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 518893f23372..a5e4c6d8bfd5 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -2687,14 +2687,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; @@ -2708,15 +2709,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); @@ -5478,7 +5474,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; }