[v3] IGC: Remove I225_I_PHY_ID checking

Message ID 20220902001828.1977-1-yock.gen.mah@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v3] IGC: Remove I225_I_PHY_ID checking |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing fail Testing issues
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Mah, Yock Gen Sept. 2, 2022, 12:18 a.m. UTC
  From: Mah Yock Gen <yock.gen.mah@intel.com>

i225 devices have only one PHY vendor. There is unnecessary to check
_I_PHY_ID during the link establishment and auto-negotiation process,
the checking also caused devices like i225-IT failed. This patch is to
remove the mentioned unnecessary checking.

Cc: stable@dpdk.org

<changelog>

Co-developed-by: Mah Yock Gen <yock.gen.mah@intel.com>
Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
Co-developed-by: Taripin Samuel <samuel.taripin@intel.com>
Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
---
V3:
* Fixed coding style issue

V2:
* Removing i225-IT device id added in V1 patch, as it has been superseded

 drivers/net/igc/base/igc_i225.c | 15 ++-------------
 drivers/net/igc/base/igc_phy.c  |  6 ++----
 2 files changed, 4 insertions(+), 17 deletions(-)
  

Comments

Qi Zhang Sept. 4, 2022, 1:55 a.m. UTC | #1
> -----Original Message-----
> From: Mah, Yock Gen <yock.gen.mah@intel.com>
> Sent: Friday, September 2, 2022 8:18 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH v3] IGC: Remove I225_I_PHY_ID checking
> 
> From: Mah Yock Gen <yock.gen.mah@intel.com>
> 
> i225 devices have only one PHY vendor. There is unnecessary to check
> _I_PHY_ID during the link establishment and auto-negotiation process, the
> checking also caused devices like i225-IT failed. This patch is to remove the
> mentioned unnecessary checking.
> 
> Cc: stable@dpdk.org
> 
> <changelog>
> 
> Co-developed-by: Mah Yock Gen <yock.gen.mah@intel.com>
> Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
> Co-developed-by: Taripin Samuel <samuel.taripin@intel.com>
> Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
> Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>


Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with below minor changes.

1. rename title to "remove unnecessary PHY ID checking" to fix check-git-log warning
2. remove "<change log>" tag
3. remove duplicated "Signed-off-by"

Thanks
Qi
  

Patch

diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c
index 5f3d535490..180d3cf687 100644
--- a/drivers/net/igc/base/igc_i225.c
+++ b/drivers/net/igc/base/igc_i225.c
@@ -173,19 +173,8 @@  static s32 igc_init_phy_params_i225(struct igc_hw *hw)
 	phy->ops.write_reg = igc_write_phy_reg_gpy;
 
 	ret_val = igc_get_phy_id(hw);
-	/* Verify phy id and set remaining function pointers */
-	switch (phy->id) {
-	case I225_I_PHY_ID:
-	case I226_LM_PHY_ID:
-		phy->type		= igc_phy_i225;
-		phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225;
-		phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225;
-		/* TODO - complete with GPY PHY information */
-		break;
-	default:
-		ret_val = -IGC_ERR_PHY;
-		goto out;
-	}
+	phy->type = igc_phy_i225;
+
 
 out:
 	return ret_val;
diff --git a/drivers/net/igc/base/igc_phy.c b/drivers/net/igc/base/igc_phy.c
index 43bbe69bca..2906bae21a 100644
--- a/drivers/net/igc/base/igc_phy.c
+++ b/drivers/net/igc/base/igc_phy.c
@@ -1474,8 +1474,7 @@  s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 			return ret_val;
 	}
 
-	if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
-	    hw->phy.id == I225_I_PHY_ID) {
+	if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
 	/* Read the MULTI GBT AN Control Register - reg 7.32 */
 		ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
 					    MMD_DEVADDR_SHIFT) |
@@ -1615,8 +1614,7 @@  s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 		ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
 					     mii_1000t_ctrl_reg);
 
-	if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
-	    hw->phy.id == I225_I_PHY_ID)
+	if (phy->autoneg_mask & ADVERTISE_2500_FULL)
 		ret_val = phy->ops.write_reg(hw,
 					     (STANDARD_AN_REG_MASK <<
 					     MMD_DEVADDR_SHIFT) |