aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/via
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2011-12-30 08:53:58 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2012-01-07 17:02:37 -0500
commita20a28bc321fefcc23f8da7ce3722e6ae7a7199d (patch)
tree5263e0cb361abefaa1ed6e20801a23f441436a08 /drivers/net/ethernet/via
parent269f3114b53a3ce93eb5977852ac2624a380f600 (diff)
via-rhine: balance interrupt acknowledge and events retrieval.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/ethernet/via')
-rw-r--r--drivers/net/ethernet/via/via-rhine.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 93987e84be18..716fd423670d 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -508,9 +508,8 @@ do { \
508 1024 - i, __func__, __LINE__); \ 508 1024 - i, __func__, __LINE__); \
509} while (0) 509} while (0)
510 510
511static inline u32 get_intr_status(struct net_device *dev) 511static u32 rhine_get_events(struct rhine_private *rp)
512{ 512{
513 struct rhine_private *rp = netdev_priv(dev);
514 void __iomem *ioaddr = rp->base; 513 void __iomem *ioaddr = rp->base;
515 u32 intr_status; 514 u32 intr_status;
516 515
@@ -521,6 +520,16 @@ static inline u32 get_intr_status(struct net_device *dev)
521 return intr_status; 520 return intr_status;
522} 521}
523 522
523static void rhine_ack_events(struct rhine_private *rp, u32 mask)
524{
525 void __iomem *ioaddr = rp->base;
526
527 if (rp->quirks & rqStatusWBRace)
528 iowrite8(mask >> 16, ioaddr + IntrStatus2);
529 iowrite16(mask, ioaddr + IntrStatus);
530 IOSYNC;
531}
532
524/* 533/*
525 * Get power related registers into sane state. 534 * Get power related registers into sane state.
526 * Notify user about past WOL event. 535 * Notify user about past WOL event.
@@ -1580,14 +1589,11 @@ static irqreturn_t rhine_interrupt(int irq, void *dev_instance)
1580 int boguscnt = max_interrupt_work; 1589 int boguscnt = max_interrupt_work;
1581 int handled = 0; 1590 int handled = 0;
1582 1591
1583 while ((intr_status = get_intr_status(dev))) { 1592 while ((intr_status = rhine_get_events(rp))) {
1584 handled = 1; 1593 handled = 1;
1585 1594
1586 /* Acknowledge all of the current interrupt sources ASAP. */ 1595 /* Acknowledge all of the current interrupt sources ASAP. */
1587 if (intr_status & IntrTxDescRace) 1596 rhine_ack_events(rp, intr_status);
1588 iowrite8(0x08, ioaddr + IntrStatus2);
1589 iowrite16(intr_status & 0xffff, ioaddr + IntrStatus);
1590 IOSYNC;
1591 1597
1592 if (debug > 4) 1598 if (debug > 4)
1593 netdev_dbg(dev, "Interrupt, status %08x\n", 1599 netdev_dbg(dev, "Interrupt, status %08x\n",
@@ -1872,7 +1878,7 @@ static void rhine_restart_tx(struct net_device *dev) {
1872 * If new errors occurred, we need to sort them out before doing Tx. 1878 * If new errors occurred, we need to sort them out before doing Tx.
1873 * In that case the ISR will be back here RSN anyway. 1879 * In that case the ISR will be back here RSN anyway.
1874 */ 1880 */
1875 intr_status = get_intr_status(dev); 1881 intr_status = rhine_get_events(rp);
1876 1882
1877 if ((intr_status & IntrTxErrSummary) == 0) { 1883 if ((intr_status & IntrTxErrSummary) == 0) {
1878 1884