Skip to contentSkip to conversation

igc: Remove _I_PHY_ID check for i225 devices

PATCH In review Linjun Bao 3 participants 7 messages Aug 9, 2022 – Aug 11, 2022

Subsystems (3)
lore
Share & tools
lore

Linjun Bao

author
#0 lore raw

PATCH 1/1 igc: Remove _I_PHY_ID check for i225 devices

Source commit 7c496de538ee ("igc: Remove _I_PHY_ID checking"), remove _I_PHY_ID check for i225 device, since i225 devices only have one PHY vendor.

---
 drivers/net/ethernet/intel/igc/igc_base.c | 10 +---------
 drivers/net/ethernet/intel/igc/igc_main.c |  3 +--
 drivers/net/ethernet/intel/igc/igc_phy.c  |  6 ++----
 3 files changed, 4 insertions(+), 15 deletions(-)
drivers/net/ethernet/intel/igc/igc_base.c +1 -9
index db289bcce21d..d66429eb14a5 100644
@@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
 
 	igc_check_for_copper_link(hw);
 
-	/* Verify phy id and set remaining function pointers */
-	switch (phy->id) {
-	case I225_I_PHY_ID:
-		phy->type	= igc_phy_i225;
-		break;
-	default:
-		ret_val = -IGC_ERR_PHY;
-		goto out;
-	}
+	phy->type = igc_phy_i225;
 
 out:
 	return ret_val;
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
index 9ba05d9aa8e0..b8297a63a7fd 100644
@@ -2884,8 +2884,7 @@ bool igc_has_link(struct igc_adapter *adapter)
 		break;
 	}
 
-	if (hw->mac.type == igc_i225 &&
-	    hw->phy.id == I225_I_PHY_ID) {
+	if (hw->mac.type == igc_i225) {
 		if (!netif_carrier_ok(adapter->netdev)) {
 			adapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE;
 		} else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {
drivers/net/ethernet/intel/igc/igc_phy.c +2 -4
index 6156c76d765f..1be112ce6774 100644
@@ -235,8 +235,7 @@ static 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) |
@@ -376,8 +375,7 @@ static 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) |
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Linjun Bao

Source commit 7c496de538ee ("igc: Remove _I_PHY_ID checking"), remove _I_PHY_ID check for i225 device, since i225 devices only have one PHY vendor.

This patch looks identical to 7c496de538ee ("igc: Remove _I_PHY_ID checking"), which is already in mainline?

Andrew
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

maintainer
#2 lore raw
In reply to Linjun Bao
Quoted 3 lines · Linjun Bao

Source commit 7c496de538ee ("igc: Remove _I_PHY_ID checking"), remove _I_PHY_ID check for i225 device, since i225 devices only have one PHY vendor.

What are you trying to do with this patch? You're referencing the original commit so you know it's committed, but it's not clear to me why you are re-sending it.

Thanks,
Tony

Quoted 57 lines
---
  drivers/net/ethernet/intel/igc/igc_base.c | 10 +---------
  drivers/net/ethernet/intel/igc/igc_main.c |  3 +--
  drivers/net/ethernet/intel/igc/igc_phy.c  |  6 ++----
  3 files changed, 4 insertions(+), 15 deletions(-)
drivers/net/ethernet/intel/igc/igc_base.c +1 -9
index db289bcce21d..d66429eb14a5 100644
@@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
 
  	igc_check_for_copper_link(hw);
 
-	/* Verify phy id and set remaining function pointers */
-	switch (phy->id) {
-	case I225_I_PHY_ID:
-		phy->type	= igc_phy_i225;
-		break;
-	default:
-		ret_val = -IGC_ERR_PHY;
-		goto out;
-	}
+	phy->type = igc_phy_i225;
 
  out:
  	return ret_val;
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
index 9ba05d9aa8e0..b8297a63a7fd 100644
@@ -2884,8 +2884,7 @@ bool igc_has_link(struct igc_adapter *adapter)
  		break;
  	}
 
