diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-02-01 00:24:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-02 18:55:44 -0500 |
commit | 1b95a839587f40abab2f9cb3e5254dc821b9829b (patch) | |
tree | bade89b4209a5ae3c6fdb63cbeed13d08fc82fa1 /drivers/net/qlcnic/qlcnic_main.c | |
parent | 02420be6fc5fc63526aca43b5bfc571547a1c926 (diff) |
qlcnic: clear device reset state after fw recovery
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>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 05275f2153be..9a98285ee791 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -1866,6 +1866,23 @@ qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state) | |||
1866 | qlcnic_api_unlock(adapter); | 1866 | qlcnic_api_unlock(adapter); |
1867 | } | 1867 | } |
1868 | 1868 | ||
1869 | static int | ||
1870 | qlcnic_clr_drv_state(struct qlcnic_adapter *adapter) | ||
1871 | { | ||
1872 | u32 val; | ||
1873 | |||
1874 | if (qlcnic_api_lock(adapter)) | ||
1875 | return -EBUSY; | ||
1876 | |||
1877 | val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE); | ||
1878 | val &= ~((u32)0x3 << (adapter->portnum * 4)); | ||
1879 | QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val); | ||
1880 | |||
1881 | qlcnic_api_unlock(adapter); | ||
1882 | |||
1883 | return 0; | ||
1884 | } | ||
1885 | |||
1869 | static void | 1886 | static void |
1870 | qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter) | 1887 | qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter) |
1871 | { | 1888 | { |
@@ -2119,7 +2136,10 @@ qlcnic_attach_work(struct work_struct *work) | |||
2119 | done: | 2136 | done: |
2120 | adapter->fw_fail_cnt = 0; | 2137 | adapter->fw_fail_cnt = 0; |
2121 | clear_bit(__QLCNIC_RESETTING, &adapter->state); | 2138 | clear_bit(__QLCNIC_RESETTING, &adapter->state); |
2122 | qlcnic_schedule_work(adapter, qlcnic_fw_poll_work, FW_POLL_DELAY); | 2139 | |
2140 | if (!qlcnic_clr_drv_state(adapter)) | ||
2141 | qlcnic_schedule_work(adapter, qlcnic_fw_poll_work, | ||
2142 | FW_POLL_DELAY); | ||
2123 | } | 2143 | } |
2124 | 2144 | ||
2125 | static int | 2145 | static int |