Commit 80bfe5cc authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

bnx2x: Modify unload conditions

Don't unload the bnx2x driver if its in a recovery process, or if
the previous load have failed.
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c3146eb6
...@@ -2805,7 +2805,7 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) ...@@ -2805,7 +2805,7 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)
val & ~DRV_FLAGS_CAPABILITIES_LOADED_L2); 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_CLOSED ||
bp->state == BNX2X_STATE_ERROR)) { bp->state == BNX2X_STATE_ERROR)) {
/* We can get here if the driver has been unloaded /* 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) ...@@ -2825,8 +2825,16 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)
return -EINVAL; return -EINVAL;
} }
/* /* Nothing to do during unload if previous bnx2x_nic_load()
* It's important to set the bp->state to the value different from * 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() * 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()). * may restart the Tx from the NAPI context (see bnx2x_tx_int()).
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment