Skip to content

Commit

Permalink
qlcnic: clear device reset state after fw recovery
Browse files Browse the repository at this point in the history
o After firmware recovery, clear device reset state transition register.
  Otherwise firmware reload can occur unnecessary.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Feb 2, 2010
1 parent 02420be commit 1b95a83
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,23 @@ qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state)
qlcnic_api_unlock(adapter);
}

static int
qlcnic_clr_drv_state(struct qlcnic_adapter *adapter)
{
u32 val;

if (qlcnic_api_lock(adapter))
return -EBUSY;

val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE);
val &= ~((u32)0x3 << (adapter->portnum * 4));
QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val);

qlcnic_api_unlock(adapter);

return 0;
}

static void
qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter)
{
Expand Down Expand Up @@ -2119,7 +2136,10 @@ qlcnic_attach_work(struct work_struct *work)
done:
adapter->fw_fail_cnt = 0;
clear_bit(__QLCNIC_RESETTING, &adapter->state);
qlcnic_schedule_work(adapter, qlcnic_fw_poll_work, FW_POLL_DELAY);

if (!qlcnic_clr_drv_state(adapter))
qlcnic_schedule_work(adapter, qlcnic_fw_poll_work,
FW_POLL_DELAY);
}

static int
Expand Down

0 comments on commit 1b95a83

Please sign in to comment.