Commit 3e7c469f authored by Joe Chou's avatar Joe Chou Committed by David S. Miller

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: default avatarJoe Chou <Joe.Chou@rdc.com.tw>
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11e5e8f5
...@@ -680,8 +680,10 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -680,8 +680,10 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base; void __iomem *ioaddr = lp->base;
u16 status; u16 misr, status;
/* Save MIER */
misr = ioread16(ioaddr + MIER);
/* Mask off RDC MAC interrupt */ /* Mask off RDC MAC interrupt */
iowrite16(MSK_INT, ioaddr + MIER); iowrite16(MSK_INT, ioaddr + MIER);
/* Read MISR status and clear */ /* Read MISR status and clear */
...@@ -701,7 +703,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -701,7 +703,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
dev->stats.rx_fifo_errors++; dev->stats.rx_fifo_errors++;
/* Mask off RX interrupt */ /* Mask off RX interrupt */
iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER); misr &= ~RX_INTS;
netif_rx_schedule(dev, &lp->napi); netif_rx_schedule(dev, &lp->napi);
} }
...@@ -709,6 +711,9 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -709,6 +711,9 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
if (status & TX_INTS) if (status & TX_INTS)
r6040_tx(dev); r6040_tx(dev);
/* Restore RDC MAC interrupt */
iowrite16(misr, ioaddr + MIER);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment