Skip to content

Commit de68294

Browse files
Yuval Mintzdavem330
authored andcommitted
bnx2x: Fix UNDI driver unload
Commit 91ebb928b "bnx2x: Add support for Multi-Function UNDI" contains a bug which prevent the emptying of the device's Rx buffers before reset. As a result, on new boards it is likely HW will reach some fatal assertion once its interfaces load after UNDI was previously loaded. Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2765305 commit de68294

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10051,8 +10051,8 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
1005110051
#define BCM_5710_UNDI_FW_MF_MAJOR (0x07)
1005210052
#define BCM_5710_UNDI_FW_MF_MINOR (0x08)
1005310053
#define BCM_5710_UNDI_FW_MF_VERS (0x05)
10054-
#define BNX2X_PREV_UNDI_MF_PORT(p) (0x1a150c + ((p) << 4))
10055-
#define BNX2X_PREV_UNDI_MF_FUNC(f) (0x1a184c + ((f) << 4))
10054+
#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4))
10055+
#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4))
1005610056
static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp)
1005710057
{
1005810058
u8 major, minor, version;
@@ -10352,6 +10352,7 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
1035210352
/* Reset should be performed after BRB is emptied */
1035310353
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
1035410354
u32 timer_count = 1000;
10355+
bool need_write = true;
1035510356

1035610357
/* Close the MAC Rx to prevent BRB from filling up */
1035710358
bnx2x_prev_unload_close_mac(bp, &mac_vals);
@@ -10398,7 +10399,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
1039810399
* cleaning methods - might be redundant but harmless.
1039910400
*/
1040010401
if (bnx2x_prev_unload_undi_fw_supports_mf(bp)) {
10401-
bnx2x_prev_unload_undi_mf(bp);
10402+
if (need_write) {
10403+
bnx2x_prev_unload_undi_mf(bp);
10404+
need_write = false;
10405+
}
1040210406
} else if (prev_undi) {
1040310407
/* If UNDI resides in memory,
1040410408
* manually increment it

0 commit comments

Comments
 (0)