summaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
authorJoe Chou <Joe.Chou@rdc.com.tw>2008-12-22 19:40:02 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-22 19:40:02 -0800
commit3e7c469f07ff14cbf9a814739e1fc99a863e0943 (patch)
tree5de921edb410bdb564dcecd3fa76878f2775ed5c /drivers/net/r6040.c
parent11e5e8f5d14a1229706576184d2cf4c4556ed94c (diff)
downloadlinux-3e7c469f07ff14cbf9a814739e1fc99a863e0943.tar.bz2
r6040: save and restore MIER correctly in the interrupt routine
This patch saves the MIER register contents before treating interrupts, then restores them correcty at the end of the interrupt routine. Signed-off-by: Joe Chou <Joe.Chou@rdc.com.tw> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index cc5e316de571..990612328ca1 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -680,8 +680,10 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
struct net_device *dev = dev_id;
struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
- u16 status;
+ u16 misr, status;
+ /* Save MIER */
+ misr = ioread16(ioaddr + MIER);
/* Mask off RDC MAC interrupt */
iowrite16(MSK_INT, ioaddr + MIER);
/* Read MISR status and clear */
@@ -701,7 +703,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
dev->stats.rx_fifo_errors++;
/* Mask off RX interrupt */
- iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER);
+ misr &= ~RX_INTS;
netif_rx_schedule(dev, &lp->napi);
}
@@ -709,6 +711,9 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
if (status & TX_INTS)
r6040_tx(dev);
+ /* Restore RDC MAC interrupt */
+ iowrite16(misr, ioaddr + MIER);
+
return IRQ_HANDLED;
}