From a3c61c0ab2233293d1ebdf254ce29f65e3364fe4 Mon Sep 17 00:00:00 2001 From: Yuval Mintz Date: Wed, 23 Jan 2013 03:21:49 +0000 Subject: [PATCH] --- yaml --- r: 351591 b: refs/heads/master c: 80bfe5cc1b8c320247a21ff40d8c139c5f3bbcaf h: refs/heads/master i: 351589: 491527d3130a3dc5f7505f15f6923dbcae70811f 351587: 94002eacd75fec2b100d0059098ba5dfb0222867 351583: 1effa1ae5a5cd996e04094fb2864f0d4e9da718d v: v3 --- [refs] | 2 +- .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 06fe70f346d6..2194743af28f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c3146eb676e7cce254e98b1d179a4c82227a9d26 +refs/heads/master: 80bfe5cc1b8c320247a21ff40d8c139c5f3bbcaf diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index bcb2b64833ad..a4611386afeb 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -2805,7 +2805,7 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) val & ~DRV_FLAGS_CAPABILITIES_LOADED_L2); } - if (IS_PF(bp) && + if (IS_PF(bp) && bp->recovery_state != BNX2X_RECOVERY_DONE && (bp->state == BNX2X_STATE_CLOSED || bp->state == BNX2X_STATE_ERROR)) { /* We can get here if the driver has been unloaded @@ -2825,8 +2825,16 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) return -EINVAL; } - /* - * It's important to set the bp->state to the value different from + /* Nothing to do during unload if previous bnx2x_nic_load() + * have not completed succesfully - all resourses are released. + * + * we can get here only after unsuccessful ndo_* callback, during which + * dev->IFF_UP flag is still on. + */ + if (bp->state == BNX2X_STATE_CLOSED || bp->state == BNX2X_STATE_ERROR) + return 0; + + /* It's important to set the bp->state to the value different from * BNX2X_STATE_OPEN and only then stop the Tx. Otherwise bnx2x_tx_int() * may restart the Tx from the NAPI context (see bnx2x_tx_int()). */