diff options
author | Sony Chacko <sony.chacko@qlogic.com> | 2011-08-29 08:50:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-29 22:52:49 -0400 |
commit | 44f65b290235a1b259eea1aa055b5b1be36d3c86 (patch) | |
tree | 63ffb384f7f27e06cc6f263a9440f86584ae237e /drivers/net/ethernet/qlogic | |
parent | 1bddc59c2546a24a92b1e7d4d8fa1e1e38aeedb2 (diff) |
qlcnic: detect fan failure
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 29 |
3 files changed, 27 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 7c64f2ffc219..59d73f23de67 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -832,7 +832,6 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test, | |||
832 | data[3] = qlcnic_loopback_test(dev, QLCNIC_ILB_MODE); | 832 | data[3] = qlcnic_loopback_test(dev, QLCNIC_ILB_MODE); |
833 | if (data[3]) | 833 | if (data[3]) |
834 | eth_test->flags |= ETH_TEST_FL_FAILED; | 834 | eth_test->flags |= ETH_TEST_FL_FAILED; |
835 | |||
836 | if (eth_test->flags & ETH_TEST_FL_EXTERNAL_LB) { | 835 | if (eth_test->flags & ETH_TEST_FL_EXTERNAL_LB) { |
837 | data[4] = qlcnic_loopback_test(dev, QLCNIC_ELB_MODE); | 836 | data[4] = qlcnic_loopback_test(dev, QLCNIC_ELB_MODE); |
838 | if (data[4]) | 837 | if (data[4]) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h index d14506f764e0..92bc8ce9b287 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h | |||
@@ -609,6 +609,7 @@ enum { | |||
609 | QLCNIC_TEMP_PANIC /* Fatal error, hardware has shut down. */ | 609 | QLCNIC_TEMP_PANIC /* Fatal error, hardware has shut down. */ |
610 | }; | 610 | }; |
611 | 611 | ||
612 | |||
612 | /* Lock IDs for PHY lock */ | 613 | /* Lock IDs for PHY lock */ |
613 | #define PHY_LOCK_DRIVER 0x44524956 | 614 | #define PHY_LOCK_DRIVER 0x44524956 |
614 | 615 | ||
@@ -723,7 +724,8 @@ enum { | |||
723 | #define QLCNIC_RCODE_DRIVER_CAN_RELOAD BIT_30 | 724 | #define QLCNIC_RCODE_DRIVER_CAN_RELOAD BIT_30 |
724 | #define QLCNIC_RCODE_FATAL_ERROR BIT_31 | 725 | #define QLCNIC_RCODE_FATAL_ERROR BIT_31 |
725 | #define QLCNIC_FWERROR_PEGNUM(code) ((code) & 0xff) | 726 | #define QLCNIC_FWERROR_PEGNUM(code) ((code) & 0xff) |
726 | #define QLCNIC_FWERROR_CODE(code) ((code >> 8) & 0xfffff) | 727 | #define QLCNIC_FWERROR_CODE(code) ((code >> 8) & 0x1fffff) |
728 | #define QLCNIC_FWERROR_FAN_FAILURE 0x16 | ||
727 | 729 | ||
728 | #define FW_POLL_DELAY (1 * HZ) | 730 | #define FW_POLL_DELAY (1 * HZ) |
729 | #define FW_FAIL_THRESH 2 | 731 | #define FW_FAIL_THRESH 2 |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index b447cc50693a..998bb1d1a91f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2928,15 +2928,36 @@ qlcnic_detach_work(struct work_struct *work) | |||
2928 | 2928 | ||
2929 | status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1); | 2929 | status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1); |
2930 | 2930 | ||
2931 | if (status & QLCNIC_RCODE_FATAL_ERROR) | 2931 | if (status & QLCNIC_RCODE_FATAL_ERROR) { |
2932 | dev_err(&adapter->pdev->dev, | ||
2933 | "Detaching the device: peg halt status1=0x%x\n", | ||
2934 | status); | ||
2935 | |||
2936 | if (QLCNIC_FWERROR_CODE(status) == QLCNIC_FWERROR_FAN_FAILURE) { | ||
2937 | dev_err(&adapter->pdev->dev, | ||
2938 | "On board active cooling fan failed. " | ||
2939 | "Device has been halted.\n"); | ||
2940 | dev_err(&adapter->pdev->dev, | ||
2941 | "Replace the adapter.\n"); | ||
2942 | } | ||
2943 | |||
2932 | goto err_ret; | 2944 | goto err_ret; |
2945 | } | ||
2933 | 2946 | ||
2934 | if (adapter->temp == QLCNIC_TEMP_PANIC) | 2947 | if (adapter->temp == QLCNIC_TEMP_PANIC) { |
2948 | dev_err(&adapter->pdev->dev, "Detaching the device: temp=%d\n", | ||
2949 | adapter->temp); | ||
2935 | goto err_ret; | 2950 | goto err_ret; |
2951 | } | ||
2952 | |||
2936 | /* Dont ack if this instance is the reset owner */ | 2953 | /* Dont ack if this instance is the reset owner */ |
2937 | if (!(adapter->flags & QLCNIC_FW_RESET_OWNER)) { | 2954 | if (!(adapter->flags & QLCNIC_FW_RESET_OWNER)) { |
2938 | if (qlcnic_set_drv_state(adapter, adapter->dev_state)) | 2955 | if (qlcnic_set_drv_state(adapter, adapter->dev_state)) { |
2956 | dev_err(&adapter->pdev->dev, | ||
2957 | "Failed to set driver state," | ||
2958 | "detaching the device.\n"); | ||
2939 | goto err_ret; | 2959 | goto err_ret; |
2960 | } | ||
2940 | } | 2961 | } |
2941 | 2962 | ||
2942 | adapter->fw_wait_cnt = 0; | 2963 | adapter->fw_wait_cnt = 0; |
@@ -2946,8 +2967,6 @@ qlcnic_detach_work(struct work_struct *work) | |||
2946 | return; | 2967 | return; |
2947 | 2968 | ||
2948 | err_ret: | 2969 | err_ret: |
2949 | dev_err(&adapter->pdev->dev, "detach failed; status=%d temp=%d\n", | ||
2950 | status, adapter->temp); | ||
2951 | netif_device_attach(netdev); | 2970 | netif_device_attach(netdev); |
2952 | qlcnic_clr_all_drv_state(adapter, 1); | 2971 | qlcnic_clr_all_drv_state(adapter, 1); |
2953 | } | 2972 | } |