diff mbox

[net-2.6] tg3: negate USE_PHYLIB flag check

Message ID 1318410041-2476-1-git-send-email-jpirko@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko Oct. 12, 2011, 9 a.m. UTC
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.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/tg3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Matt Carlson Oct. 12, 2011, 11:55 p.m. UTC | #1
On Wed, Oct 12, 2011 at 02:00:41AM -0700, Jiri Pirko wrote:
> 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.
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>

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

Acked-by: Matt Carlson <mcarlson@broadcom.com>

> ---
>  drivers/net/tg3.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index 4a1374d..c11a2b8 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -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);
>  		}
> -- 
> 1.7.6.2
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 19, 2011, 4 a.m. UTC | #2
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Wed, 12 Oct 2011 16:55:01 -0700

> On Wed, Oct 12, 2011 at 02:00:41AM -0700, Jiri Pirko wrote:
>> 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.
>> 
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> 
> Introduced by commit 63c3a66fe6c827a731dcbdee181158b295626f83, entitled
> "tg3: Convert u32 flag,flg2,flg3 uses to bitmap".
> 
> Acked-by: Matt Carlson <mcarlson@broadcom.com>

Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4a1374d..c11a2b8 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -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);
 		}