-	if (hw->mac.type == igc_i225 &&
-	    hw->phy.id == I225_I_PHY_ID) {
+	if (hw->mac.type == igc_i225) {
  		if (!netif_carrier_ok(adapter->netdev)) {
  			adapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE;
  		} else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {
drivers/net/ethernet/intel/igc/igc_phy.c +1 -2
index 6156c76d765f..1be112ce6774 100644
@@ -235,8 +235,7 @@ static 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) |

drivers/net/ethernet/intel/igc/igc_phy.c static s32 igc_phy_setup_autoneg(struct igc_hw *hw) · line 381

Quoted 9 lines
drivers/net/ethernet/intel/igc/igc_phy.c +1 -2
@@ -376,8 +375,7 @@ static 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) |

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

author
#3 lore raw
Quoted 7 lines · Tony Nguyen
Quoted 3 lines · Linjun Bao

Source commit 7c496de538ee ("igc: Remove _I_PHY_ID checking"), remove _I_PHY_ID check for i225 device, since i225 devices only have one PHY vendor.

What are you trying to do with this patch? You're referencing the original commit so you know it's committed, but it's not clear to me why you are re-sending it.

I'm new here, please correct me if I am doing things in the wrong way.

Yes this commit was committed to mainline about one year ago. But this commit has not been included into kernel 5.4 yet, and I encountered the probe failure when using alderlake-s with Ethernet adapter i225-LM. Since I could not directly apply the patch 7c496de538ee to kernel 5.4, so I generated this patch for kernel 5.4 usage.

Looks like sending a duplicated patch is not expected. Would you please advise what is the proper action when encountering such case? I would like this fix to be implemented into LTS kernel 5.4, I also wrote a ticket on https://bugzilla.kernel.org/show_bug.cgi?id=216261, but no response.

Regards

Joseph

Quoted 63 lines

Thanks,
Tony

Quoted 60 lines

---
  drivers/net/ethernet/intel/igc/igc_base.c | 10 +--------- drivers/net/ethernet/intel/igc/igc_main.c |  3 +-- drivers/net/ethernet/intel/igc/igc_phy.c  |  6 ++----

  3 files changed, 4 insertions(+), 15 deletions(-)
drivers/net/ethernet/intel/igc/igc_base.c +0 -0
index db289bcce21d..d66429eb14a5 100644
@@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
         igc_check_for_copper_link(hw);

  -    /* Verify phy id and set remaining function pointers */ -    switch (phy->id) {
-    case I225_I_PHY_ID:
-        phy->type    = igc_phy_i225;
-        break;
-    default:
-        ret_val = -IGC_ERR_PHY;
-        goto out;
-    }
+    phy->type = igc_phy_i225;
    out:
      return ret_val;

drivers/net/ethernet/intel/igc/igc_main.c +0 -0
index 9ba05d9aa8e0..b8297a63a7fd 100644
@@ -2884,8 +2884,7 @@ bool igc_has_link(struct igc_adapter *adapter)
           break;
       }

  -    if (hw->mac.type == igc_i225 &&
-        hw->phy.id == I225_I_PHY_ID) {
+    if (hw->mac.type == igc_i225) {
          if (!netif_carrier_ok(adapter->netdev)) { adapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE; } else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {

drivers/net/ethernet/intel/igc/igc_phy.c +0 -0
index 6156c76d765f..1be112ce6774 100644
@@ -235,8 +235,7 @@ static 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) |

drivers/net/ethernet/intel/igc/igc_phy.c +0 -0
@@ -376,8 +375,7 @@ static 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) |

author
#4 lore raw
In reply to Tony Nguyen
Quoted 7 lines · Tony Nguyen
Quoted 3 lines · Linjun Bao

Source commit 7c496de538ee ("igc: Remove _I_PHY_ID checking"), remove _I_PHY_ID check for i225 device, since i225 devices only have one PHY vendor.

What are you trying to do with this patch? You're referencing the original commit so you know it's committed, but it's not clear to me why you are re-sending it.

I'm new here, please correct me if I am doing things in the wrong way.

Yes this commit was committed to mainline about one year ago. But this commit has not been included into kernel 5.4 yet, and I encountered the probe failure when using alderlake-s with Ethernet adapter i225-LM. Since I could not directly apply the patch 7c496de538ee to kernel 5.4, so I generated this patch for kernel 5.4 usage.

Looks like sending a duplicated patch is not expected. Would you please advise what is the proper action when encountering such case? I would like this fix to be implemented into LTS kernel 5.4, I also wrote a ticket on https://bugzilla.kernel.org/show_bug.cgi?id=216261, but no response.

Regards

Joseph

Quoted 63 lines

Thanks,
Tony

Quoted 60 lines

---
  drivers/net/ethernet/intel/igc/igc_base.c | 10 +--------- drivers/net/ethernet/intel/igc/igc_main.c |  3 +-- drivers/net/ethernet/intel/igc/igc_phy.c  |  6 ++----

  3 files changed, 4 insertions(+), 15 deletions(-)
drivers/net/ethernet/intel/igc/igc_base.c +0 -0
index db289bcce21d..d66429eb14a5 100644
@@ -187,15 +187,7 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
         igc_check_for_copper_link(hw);

  -    /* Verify phy id and set remaining function pointers */ -    switch (phy->id) {
-    case I225_I_PHY_ID:
-        phy->type    = igc_phy_i225;
-        break;
-    default:
-        ret_val = -IGC_ERR_PHY;
-        goto out;
-    }
+    phy->type = igc_phy_i225;
    out:
      return ret_val;

drivers/net/ethernet/intel/igc/igc_main.c +0 -0
index 9ba05d9aa8e0..b8297a63a7fd 100644
@@ -2884,8 +2884,7 @@ bool igc_has_link(struct igc_adapter *adapter)
           break;
       }

  -    if (hw->mac.type == igc_i225 &&
-        hw->phy.id == I225_I_PHY_ID) {
+    if (hw->mac.type == igc_i225) {
          if (!netif_carrier_ok(adapter->netdev)) { adapter->flags &= ~IGC_FLAG_NEED_LINK_UPDATE; } else if (!(adapter->flags & IGC_FLAG_NEED_LINK_UPDATE)) {

drivers/net/ethernet/intel/igc/igc_phy.c +0 -0
index 6156c76d765f..1be112ce6774 100644
@@ -235,8 +235,7 @@ static 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) |

drivers/net/ethernet/intel/igc/igc_phy.c +0 -0
@@ -376,8 +375,7 @@ static 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) |

maintainer
#5 lore raw
Quoted 4 lines · Linjun Bao

Yes this commit was committed to mainline about one year ago. But this commit has not been included into kernel 5.4 yet, and I encountered the probe failure when using alderlake-s with Ethernet adapter i225-LM. Since I could not directly apply the patch 7c496de538ee to kernel 5.4, so I generated this patch for kernel 5.4 usage.

Looks like sending a duplicated patch is not expected. Would you please advise what is the proper action when encountering such case?

Sounds like you want this backported to stable. Documentation on how to do it is here [1]. Option 3 seems to be the correct choice.

Thanks,
Tony

[1] https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#procedure-for-submitting-patches-to-the-stable-tree

author
#6 lore raw
Quoted 8 lines · Tony Nguyen
Quoted 4 lines · Linjun Bao

Yes this commit was committed to mainline about one year ago. But this commit has not been included into kernel 5.4 yet, and I encountered the probe failure when using alderlake-s with Ethernet adapter i225-LM. Since I could not directly apply the patch 7c496de538ee to kernel 5.4, so I generated this patch for kernel 5.4 usage.

Looks like sending a duplicated patch is not expected. Would you please advise what is the proper action when encountering such case?

Sounds like you want this backported to stable. Documentation on how to do it is here [1]. Option 3 seems to be the correct choice.

Thank you Tony, you guide me the correct way, yeah I want this backported to stable kernel 5.4. And now I understand the get_maintainer.pl is for mainline development.

Regards
Joseph

Quoted 4 lines

Thanks,
Tony

[1] https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#procedure-for-submitting-patches-to-the-stable-tree