Skip to contentSkip to conversation

tg3: negate USE_PHYLIB flag check

PATCH In review Jiri Pirko 3 participants 3 messages Oct 12, 2011 – Oct 19, 2011

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 tg3: negate USE_PHYLIB flag check

USE_PHYLIB flag in tg3_remove_one() is being checked incorrectly. This results tg3_phy_fini->phy_disconnect is never called and when tg3 module is removed.

In my case this resulted in panics in phy_state_machine calling function phydev->adjust_link.

So correct this check.

---
 drivers/net/tg3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/tg3.c +1 -1
index 4a1374d..c11a2b8 100644
@@ -15577,7 +15577,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 
 		cancel_work_sync(&tp->reset_task);
 
-		if (!tg3_flag(tp, USE_PHYLIB)) {
+		if (tg3_flag(tp, USE_PHYLIB)) {
 			tg3_phy_fini(tp);
 			tg3_mdio_fini(tp);
 		}
Signature · 1 line
1.7.6.2
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jiri Pirko

USE_PHYLIB flag in tg3_remove_one() is being checked incorrectly. This results tg3_phy_fini->phy_disconnect is never called and when tg3 module is removed.

In my case this resulted in panics in phy_state_machine calling function phydev->adjust_link.

So correct this check.

Introduced by commit 63c3a66fe6c827a731dcbdee181158b295626f83, entitled "tg3: Convert u32 flag,flg2,flg3 uses to bitmap".

Quoted 21 lines
---
 drivers/net/tg3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/tg3.c +1 -1
index 4a1374d..c11a2b8 100644
@@ -15577,7 +15577,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 
 		cancel_work_sync(&tp->reset_task);
 
-		if (!tg3_flag(tp, USE_PHYLIB)) {
+		if (tg3_flag(tp, USE_PHYLIB)) {
 			tg3_phy_fini(tp);
 			tg3_mdio_fini(tp);
 		}
Signature · 1 line
1.7.6.2
maintainer
#2 lore raw

From: "Matt Carlson" <[email protected]>
Date: Wed, 12 Oct 2011 16:55:01 -0700

Quoted 8 lines · Jiri Pirko
Quoted 7 lines

USE_PHYLIB flag in tg3_remove_one() is being checked incorrectly. This results tg3_phy_fini->phy_disconnect is never called and when tg3 module is removed.

In my case this resulted in panics in phy_state_machine calling function phydev->adjust_link.

Quoted 8 lines
Quoted 3 lines

So correct this check.

Introduced by commit 63c3a66fe6c827a731dcbdee181158b295626f83, entitled "tg3: Convert u32 flag,flg2,flg3 uses to bitmap".

Applied and queued up for -stable, thanks!