Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341905
b: refs/heads/master
c: c63da99
h: refs/heads/master
i:
  341903: db7b87b
v: v3
  • Loading branch information
Barak Witkowski authored and David S. Miller committed Dec 7, 2012
1 parent e9f3dd8 commit 3aaa3d2
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ded7cd605502eff7341bbd912ebc90c3674c764
refs/heads/master: c63da990cd63153ce5203f96822638a7ef0f9bf7
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,7 @@ struct bnx2x_prev_path_list {
u8 slot;
u8 path;
struct list_head list;
u8 undi;
};

struct bnx2x_sp_objs {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)

if (bp->port.pmf)
bnx2x_initial_phy_init(bp, load_mode);
bp->link_params.feature_config_flags &= ~FEATURE_CONFIG_BOOT_FROM_SAN;

/* Start fast path */

Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ static int bnx2x_check_lfa(struct link_params *params)
if (!(link_status & LINK_STATUS_LINK_UP))
return LFA_LINK_DOWN;

/* if loaded after BOOT from SAN, don't flap the link in any case and
* rely on link set by preboot driver
*/
if (params->feature_config_flags & FEATURE_CONFIG_BOOT_FROM_SAN)
return 0;

/* Verify that loopback mode is not set */
if (params->loopback_mode)
return LFA_LOOPBACK_ENABLED;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ struct link_params {
#define FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED (1<<10)
#define FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET (1<<11)
#define FEATURE_CONFIG_MT_SUPPORT (1<<13)
#define FEATURE_CONFIG_BOOT_FROM_SAN (1<<14)

/* Will be populated during common init */
struct bnx2x_phy phy[MAX_PHYS];
Expand Down
28 changes: 25 additions & 3 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9515,6 +9515,20 @@ static int bnx2x_prev_mcp_done(struct bnx2x *bp)
return 0;
}

static struct bnx2x_prev_path_list *
bnx2x_prev_path_get_entry(struct bnx2x *bp)
{
struct bnx2x_prev_path_list *tmp_list;

list_for_each_entry(tmp_list, &bnx2x_prev_list, list)
if (PCI_SLOT(bp->pdev->devfn) == tmp_list->slot &&
bp->pdev->bus->number == tmp_list->bus &&
BP_PATH(bp) == tmp_list->path)
return tmp_list;

return NULL;
}

static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
{
struct bnx2x_prev_path_list *tmp_list;
Expand All @@ -9539,7 +9553,7 @@ static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
return rc;
}

static int bnx2x_prev_mark_path(struct bnx2x *bp)
static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi)
{
struct bnx2x_prev_path_list *tmp_list;
int rc;
Expand All @@ -9553,6 +9567,7 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp)
tmp_list->bus = bp->pdev->bus->number;
tmp_list->slot = PCI_SLOT(bp->pdev->devfn);
tmp_list->path = BP_PATH(bp);
tmp_list->undi = after_undi ? (1 << BP_PORT(bp)) : 0;

rc = down_interruptible(&bnx2x_prev_sem);
if (rc) {
Expand Down Expand Up @@ -9649,6 +9664,7 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
static int bnx2x_prev_unload_common(struct bnx2x *bp)
{
u32 reset_reg, tmp_reg = 0, rc;
bool prev_undi = false;
/* It is possible a previous function received 'common' answer,
* but hasn't loaded yet, therefore creating a scenario of
* multiple functions receiving 'common' on the same path.
Expand All @@ -9663,7 +9679,6 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
/* Reset should be performed after BRB is emptied */
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
u32 timer_count = 1000;
bool prev_undi = false;

/* Close the MAC Rx to prevent BRB from filling up */
bnx2x_prev_unload_close_mac(bp);
Expand Down Expand Up @@ -9713,7 +9728,7 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
/* No packets are in the pipeline, path is ready for reset */
bnx2x_reset_common(bp);

rc = bnx2x_prev_mark_path(bp);
rc = bnx2x_prev_mark_path(bp, prev_undi);
if (rc) {
bnx2x_prev_mcp_done(bp);
return rc;
Expand Down Expand Up @@ -9745,6 +9760,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
{
int time_counter = 10;
u32 rc, fw, hw_lock_reg, hw_lock_val;
struct bnx2x_prev_path_list *prev_list;
BNX2X_DEV_INFO("Entering Previous Unload Flow\n");

/* clear hw from errors which may have resulted from an interrupted
Expand Down Expand Up @@ -9803,6 +9819,12 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
rc = -EBUSY;
}

/* Mark function if its port was used to boot from SAN */
prev_list = bnx2x_prev_path_get_entry(bp);
if (prev_list && (prev_list->undi & (1 << BP_PORT(bp))))
bp->link_params.feature_config_flags |=
FEATURE_CONFIG_BOOT_FROM_SAN;

BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc);

return rc;
Expand Down

0 comments on commit 3aaa3d2

Please sign in to comment.