aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorChien Tung <ctung@neteffect.com>2008-09-26 16:08:10 -0400
committerRoland Dreier <rolandd@cisco.com>2008-09-30 18:35:49 -0400
commit9d156947c734747065178331e0c95745cf3a55e1 (patch)
tree278e4509d89f16aa2405a950306b14c601bf6400 /drivers/infiniband
parent068e80de6af2b920d2644bba3a2c060431834160 (diff)
RDMA/nes: Limit critical error interrupts
Mask off a critical error after 100 critical error interrupts to keep the system "sane". Signed-off-by: Sweta Bhatt <sweta.bhatt@einfochips.com> Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c40
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h1
2 files changed, 29 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 515c0716345b..fc45e9c808f1 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -55,7 +55,7 @@ u32 int_mod_cq_depth_24;
55u32 int_mod_cq_depth_16; 55u32 int_mod_cq_depth_16;
56u32 int_mod_cq_depth_4; 56u32 int_mod_cq_depth_4;
57u32 int_mod_cq_depth_1; 57u32 int_mod_cq_depth_1;
58 58static const u8 nes_max_critical_error_count = 100;
59#include "nes_cm.h" 59#include "nes_cm.h"
60 60
61static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq); 61static void nes_cqp_ce_handler(struct nes_device *nesdev, struct nes_hw_cq *cq);
@@ -67,6 +67,7 @@ static void nes_process_aeq(struct nes_device *nesdev, struct nes_hw_aeq *aeq);
67static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq); 67static void nes_process_ceq(struct nes_device *nesdev, struct nes_hw_ceq *ceq);
68static void nes_process_iwarp_aeqe(struct nes_device *nesdev, 68static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
69 struct nes_hw_aeqe *aeqe); 69 struct nes_hw_aeqe *aeqe);
70static void process_critical_error(struct nes_device *nesdev);
70static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number); 71static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number);
71static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode); 72static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode);
72 73
@@ -1352,7 +1353,7 @@ int nes_init_phy(struct nes_device *nesdev)
1352 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x1, 0xc319, 0x0008); 1353 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x1, 0xc319, 0x0008);
1353 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x1, 0xc31a, 0x0098); 1354 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x1, 0xc31a, 0x0098);
1354 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0026, 0x0E00); 1355 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0026, 0x0E00);
1355 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0027, 0x0000); 1356 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0027, 0x0001);
1356 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0028, 0xA528); 1357 nes_write_10G_phy_reg(nesdev, nesadapter->phy_index[mac_index], 0x3, 0x0028, 0xA528);
1357 1358
1358 /* 1359 /*
@@ -1991,7 +1992,30 @@ int nes_napi_isr(struct nes_device *nesdev)
1991 } 1992 }
1992} 1993}
1993 1994
1994 1995static void process_critical_error(struct nes_device *nesdev)
1996{
1997 u32 debug_error;
1998 u32 nes_idx_debug_error_masks0 = 0;
1999 u16 error_module = 0;
2000
2001 debug_error = nes_read_indexed(nesdev, NES_IDX_DEBUG_ERROR_CONTROL_STATUS);
2002 printk(KERN_ERR PFX "Critical Error reported by device!!! 0x%02X\n",
2003 (u16)debug_error);
2004 nes_write_indexed(nesdev, NES_IDX_DEBUG_ERROR_CONTROL_STATUS,
2005 0x01010000 | (debug_error & 0x0000ffff));
2006 if (crit_err_count++ > 10)
2007 nes_write_indexed(nesdev, NES_IDX_DEBUG_ERROR_MASKS1, 1 << 0x17);
2008 error_module = (u16) (debug_error & 0x0F00) >> 8;
2009 if (++nesdev->nesadapter->crit_error_count[error_module-1] >=
2010 nes_max_critical_error_count) {
2011 printk(KERN_ERR PFX "Masking off critical error for module "
2012 "0x%02X\n", (u16)error_module);
2013 nes_idx_debug_error_masks0 = nes_read_indexed(nesdev,
2014 NES_IDX_DEBUG_ERROR_MASKS0);
2015 nes_write_indexed(nesdev, NES_IDX_DEBUG_ERROR_MASKS0,
2016 nes_idx_debug_error_masks0 | (1 << error_module));
2017 }
2018}
1995/** 2019/**
1996 * nes_dpc 2020 * nes_dpc
1997 */ 2021 */
@@ -2006,7 +2030,6 @@ void nes_dpc(unsigned long param)
2006 u32 timer_stat; 2030 u32 timer_stat;
2007 u32 temp_int_stat; 2031 u32 temp_int_stat;
2008 u32 intf_int_stat; 2032 u32 intf_int_stat;
2009 u32 debug_error;
2010 u32 processed_intf_int = 0; 2033 u32 processed_intf_int = 0;
2011 u16 processed_timer_int = 0; 2034 u16 processed_timer_int = 0;
2012 u16 completion_ints = 0; 2035 u16 completion_ints = 0;
@@ -2084,14 +2107,7 @@ void nes_dpc(unsigned long param)
2084 intf_int_stat = nes_read32(nesdev->regs+NES_INTF_INT_STAT); 2107 intf_int_stat = nes_read32(nesdev->regs+NES_INTF_INT_STAT);
2085 intf_int_stat &= nesdev->intf_int_req; 2108 intf_int_stat &= nesdev->intf_int_req;
2086 if (NES_INTF_INT_CRITERR & intf_int_stat) { 2109 if (NES_INTF_INT_CRITERR & intf_int_stat) {
2087 debug_error = nes_read_indexed(nesdev, NES_IDX_DEBUG_ERROR_CONTROL_STATUS); 2110 process_critical_error(nesdev);
2088 printk(KERN_ERR PFX "Critical Error reported by device!!! 0x%02X\n",
2089 (u16)debug_error);
2090 nes_write_indexed(nesdev, NES_IDX_DEBUG_ERROR_CONTROL_STATUS,
2091 0x01010000 | (debug_error & 0x0000ffff));
2092 /* BUG(); */
2093 if (crit_err_count++ > 10)
2094 nes_write_indexed(nesdev, NES_IDX_DEBUG_ERROR_MASKS1, 1 << 0x17);
2095 } 2111 }
2096 if (NES_INTF_INT_PCIERR & intf_int_stat) { 2112 if (NES_INTF_INT_PCIERR & intf_int_stat) {
2097 printk(KERN_ERR PFX "PCI Error reported by device!!!\n"); 2113 printk(KERN_ERR PFX "PCI Error reported by device!!!\n");
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index 82d06766ad52..1b93c571b931 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -1096,6 +1096,7 @@ struct nes_adapter {
1096 u16 pd_config_base[4]; 1096 u16 pd_config_base[4];
1097 1097
1098 u16 link_interrupt_count[4]; 1098 u16 link_interrupt_count[4];
1099 u8 crit_error_count[32];
1099 1100
1100 /* the phy index for each port */ 1101 /* the phy index for each port */
1101 u8 phy_index[4]; 1102 u8 phy_index[4];