aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhananjay@netxen.com <dhananjay@netxen.com>2007-07-25 10:43:12 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-30 15:51:59 -0400
commite01872af1d05cf4327c8e519b14e368b72921ccf (patch)
treee29a9b3bbba37a8f4ab64e45cc25139c389e6a70
parent7eec517c444fad699d3fc66d110440edee1fb0ed (diff)
netxen: Fix interrupt handling for multiport adapters
This patch fixes masking of interrupts on multiport adapters. Also disables interrupts upon ifdown interface. The wrong mask could result in interrupt flood after interface is down. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/netxen/netxen_nic_main.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 7d93bc3cb0db..bb8f5f2adab9 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -930,6 +930,8 @@ static int netxen_nic_close(struct net_device *netdev)
930 netif_carrier_off(netdev); 930 netif_carrier_off(netdev);
931 netif_stop_queue(netdev); 931 netif_stop_queue(netdev);
932 932
933 netxen_nic_disable_int(adapter);
934
933 cmd_buff = adapter->cmd_buf_arr; 935 cmd_buff = adapter->cmd_buf_arr;
934 for (i = 0; i < adapter->max_tx_desc_count; i++) { 936 for (i = 0; i < adapter->max_tx_desc_count; i++) {
935 buffrag = cmd_buff->frag_array; 937 buffrag = cmd_buff->frag_array;
@@ -1243,28 +1245,12 @@ static int
1243netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) 1245netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev)
1244{ 1246{
1245 u32 ret = 0; 1247 u32 ret = 0;
1246 u32 our_int = 0;
1247 1248
1248 DPRINTK(INFO, "Entered handle ISR\n"); 1249 DPRINTK(INFO, "Entered handle ISR\n");
1249 adapter->stats.ints++; 1250 adapter->stats.ints++;
1250 1251
1251 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1252 our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
1253 /* not our interrupt */
1254 if ((our_int & (0x80 << adapter->portnum)) == 0)
1255 return ret;
1256 }
1257
1258 netxen_nic_disable_int(adapter); 1252 netxen_nic_disable_int(adapter);
1259 1253
1260 if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
1261 /* claim interrupt */
1262 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1263 writel(our_int & ~((u32)(0x80 << adapter->portnum)),
1264 NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
1265 }
1266 }
1267
1268 if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { 1254 if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) {
1269 if (netif_rx_schedule_prep(netdev)) { 1255 if (netif_rx_schedule_prep(netdev)) {
1270 /* 1256 /*
@@ -1298,6 +1284,7 @@ irqreturn_t netxen_intr(int irq, void *data)
1298{ 1284{
1299 struct netxen_adapter *adapter; 1285 struct netxen_adapter *adapter;
1300 struct net_device *netdev; 1286 struct net_device *netdev;
1287 u32 our_int = 0;
1301 1288
1302 if (unlikely(!irq)) { 1289 if (unlikely(!irq)) {
1303 return IRQ_NONE; /* Not our interrupt */ 1290 return IRQ_NONE; /* Not our interrupt */
@@ -1305,7 +1292,22 @@ irqreturn_t netxen_intr(int irq, void *data)
1305 1292
1306 adapter = (struct netxen_adapter *)data; 1293 adapter = (struct netxen_adapter *)data;
1307 netdev = adapter->netdev; 1294 netdev = adapter->netdev;
1308 /* process our status queue (for all 4 ports) */ 1295
1296 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1297 our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
1298 /* not our interrupt */
1299 if ((our_int & (0x80 << adapter->portnum)) == 0)
1300 return IRQ_NONE;
1301 }
1302
1303 if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
1304 /* claim interrupt */
1305 if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
1306 writel(our_int & ~((u32)(0x80 << adapter->portnum)),
1307 NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
1308 }
1309 }
1310
1309 if (netif_running(netdev)) 1311 if (netif_running(netdev))
1310 netxen_handle_int(adapter, netdev); 1312 netxen_handle_int(adapter, netdev);
1311 1313