提交 e01872af 编写于 作者: D dhananjay@netxen.com 提交者: Jeff Garzik

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: NDhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 7eec517c
...@@ -930,6 +930,8 @@ static int netxen_nic_close(struct net_device *netdev) ...@@ -930,6 +930,8 @@ static int netxen_nic_close(struct net_device *netdev)
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_stop_queue(netdev); netif_stop_queue(netdev);
netxen_nic_disable_int(adapter);
cmd_buff = adapter->cmd_buf_arr; cmd_buff = adapter->cmd_buf_arr;
for (i = 0; i < adapter->max_tx_desc_count; i++) { for (i = 0; i < adapter->max_tx_desc_count; i++) {
buffrag = cmd_buff->frag_array; buffrag = cmd_buff->frag_array;
...@@ -1243,28 +1245,12 @@ static int ...@@ -1243,28 +1245,12 @@ static int
netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev)
{ {
u32 ret = 0; u32 ret = 0;
u32 our_int = 0;
DPRINTK(INFO, "Entered handle ISR\n"); DPRINTK(INFO, "Entered handle ISR\n");
adapter->stats.ints++; adapter->stats.ints++;
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
/* not our interrupt */
if ((our_int & (0x80 << adapter->portnum)) == 0)
return ret;
}
netxen_nic_disable_int(adapter); netxen_nic_disable_int(adapter);
if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
/* claim interrupt */
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
writel(our_int & ~((u32)(0x80 << adapter->portnum)),
NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
}
}
if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) {
if (netif_rx_schedule_prep(netdev)) { if (netif_rx_schedule_prep(netdev)) {
/* /*
...@@ -1298,6 +1284,7 @@ irqreturn_t netxen_intr(int irq, void *data) ...@@ -1298,6 +1284,7 @@ irqreturn_t netxen_intr(int irq, void *data)
{ {
struct netxen_adapter *adapter; struct netxen_adapter *adapter;
struct net_device *netdev; struct net_device *netdev;
u32 our_int = 0;
if (unlikely(!irq)) { if (unlikely(!irq)) {
return IRQ_NONE; /* Not our interrupt */ return IRQ_NONE; /* Not our interrupt */
...@@ -1305,7 +1292,22 @@ irqreturn_t netxen_intr(int irq, void *data) ...@@ -1305,7 +1292,22 @@ irqreturn_t netxen_intr(int irq, void *data)
adapter = (struct netxen_adapter *)data; adapter = (struct netxen_adapter *)data;
netdev = adapter->netdev; netdev = adapter->netdev;
/* process our status queue (for all 4 ports) */
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
/* not our interrupt */
if ((our_int & (0x80 << adapter->portnum)) == 0)
return IRQ_NONE;
}
if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
/* claim interrupt */
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
writel(our_int & ~((u32)(0x80 << adapter->portnum)),
NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
}
}
if (netif_running(netdev)) if (netif_running(netdev))
netxen_handle_int(adapter, netdev); netxen_handle_int(adapter, netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册