aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSritej Velaga <sritej.velaga@qlogic.com>2011-07-13 23:16:50 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-14 11:49:44 -0400
commit7b749ff4dfba109d25a6b4fd011ee78877831e86 (patch)
tree1857876a0a0c8fbd3b796bfbd2b46fa24d2ec793
parent41c2178adce37b249147063624f8a27b064b471e (diff)
qlcnic: fix chip reset logic
Chip reset logic (IDC logic) has changed with fw dump support. This broked compatibility with driver using older IDC logic. Changes to make it compatible with drivers using older IDC logic. Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 357436be801e..6b646c65f2fd 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2811,6 +2811,7 @@ qlcnic_fwinit_work(struct work_struct *work)
2811 struct qlcnic_adapter *adapter = container_of(work, 2811 struct qlcnic_adapter *adapter = container_of(work,
2812 struct qlcnic_adapter, fw_work.work); 2812 struct qlcnic_adapter, fw_work.work);
2813 u32 dev_state = 0xf; 2813 u32 dev_state = 0xf;
2814 u32 val;
2814 2815
2815 if (qlcnic_api_lock(adapter)) 2816 if (qlcnic_api_lock(adapter))
2816 goto err_ret; 2817 goto err_ret;
@@ -2837,11 +2838,6 @@ qlcnic_fwinit_work(struct work_struct *work)
2837 2838
2838 if (!qlcnic_check_drv_state(adapter)) { 2839 if (!qlcnic_check_drv_state(adapter)) {
2839skip_ack_check: 2840skip_ack_check:
2840 if (!(adapter->flags & QLCNIC_FW_RESET_OWNER)) {
2841 qlcnic_api_unlock(adapter);
2842 goto wait_npar;
2843 }
2844
2845 dev_state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE); 2841 dev_state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE);
2846 2842
2847 if (dev_state == QLCNIC_DEV_NEED_RESET) { 2843 if (dev_state == QLCNIC_DEV_NEED_RESET) {
@@ -2850,17 +2846,22 @@ skip_ack_check:
2850 set_bit(__QLCNIC_START_FW, &adapter->state); 2846 set_bit(__QLCNIC_START_FW, &adapter->state);
2851 QLCDB(adapter, DRV, "Restarting fw\n"); 2847 QLCDB(adapter, DRV, "Restarting fw\n");
2852 qlcnic_idc_debug_info(adapter, 0); 2848 qlcnic_idc_debug_info(adapter, 0);
2849 val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE);
2850 QLC_DEV_SET_RST_RDY(val, adapter->portnum);
2851 QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val);
2853 } 2852 }
2854 2853
2855 qlcnic_api_unlock(adapter); 2854 qlcnic_api_unlock(adapter);
2856 2855
2857 rtnl_lock(); 2856 rtnl_lock();
2858 if (adapter->ahw->fw_dump.enable) { 2857 if (adapter->ahw->fw_dump.enable &&
2858 (adapter->flags & QLCNIC_FW_RESET_OWNER)) {
2859 QLCDB(adapter, DRV, "Take FW dump\n"); 2859 QLCDB(adapter, DRV, "Take FW dump\n");
2860 qlcnic_dump_fw(adapter); 2860 qlcnic_dump_fw(adapter);
2861 adapter->flags &= ~QLCNIC_FW_RESET_OWNER;
2862 } 2861 }
2863 rtnl_unlock(); 2862 rtnl_unlock();
2863
2864 adapter->flags &= ~QLCNIC_FW_RESET_OWNER;
2864 if (!adapter->nic_ops->start_firmware(adapter)) { 2865 if (!adapter->nic_ops->start_firmware(adapter)) {
2865 qlcnic_schedule_work(adapter, qlcnic_attach_work, 0); 2866 qlcnic_schedule_work(adapter, qlcnic_attach_work, 0);
2866 adapter->fw_wait_cnt = 0; 2867 adapter->fw_wait_cnt = 0;