Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255680
b: refs/heads/master
c: 602ca6f
h: refs/heads/master
v: v3
  • Loading branch information
Sritej Velaga authored and David S. Miller committed Jun 24, 2011
1 parent b2aaf3b commit 6388196
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 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: 21e842579a5fd1ce746be4e34ac53ef67d6f0a6b
refs/heads/master: 602ca6f00a0d95a0d0cec84f492324ee71d14e09
1 change: 1 addition & 0 deletions trunk/drivers/net/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ struct qlcnic_ipaddr {
#define QLCNIC_MAC_OVERRIDE_DISABLED 0x400
#define QLCNIC_PROMISC_DISABLED 0x800
#define QLCNIC_NEED_FLR 0x1000
#define QLCNIC_FW_RESET_OWNER 0x2000
#define QLCNIC_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
QLCNIC_CDRP_CMD_TEMP_SIZE);
if (err != QLCNIC_RCODE_SUCCESS) {
err = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
dev_err(&adapter->pdev->dev,
"Failed to get template size %d\n", err);
dev_info(&adapter->pdev->dev,
"Can't get template size %d\n", err);
err = -EIO;
return err;
}
Expand Down
32 changes: 24 additions & 8 deletions trunk/drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,10 +1590,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* This will be reset for mezz cards */
adapter->portnum = adapter->ahw->pci_func;

/* Get FW dump template and store it */
if (adapter->op_mode != QLCNIC_NON_PRIV_FUNC)
qlcnic_fw_cmd_get_minidump_temp(adapter);

err = qlcnic_get_board_info(adapter);
if (err) {
dev_err(&pdev->dev, "Error getting board config info.\n");
Expand All @@ -1612,6 +1608,12 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_decr_ref;
}

/* Get FW dump template and store it */
if (adapter->op_mode != QLCNIC_NON_PRIV_FUNC)
if (!qlcnic_fw_cmd_get_minidump_temp(adapter))
dev_info(&pdev->dev,
"Supports FW dump capability\n");

if (qlcnic_read_mac_addr(adapter))
dev_warn(&pdev->dev, "failed to read mac addr\n");

Expand Down Expand Up @@ -2683,11 +2685,16 @@ qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter, u8 failed)
static int
qlcnic_check_drv_state(struct qlcnic_adapter *adapter)
{
int act, state;
int act, state, active_mask;

state = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE);
act = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE);

if (adapter->flags & QLCNIC_FW_RESET_OWNER) {
active_mask = (~(1 << (adapter->ahw->pci_func * 4)));
act = act & active_mask;
}

if (((state & 0x11111111) == (act & 0x11111111)) ||
((act & 0x11111111) == ((state >> 1) & 0x11111111)))
return 0;
Expand Down Expand Up @@ -2826,6 +2833,11 @@ qlcnic_fwinit_work(struct work_struct *work)

if (!qlcnic_check_drv_state(adapter)) {
skip_ack_check:
if (!(adapter->flags & QLCNIC_FW_RESET_OWNER)) {
qlcnic_api_unlock(adapter);
goto wait_npar;
}

dev_state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE);

if (dev_state == QLCNIC_DEV_NEED_RESET) {
Expand All @@ -2836,6 +2848,7 @@ qlcnic_fwinit_work(struct work_struct *work)
qlcnic_idc_debug_info(adapter, 0);
QLCDB(adapter, DRV, "Take FW dump\n");
qlcnic_dump_fw(adapter);
adapter->flags &= ~QLCNIC_FW_RESET_OWNER;
}

qlcnic_api_unlock(adapter);
Expand Down Expand Up @@ -2900,9 +2913,11 @@ qlcnic_detach_work(struct work_struct *work)

if (adapter->temp == QLCNIC_TEMP_PANIC)
goto err_ret;

if (qlcnic_set_drv_state(adapter, adapter->dev_state))
goto err_ret;
/* Dont ack if this instance is the reset owner */
if (!(adapter->flags & QLCNIC_FW_RESET_OWNER)) {
if (qlcnic_set_drv_state(adapter, adapter->dev_state))
goto err_ret;
}

adapter->fw_wait_cnt = 0;

Expand Down Expand Up @@ -2947,6 +2962,7 @@ qlcnic_dev_request_reset(struct qlcnic_adapter *adapter)

if (state == QLCNIC_DEV_READY) {
QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_NEED_RESET);
adapter->flags |= QLCNIC_FW_RESET_OWNER;
QLCDB(adapter, DRV, "NEED_RESET state set\n");
qlcnic_idc_debug_info(adapter, 0);
}
Expand Down

0 comments on commit 6388196

Please sign in to comment.