qlcnic: Fix delay in reset path
authorSritej Velaga <sritej.velaga@qlogic.com>
Fri, 29 Jul 2011 13:30:27 +0000 (13:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Aug 2011 07:12:00 +0000 (00:12 -0700)
Driver should not check for heart beat anymore when FW is hung, rather it
should restart the FW.

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic.h
drivers/net/qlcnic/qlcnic_init.c
drivers/net/qlcnic/qlcnic_main.c

index 4200ef81ca8eb59ffa683f3ec8b0f0b6492fa1f0..5f0141be8ca9c7ff7225dc102b753c6f65ff0bb7 100644 (file)
@@ -911,6 +911,7 @@ struct qlcnic_ipaddr {
 #define QLCNIC_PROMISC_DISABLED                0x800
 #define QLCNIC_NEED_FLR                        0x1000
 #define QLCNIC_FW_RESET_OWNER          0x2000
+#define QLCNIC_FW_HANG                 0x4000
 #define QLCNIC_IS_MSI_FAMILY(adapter) \
        ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
 
index ee8a3982395ebce8503fc04ced5ae27ac7aecb41..3b6741e4754dea9b239942f227f16d152c28ba56 100644 (file)
@@ -1056,7 +1056,8 @@ qlcnic_check_fw_hearbeat(struct qlcnic_adapter *adapter)
 int
 qlcnic_need_fw_reset(struct qlcnic_adapter *adapter)
 {
-       if (qlcnic_check_fw_hearbeat(adapter)) {
+       if ((adapter->flags & QLCNIC_FW_HANG) ||
+                       qlcnic_check_fw_hearbeat(adapter)) {
                qlcnic_rom_lock_recovery(adapter);
                return 1;
        }
index 5ca1b562443c402b7f0e82e405d61e9f319a86a1..248ebbd432794b87d2d5beadbeb4bbbc9a8a7da9 100644 (file)
@@ -2682,6 +2682,7 @@ qlcnic_clr_all_drv_state(struct qlcnic_adapter *adapter, u8 failed)
        qlcnic_api_unlock(adapter);
 err:
        adapter->fw_fail_cnt = 0;
+       adapter->flags &= ~QLCNIC_FW_HANG;
        clear_bit(__QLCNIC_START_FW, &adapter->state);
        clear_bit(__QLCNIC_RESETTING, &adapter->state);
 }
@@ -2859,6 +2860,7 @@ skip_ack_check:
                    (adapter->flags & QLCNIC_FW_RESET_OWNER)) {
                        QLCDB(adapter, DRV, "Take FW dump\n");
                        qlcnic_dump_fw(adapter);
+                       adapter->flags |= QLCNIC_FW_HANG;
                }
                rtnl_unlock();
 
@@ -3046,6 +3048,7 @@ attach:
 done:
        netif_device_attach(netdev);
        adapter->fw_fail_cnt = 0;
+       adapter->flags &= ~QLCNIC_FW_HANG;
        clear_bit(__QLCNIC_RESETTING, &adapter->state);
 
        if (!qlcnic_clr_drv_state(adapter))
@@ -3090,6 +3093,8 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
        if (++adapter->fw_fail_cnt < FW_FAIL_THRESH)
                return 0;
 
+       adapter->flags |= QLCNIC_FW_HANG;
+
        qlcnic_dev_request_reset(adapter);
 
        if (auto_fw_reset)